Let be a depth first search tree in an undirected graph . Vertices and are leaves of this tree . The degrees of both and in are at least 2. which one of the following statements is true?
GATE CSE 2006Algorithms › Graph AlgorithmsVerified
GATE CSE 2006 PYQ: Let T T T be a depth first search tree in an undirected graph G G G . Vertices u u u and ν ν ν are leaves of…
- AThere must exist a vertex adjacent to both and in
- BThere must exist a vertex whose removal disconnects and in
- CThere must exist a cycle in containing and
- DThere must exist a cycle in containing and all its neighbours inCorrect answer
Answer
(D) There must exist a cycle in G G G containing u u u and all its neighbours in G G G
Approach
Use the standard property of DFS on undirected graphs: every non-tree edge is a back edge joining a vertex to an ancestor. Since u is a leaf of the DFS tree T, the only tree edge incident to u is to its parent; all other neighbours of u in G are therefore ancestors of u. The ancestors of u in T form a single chain, and the highest such ancestor adjacent to u gives a cycle that includes u and all its neighbours.
In an undirected DFS tree, a leaf u has only its parent as a tree neighbour, and all other neighbours are ancestors. Because deg(u) >= 2, at least one ancestor is connected to u by a back edge. The tree path from that ancestor to u plus the back edge forms a cycle that necessarily includes every neighbour of u. Hence option D is the only forced statement.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.