Question: Like the Kruskal's algorithm, Prim's algorithm is a well - known algorithm to determine minimum spanning trees on a graph. For this question, you will
Like the Kruskal's algorithm, Prim's algorithm is a wellknown algorithm to determine minimum spanning trees on a graph. For this question, you will illustrate the working of the Prim's algorithm on a graph assigned to you. You should illustrate the working of the algorithm through a sequence of iterations as shown in Example Graphs and
The highlevel description of the Prim's algorithm is as follows:
Step : Initialize the tree with a single vertex, chosen arbitrarily from the graph. Initialize the set of candidate edges with the edges connecting the vertex in the tree to the vertices that are not yet in the tree.
Step : Grow the tree by one edge: Among the edges referred to as the candidate edges that connect the vertices in the tree to the vertices that are not yet in the tree, find the edge of the minimum weight and transfer it to tree if two or more candidate edges are of the same minimum weight, break the tie arbitrarily
Step : Update the set of candidate edges as follows:
Include the edges if any that are between the recently included vertex in the tree from Step and to vertices that are not yet in the tree
Exclude the candidate edges if any that are between the recently included vertex in the tree from Step and to vertices that are already in the tree.
Step : Repeat Steps and until all the vertices in the tree.
The working of the above algorithm is illustrated below on two example graphs.
In each iteration, the candidate edges are shown in dotted lines and the tree edges are shown in bold lines.
Also, the vertices that are included in the tree are highlighted in yellow and the vertices that are not yet in the tree are not highlighted.
You should show similar work on the graph assigned to you. Example Graph
Example Graph
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
