IAE Academy

GATE 2020 CS Q.49: solution and answer

GATE 2020 · CSQ.49 · 2 marks · NAT

Consider a graph , where , , and weight of the edge is . The weight of minimum spanning tree of is ____________.

See the question in the paper

Answer and solution

ANSWER

The weight of the minimum spanning tree of G is 99.

Official answer: 99Source: Official answer key, GATE 2020 CS (IIT Delhi)

  1. A spanning tree on |V| = 100 vertices has exactly 100 - 1 = 99 edges (standard property of trees).

  2. Every edge has weight , since and are distinct integers.

  3. Therefore any spanning tree of has total weight — this is a lower bound on the MST weight.

  4. Consider the path . It has exactly 99 edges, one between each pair of consecutive vertices, and each such edge has weight .

  5. This path connects all 100 vertices and, being a simple path, contains no cycle, so it is a valid spanning tree of with total weight exactly .

  6. Since 99 is both a proven lower bound on every spanning tree and is achieved by this explicit spanning tree, the minimum spanning tree weight of is .

KEY IDEA

G is a complete graph on 100 vertices with edge weight |i-j|; since every edge weight is a positive integer ≥ 1, any spanning tree (which needs exactly n-1 = 99 edges) has weight ≥ 99, and the path v_1-v_2-...-v_100 (using only consecutive-index edges of weight 1) achieves this bound, so it is the MST with weight 99.

WATCH OUT FOR

Trying to compute the MST by only considering "adjacent index" edges without proving optimality, or miscounting edges (using 100 instead of 99), or assuming the MST must use edges of weight exactly matching some formula like sum of 1 to 99 rather than recognizing all path edges have weight exactly 1.

From the GATE 2020 CS paper. Every question of this paper · Download the full paper · All 28 Graph algorithms questions, with notes

More Graph algorithms questions