Prim's algorithm


Using prim’s algorithm to construct a minimum spanning tree starting with A which one of the following sequences of edges represent a possible order in which the edges would be added to construct the minimum spanning tree?


Option D is correct since we add the edge (A,D) first then add edge (A,B) , now option A and C are incorrect now for third edge we can select either of (A,C) or (D,F)
If we select A,C then next we must select (C,F) (F,G) (G,E) in order to get the min spanning tree. Now we can see that option C is wrong therefore option D is correct