Step | Current Node | Available Edges | Chosen Edge | MST So Far |
---|
Start by specifying the number of nodes (between 2 and 15) and click "Generate Nodes". Then add edges by specifying the "From" node, "To" node, and the weight of the edge.
Click "Run Prim's Algorithm" to start the visualization. The algorithm will find the Minimum Spanning Tree (MST) step by step.
Use the "Next Step" and "Previous Step" buttons to navigate through the algorithm. The explanation panel will describe what's happening at each step.
Prim's algorithm works by starting at an arbitrary node and repeatedly adding the cheapest edge that connects a node in the MST to a node outside the MST until all nodes are included.