Data Structures & AlgorithmsVery hardGATE CS · Advanced

A directed graph has the vertices A, B, C, D, E, F, G, H, I and the arcs A→E, B→E, B→F, D→C, E→B, E→C, G→E, G→I, H→B, H→F, I→C, I→H. What is the minimum number of new arcs that must be added so that the graph becomes strongly connected?

  1. A. 8
  2. B. 5
  3. C. 3
  4. D. 2

Correct answer: C. 3

Condense the strongly connected components into a DAG. The minimum number of arcs needed is max(number of source components, number of sink components) = max(3, 2) = 3; an isolated component counts as both.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic