GATE Computer ScienceVery hardGATE CS (PYQ pattern)

Borůvka's algorithm is run on the graph with edges (weights) 0-1 (7), 0-3 (5), 1-2 (8), 1-3 (9), 1-4 (10), 2-4 (6), 3-4 (15), 3-5 (11), 4-5 (12), 4-6 (13), 5-6 (14). In the first phase every vertex picks its cheapest incident edge. How many distinct edges are selected in that phase?

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

Correct answer: D. 5

The picks are 0 → 0-3 (5), 1 → 0-1 (7), 2 → 2-4 (6), 3 → 0-3 (5), 4 → 2-4 (6), 5 → 3-5 (11), 6 → 4-6 (13). Duplicates collapse the seven picks into 5 distinct edges, leaving two components that the second phase joins with edge 1-2 (8); the MST weight is 50.

More Algorithms questions

Exams that ask this topic