GATE / CS ARCHIVE

GATE CSE 2003 / QUESTION 68

Minimum spanning tree of a weighted graph

Algorithms · Graph Algorithms · Full GATE CSE 2003 paper

GATE 2003, Q68 2 marks · MCQ
Report issue

Graph Algorithms

Question 68, GATE 2003: Find the weight of a minimum spanning tree of the undirected weighted graph with vertices a,b,c,d,e,f,g,h,i,j and edges:
ac:1; ad:2; cd:2; bg:2; ei:2; bd:3; fh:4; hi:4; ij:5; ab:6; ae:8; eh:8; gh:8; fi:9; ef:11; gi:14; dh:15; gj:19.
These edges describe the complete printed diagram; no other edges are present.
A. 29  B. 31  C. 38  D. 41
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Step through it (15 steps)

1. Kruskal processes edges by nondecreasing weight, accepting an edge only when its endpoints lie in different components.
2. Accept ac(1), ad(2); reject cd(2), since a,c,d are already connected. Accept bg(2), ei(2), then bd(3), which joins {b,g} with {a,c,d}.
3. Accept fh(4), hi(4), connecting {f,h} to {e,i}; accept ij(5) to add j. Reject ab(6), whose endpoints are already in the first component.
4. The two remaining components are {a,b,c,d,g} and {e,f,h,i,j}. Any weight-8 edge ae or gh can join them; choose gh. Nine accepted edges connect all ten vertices.
5. Total=1+2+2+2+3+4+4+5+8=31, B. eh(8) is internal to the second component and is not needed.

Solution: Kruskal's algorithm can select ac(1), ad(2), bg(2), ei(2), bd(3), fh(4), hi(4), ij(5), and gh(8). These nine edges connect all ten vertices without a cycle. Their total is 1+2+2+2+3+4+4+5+8=31, option B. The other weight-2 edge cd is skipped because ac and ad already connect c and d; the final weight-8 edge joins the two remaining components. Equal-weight alternatives may produce a different MST with the same total.

Original paper, page 10