Consider a weighted complete graph G on the vertex set {v1, v2, ..vn} such…
2006
Consider a weighted complete graph G on the vertex set {v1, v2, ..vn} such that the weight of the edge (vi, vj) is 2|i-j|. The weight of a minimum spanning tree of G is: (GATE CS 2006)
- A.
n — 1
- B.
2n — 2
- C.
nC2
- D.
2
Attempted by 143 students.
Show answer & explanation
Correct answer: B
Answer: 2n — 2
Reasoning:
The edge weight is 2|i − j|, so the smallest possible edge weight is 2, occurring exactly for edges between consecutive vertices v1–v2, v2–v3, …, v_{n−1}–v_n.
There are n − 1 such consecutive edges and they form a simple path that connects all vertices, so these edges by themselves form a spanning tree.
By Kruskal's algorithm (or by choosing the smallest available edges), the algorithm will pick these n − 1 edges of weight 2 and stop, giving total weight (n − 1) × 2 = 2n − 2.
As a lower bound, any spanning tree has n − 1 edges and each edge has weight at least 2, so the total weight cannot be less than 2(n − 1). This proves optimality.
A video solution is available for this question — log in and enroll to watch it.