Applying Prim's Algorithm to a Distance Matrix
Large Networks are sometimes described using a distance matrix
Prim's in a distance matrix
- Choose any vertex to start the tree.
- Delete the row in the matrix for the chosen vertex.
- Number the column in the matrix for the chosen vertex.
- Put a ring around the lowest undeleted entry in the numbered columns.
- The ringed entry becomes the next arc to add to the graph.
- Repeat steps 2-5 until all rows are deleted.