Apply Prim’s algortihm to the following graph. Include the priorityqueue all the vertices not already in the tree
Solution
We apply the Prims algorithm to find the Minimum Spanning Treei.e all vertices once visited, edge weights add to the minimumpossible without leading to a loop or cycle in the tree or graph.The decrease key algorithm for priority queue method has thefollowing three steps.
1. We will iterate through all the nodes in the priorityqueue.
2. Find the next node for which we will then decrease thekey.
3. Once this node is found, remove it from the priority queueupdate it and add
OR
OR