Master Mathematics.

Programming · Graph Algorithms · Problem 5

Reachability in the reversed graph

is a directed graph (possibly with cycles, no self-loops, not necessarily strongly connected), and reverses every edge. BFS or DFS from visits exactly the vertices reachable from . Which statement must always be true?

  1. (A) If is reached in the BFS of from , then is reached in the DFS of from .
  2. (B) In , BFS from visits exactly the same set of vertices as DFS from in .
  3. (C) The order of vertices visited in the BFS of from is the reverse of the order in the DFS of from .
  4. (D) If is reached in the DFS of from , then is reached in the BFS of from .

Source: GATE DA