GATE / CS ARCHIVE

GATE CSE 2009 / QUESTION 38

Invalid Kruskal edge order

Algorithms · Graph Algorithms · Full GATE CSE 2009 paper

GATE 2009, Q38 2 marks · MCQ
Report issue

Graph Algorithms

Question 38, GATE 2009: Weighted undirected graph edges ab 5, ac 3, bc 4, be 2, bd 6, cd 5, de 6, df 6, cf 6, ef 3, eg 5, fg 4. Which accepted-edge sequence cannot be Kruskal? A be, ef, ac, bc, fg, cd; B be, ef, ac, fg, bc, cd; C be, ac, ef, bc, fg, cd; D be, ef, bc, ac, fg, cd.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step through it (4 options)

Kruskal considers accepted edges in nondecreasing weight. The relevant weights are be 2, ef 3, ac 3, bc 4, fg 4, cd 5. Equal-weight 3 or 4 edges may be interchanged in the valid choices. D instead accepts bc of weight 4 before ac of weight 3, even though ac can be safely accepted at that point. Thus D is not a possible Kruskal acceptance order.

Kruskal sorts by edge weight and accepts an edge whenever it connects two different components. The unique weight 2 edge be comes first. Both weight 3 edges ef and ac can be accepted, in either order, before any weight 4 edge. The weight 4 pair bc, fg can also be exchanged. D violates this by putting bc before ac. At that point ac is not cyclic, so it cannot have been skipped. The other orders respect both sorted weights and cycle avoidance.

Original paper, page 9