GATE / CS ARCHIVE

GATE CSE 2006 / QUESTION 48

Cycles through an undirected DFS leaf

Algorithms · Graph Algorithms · Full GATE CSE 2006 paper

GATE 2006, Q48 2 marks · MCQ
Report issue

Graph Algorithms

Question 48, GATE 2006: T is a depth-first-search tree of an undirected graph G. Distinct u and v are leaves of T and both have graph degree at least 2. Which statement must hold?
Options:
(A) Some vertex w is adjacent to both u and v
(B) Some vertex w has removal disconnecting u from v
(C) Some cycle contains both u and v
(D) Some cycle contains u and every neighbor of u
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. In an undirected DFS, every non-tree edge joins a vertex to an ancestor. Since u is a DFS leaf, all its neighbors lie on its single root-to-u tree path.

2. Let w be its highest ancestor-neighbor. The tree path w to u plus the edge uw forms a cycle containing every neighbor of u, since all those neighbors lie between w and u.

3. Degree at least two ensures a genuine cycle. Thus D.

4. Two distinct cycles sharing only a root refute the asserted common cycle; other DFS graphs refute the universal common neighbor and separator assertions.

5. Teaching check: DFS in an undirected graph has no cross edge joining separate finished subtrees. A leaf’s non-parent neighbors must therefore be ancestors. The path from its highest such neighbor to the leaf contains every other neighbor along that ancestor chain, and the closing back edge creates the required cycle.

Original paper, page 7