Consider the following undirected graph, where each edge is labeled with its…

2025

Consider the following undirected graph, where each edge is labeled with its weight.

What is the number of distinct minimum-weight spanning trees of the graph?

  1. A.

    3

  2. B.

    4

  3. C.

    5

  4. D.

    2

Attempted by 7 students.

Show answer & explanation

Correct answer: A

Concept: Kruskal's algorithm builds a minimum spanning tree by adding edges in strictly increasing order of weight, skipping any edge that would close a cycle among vertices already connected. When completing the tree requires choosing exactly one further edge from among several tied, equally valid edges — each joining two vertices that are still in different components — every valid choice at that final step gives a distinct minimum-weight spanning tree, so the number of MSTs equals the number of such valid choices.

Application:

  1. The graph has 9 vertices, so any spanning tree needs exactly 8 edges.

  2. There are 7 edges of weight 0.1 and 5 edges of weight 0.9. Kruskal's algorithm always adds the lowest available weight first, so all 7 weight-0.1 edges are considered before any weight-0.9 edge.

  3. Adding all 7 weight-0.1 edges creates no cycle: they merge the graph into exactly two components — the three vertices of the top row (using 2 of the weight-0.1 edges), and the remaining six vertices of the lower block (using the other 5 weight-0.1 edges). That accounts for all 7 edges and all 9 vertices, split into a 3-vertex component and a 6-vertex component.

  4. One more edge is now needed to join the two components into a single tree (7 + 1 = 8 edges total). Among the 5 remaining weight-0.9 edges, exactly 3 run from a vertex in the top-row component to a vertex in the lower block; the other 2 run between two vertices that are already inside the lower block, so adding either of those would close a cycle instead of extending the tree.

  5. Since all 3 of those cross-component edges share the same weight (0.9) and each individually completes a valid, cycle-free spanning tree, each gives rise to a distinct minimum-weight spanning tree.

Cross-check: Every such tree has the same total weight — 7 × 0.1 + 1 × 0.9 = 1.6 — confirming all three trees are genuinely tied for minimum weight. No lower-weight combination is possible, since every weight-0.1 edge is forced: skipping any one of them would leave a vertex reachable only through a higher-weight edge.

Answer: The graph has exactly 3 distinct minimum-weight spanning trees.

Explore the full course: Coding For Placement

Loading lesson…