Possible Duplicate:
Proof related to breadth first search
I'm trying to prove the following:
Suppose a connected graph $G$ has a cycle $C$ of length $n$. Prove that in any breadth-first search tree of $G$, any two vertices in $C$ are at most ${\lfloor{n/2}\rfloor}$ levels apart.
Not sure how to approach this, tried googling properties of BFST's and cycles, but no avail, any help or resources would be helpful!
HINT: Let $v_1$ be the first vertex in $C$ that you hit in your search. Its two neighbors in $C$ will be among its children in the search tree. Their neighbors other than $v$ will be one level deeper in the search tree, and so on. For each $v\in C$ let $d(v)$ be the distance from $v_1$ to $v$ in $C$ (i.e., the length of the shorter of the two routes from $v_1$ to $v$ in $C$). Can you see that $v_1$ and $v$ are at most $d(v)$ levels apart? (The actual proof of this will be a finite induction.) What’s the maximum possible value of $d(v)$ for $v\in C$?