Question Details

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?

Options

A

In GR, BFS traversal from V will visit exactly the same set of vertices as the DFS from V in G.

B

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.

C

If U is a reachable vertex in the BFS of GR from V then U is also a reachable vertex in the DFS of G from V.

D

The order of vertices visited in the BFS of GR from V is the reverse of the order of vertices visited in the DFS of G from V.

Show Answer
Correct Answer
B 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:
V→v1→v2→⋯→vk→U
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 x→y in G, there exists a corresponding directed edge y→x 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:
U→vk→⋯→v2→v1→V
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.

Transparent Access on Mindyard

Built for Learners & Educators Alike

Completely free for students. Educators & coaching institutes get 2 months free Pro trial to create tests.

FREE FOR STUDENTS

Practice & Learn Free for Students

Access unlimited practice questions, detailed step-by-step solutions, and exam study materials — completely free for students.

  • Unlimited mock tests & question bank practice
  • Full access to curated study library & formula notes
  • 100% free for students • No credit card required
2 MONTHS FREE TRIAL

Educators & Coaching Institutes

Create and conduct professional online assessments with AI question generation, tab proctoring, and comprehensive batch management.

  • AI question uploader & rapid test generator
  • Anti-cheating tab proctoring & performance reports
  • Full Pro access free for 60 days • No upfront commitment
Discover more resources

You may also like

Mock Tests

View All
  • GATE
  • beginner
  • 3 hours
  • computer science and information technology

Prepare effectively for GATE 2026 Computer Science & Information Technology (CS & IT) with this comprehensive Question Paper with Solutions. This resource includes detailed explanations, concept-wise solutions, previous year paper analysis, and exam-oriented practice to help aspirants strengthen core subjects like Data Structures, Algorithms, Operating Systems, DBMS, Computer Networks, Theory of Computation, Compiler Design, and more. Perfect for revision, self-assessment, and boosting your GATE 2026 preparation strategy.

  • GATE
  • intermediate
  • 3 hours
  • computer science and information technology

Prepare for GATE 2026 Electrical Engineering (EE) with high-quality study material, previous year question papers, mock tests, syllabus updates, exam pattern, and expert preparation strategies. Master core EE subjects including Power Systems, Control Systems, Electrical Machines, Circuit Theory, Signals & Systems, Power Electronics, and Measurements to secure a top rank in GATE 2026.

Ask AI Tutor
5 left
Q1 View Question & Options
AI Tutor is solving this question...
Reading question context & options...
Ask your own doubt or choose a quick prompt: