Prim's Algorithm

What is Prim's Algorithm?

Prim's Algorithm is an algorithm that is used to find a minimum spanning tree (MST) in a weighted, undirected graph.

Steps:

  1. Pick starting node.
  2. Find the least-cost edge that connects a node that is not yet in the MST with one that is in the MST.
  3. Repeat step 2 until you have a complete MST.

Find more information here.