Question

The number of distinct minimum-weight spanning trees of the following graph is _________

Undirected weighted graph with 7 vertices a, b, c, d, e, f, g and 12 edges: (a,b)=1, (a,g)=2, (a,f)=1, (b,c)=3, (b,g)=2, (f,g)=2, (f,e)=3, (g,c)=2, (g,d)=2, (g,e)=2, (c,d)=1, (e,d)=1.
Official answer and solution
Official answer
9
From
Official GATE 2024 answer key

Solution

Use Kruskal's algorithm: include all 4 weight-1 edges first, then count the ways to connect the resulting 3 components using weight-2 edges.

The graph has ∣V∣=7|V| = 7 vertices, so any spanning tree contains ∣V∣−1=6|V| - 1 = 6 edges:

  1. Weight-1 edges: There are 44 edges of weight 11: (a,b),(a,f),(c,d),(e,d)(a, b), (a, f), (c, d), (e, d). They form no cycles, so all 44 must be in every MST. Including them partitions the vertices into 33 connected components:
    C1={a,b,f},C2={g},C3={c,d,e}C_1 = \{a, b, f\}, \quad C_2 = \{g\}, \quad C_3 = \{c, d, e\}
  2. Weight-2 edges: To connect the 33 components C1,C2,C3C_1, C_2, C_3 using 22 additional edges of minimum weight (22):
    • We must pick exactly 11 of the 33 weight-2 edges between C1C_1 and gg: (a,g),(b,g),(a, g), (b, g), or (f,g)(f, g) (3 choices).
    • We must pick exactly 11 of the 33 weight-2 edges between C3C_3 and gg: (c,g),(d,g),(c, g), (d, g), or (e,g)(e, g) (3 choices).

Therefore, the number of distinct minimum-weight spanning trees is 3×3=93 \times 3 = 9 (each of weight 4×1+2×2=84 \times 1 + 2 \times 2 = 8).

Final answer

9

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2024 Computer Science and Information Technology - Set 2 (CS2)
Question
59 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.