Consider the graph given below: Question: Use Kruskal’s algorithm to find a…
2017
Consider the graph given below:

Question: Use Kruskal’s algorithm to find a minimum spanning tree for the graph. Which option lists the tree edges in the order in which they are chosen?
- A.
AD, AE, AG, GC, GB, BF
- B.
GC, GB, BF, GA, AD, AE
- C.
GC, AD, GB, GA, BF, AE
- D.
AD, AG, GC, AE, GB, BF
Attempted by 387 students.
Show answer & explanation
Correct answer: C
Correct answer: GC, AD, GB, GA, BF, AE
Key idea: Kruskal’s algorithm sorts edges by increasing weight and skips any edge that would form a cycle.
Pick GC with weight 2.
Pick AD with weight 2.
Pick GB with weight 3.
Pick GA with weight 3; this connects the {G, C, B} component with the {A, D} component.
Pick BF with weight 4 to include F.
Pick AE with weight 4 to include E.
After these six edges, all seven vertices are connected and no cycle has been formed.
Final MST order: GC, AD, GB, GA, BF, AE.