Consider a graph , where , , and weight of the edge is . The weight of minimum spanning tree of is ____________.
GATE 2020 CS Q.49: solution and answer
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)
A spanning tree on |V| = 100 vertices has exactly 100 - 1 = 99 edges (standard property of trees).
Every edge has weight , since and are distinct integers.
Therefore any spanning tree of has total weight — this is a lower bound on the MST weight.
Consider the path . It has exactly 99 edges, one between each pair of consecutive vertices, and each such edge has weight .
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 .
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
- GATE 2018 CS Q.47 · NAT · 2 marksConsider the following undirected graph G. Choose a value for x that will maximize the number of minimum…
- GATE 2026 CS1 Q.41 · MCQ · 2 marksLet G(V,E) be an undirected, edge-weighted graph with integer weights.
- GATE 2026 CS1 Q.49 · MSQ · 2 marksLet G(V,E) be a simple, undirected, edge-weighted graph with unique edge weights.
- GATE 2026 CS1 Q.50 · MSQ · 2 marksConsider the following pseudocode for depth-first search (DFS) algorithm which takes a directed graph G(V,E)…
