Solution

ID: past-exam-of-the-graph-theory-course-of-the-university-of-oxford/2011/2/a/i/solution

Choose a spanning tree of the connected graph and root it at . List vertices in nonincreasing order of their distance from in this tree, breaking ties arbitrarily. The root has distance zero and is last, so .
Every other vertex has a parent one step closer to the root. That parent is adjacent to it and appears later in the ordering. Hence
For a graph of one vertex the condition is vacuous and the same ordering works.

New to topics? Read the docs here!