Data Structures & AlgorithmsVery hardGATE CS (PYQ pattern)

An undirected graph on vertices a-f has edges ab(1), bc(2), ac(2), cd(3), bd(3), de(1), ce(4), ae(4), ef(2), df(2). How many distinct minimum spanning trees does it have?

  1. A. 6
  2. B. 4
  3. C. 8
  4. D. 12

Correct answer: C. 8

The MST weight is 9: ab and de are forced (weight 1), and then the equal-weight ties are choices of one edge from {bc, ac}, one from {cd, bd}, and one from {ef, df}, giving 2 × 2 × 2 = 8 trees (checked by enumerating all spanning trees).

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic