Consider a directed graph , where is the finite set of vertices and is the set of directed edges between the vertices. may contain cycles but there is no self-loop. Further, may not be strongly connected.
Let be the graph obtained by reversing the directions of all the edges in without changing the set of vertices.
Assume that Breadth First Search (BFS) or Depth First Search (DFS) from any given vertex of a graph visits only the reachable vertices from in that graph.
Which of the following statements must always be true, regardless of the structure of ?
- (A)
If is a reachable vertex in the BFS of from , then is also a reachable vertex in the DFS of from .
- (B)
In , the BFS traversal from will visit exactly the same set of vertices as the DFS from in .
- (C)
The order of vertices visited in the BFS of from is the reverse of the order of vertices visited in the DFS of from .
- (D)
If is a reachable vertex in the DFS of from , then is also a reachable vertex in the BFS of from .
