Consider the directed graph G = (V, E) where V is the finite set of vertices and E is the set of directed edges between the vertices. G may contain cycle but there is no self-loop, further G may not be strongly connected. Let GR be the graph obtained by reversing direction of all edges without changing set of vertices. Assume that BFS or DFS for any given vertex V of a graph will visit only the reachable vertices from V in that graph. Which of the following statement must always be true regardless of the structure of G?
Correct Answer :
If U is a reachable vertex in the DFS of G from V then V is also a reachable vertex in the BFS of GR from U.
Solution :
The correct option is: If U is a reachable vertex in the DFS of G from V then V is also a reachable vertex in the BFS of GR from U.
Here is the step-by-step explanation of why this statement is always true:
1. Understanding Reachability in Graph G:
If a vertex U is reachable from V in the directed graph G, it means there exists a directed path starting at V and ending at U. Let this path be represented as:
where each transition represents a directed edge in the set of edges E of G.
2. Reversing the Edges (Graph GR):
The graph GR is constructed by reversing the direction of all edges in G. This means that for every directed edge in G, there exists a corresponding directed edge in GR.
3. Path in the Reversed Graph:
Applying this reversal to our original path from V to U, the reversed path exists in GR as:
Since this sequence of directed edges exists in GR, it implies that V is reachable from U in the graph GR.
4. Traversal Reachability:
By definition, a Breadth-First Search (BFS) or Depth-First Search (DFS) starting from a vertex will visit all vertices that are reachable from it. Since V is reachable from U in GR, any BFS traversal starting from U in GR must eventually visit V. Thus, V is a reachable vertex in the BFS of GR from U.
Access expert-curated educational resources and study materials—completely free.
Create, conduct, and manage professional online assessments with Mindyard. Perfect for teachers and institutes.
Copyright © 2026 Mindyard. All Rights Reserved.