GATE / CS ARCHIVE

GATE CSE 2001 / QUESTION 15(a)

Construct a minimum spanning tree

Algorithms · Graph Algorithms · Full GATE CSE 2001 paper

GATE 2001, Q15(a) Descriptive
Report issue

Graph Algorithms

Question 15(a), GATE 2001: Undirected vertices n1,…,n6; edges (n1,n2,2),(n1,n3,8),(n1,n6,3),(n2,n4,4),(n2,n5,12),(n3,n4,7),(n4,n5,9),(n4,n6,4).
Question 15(a), GATE 2001: Undirected vertices n1,…,n6; edges (n1,n2,2),(n1,n3,8),(n1,n6,3),(n2,n4,4),(n2,n5,12),(n3,n4,7),(n4,n5,9),(n4,n6,4).
Question 15(a), GATE 2001: Undirected vertices n1,…,n6; edges (n1,n2,2),(n1,n3,8),(n1,n6,3),(n2,n4,4),(n2,n5,12),(n3,n4,7),(n4,n5,9),(n4,n6,4).
Tap to enlarge
Answer & solution

Answer: {n1–n2,n1–n6,n2–n4,n3–n4,n4–n5}, weight 25. (no official key was published)

Step through it (10 steps)

Apply Kruskal in nondecreasing weight order. Take n1–n2 (2), then n1–n6 (3). The weight-4 edges n2–n4 and n4–n6 both connect n4 to the same component; take either, say n2–n4. Reject the other because it closes a cycle. Take n3–n4 (7), joining n3. Reject n1–n3 (8), which now closes a cycle. Take n4–n5 (9), joining the final vertex, and stop after five edges. Total weight is 2+3+4+7+9=25. The tree is connected and acyclic; Kruskal’s cut property establishes minimality.

Original paper, page 9