You are given an undirected graph G = (V, E) with positiveweights on the edges. If the edge weights are distinct, then thereis only one MST, so both Prim’s and Kruskal’s algorithms will findthe same MST. If some of the edge weights are the same, then therecan be several MSTs and the two algorithms could find differentMSTs. Describe a method that forces Prim’s algorithm to find thesame MST of G that Kruskal’s algorithm finds.
Expert Answer
An answer will be send to you shortly. . . . .