This page outlines Prim's Algorithm, an algorithm that finds the minimum spanning tree of a graph.
Steps of Prim's Algorithm:
- Mark start node v as visited.
- Add v's outgoing edges to a priority queue.
- While the queue is not empty, repeat steps 4-8.
- Remove the smallest edge in the queue.
- If the node u at the end of this edge is unvisited, do steps 6-8.
- Mark u as visited.
- Add u to the spanning tree.
- Insert u's outgoing edges into the queue.