Question: (a) Find a connected graph on at least 6 vertices where Prim's Algorithm and Kruskal's Algorithm might give different answers for the minimal spanning
(a) Find a connected graph on at least 6 vertices where Prim's Algorithm and Kruskal's Algorithm might give different answers for the minimal spanning tree. Justify why your answer is correct. (b) Prove that if all edges have distinct weights, then Prim's Algorithm and Kruskal's Algorithm give the same answer. Assume that Prim's Algorithm and Kruskal's Algorithm actually each give a minimal spanning tree.
Step by Step Solution
There are 3 Steps involved in it
import heapq def primgraph start mst visited set edges 0 start start while edges weight frm to heapq... View full answer
Get step-by-step solutions from verified subject matter experts
