GATE Computer ScienceVery hardGATE CS

A directed graph on vertices 0 to 11 has edges 0→1, 1→2, 2→0, 2→3, 3→4, 4→3, 5→3, 5→6, 6→7, 7→6, 8→9, 9→10, 10→8, 10→5, 11→3. What is the minimum number of edges that must be added so that the graph becomes strongly connected?

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

Correct answer: B. 3

Condense the strongly connected components: {0,1,2}, {3,4}, {5}, {6,7}, {8,9,10}, {11}. The condensation has 3 sources ({0,1,2}, {8,9,10}, {11}) and 2 sinks ({3,4}, {6,7}), so the minimum number of added edges is max(sources, sinks) = 3.

More Algorithms questions

Exams that ask this topic