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 

(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

1 Expert Approved Answer
Step: 1 Unlock

import heapq def primgraph start mst visited set edges 0 start start while edges weight frm to heapq... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Algorithms Questions!