GATE 2011 CS (CS1) – Question 64
An undirected graph has vertices v₁,…,vₙ, n>2. Vertices vᵢ,vⱼ are adjacent iff 0<|i−j|≤2; edge weight is i+j. The drawing shows n=4. Find MST cost for general n.

Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (B) $n^2-n+1$
Explanation
Kruskal selects edge (1,2) of weight three, then for each j≥3 the lighter edge to j is (j−2,j), of weight 2j−2. These edges connect every new vertex and form a tree. Total is $3+\sum_{j=3}^n(2j-2)=3+[n(n-1)-2]=n^2-n+1$, B.
More Graph Algorithms: Traversals, Minimum Spanning Trees, Shortest Paths questions
- GATE 2011 CS (CS1) Q65
- GATE 2010 CS (CS1) Q60
- GATE 2010 CS (CS1) Q61
- GATE 2015 CS (CS2) Q47
- GATE 2015 CS (CS3) Q55
- GATE 2021 CS (CS2) Q11
All Graph Algorithms: Traversals, Minimum Spanning Trees, Shortest Paths questions →