Prim's Algorithm to form Minimum Spanning Tree
3 Nodes
4 Nodes
5 Nodes
6 Nodes
7 Nodes
8 Nodes
Generate Graph
Start Algorithm
Next Step
Reset
Show/Hide Matrix
Node
Included in MST
Graph Edge
MST Edge
Considered Edge
Algorithm Status
Please generate a graph to begin.
Adjacency Matrix
Edit edge weights (0 or blank means no edge):