An interactive Tkinter tool for building a graph and visualizing Minimum Spanning Tree algorithms.
- Click to place vertices (you choose the total count in the console before the GUI launches)
- Click two vertices to create an undirected edge and enter its weight
- Color scheme:
- Green: edges in the final MST
- Blue: edge currently being considered
- Red: rejected edge
- Amber: visited nodes (Prim)
- Runs Kruskal first, then Prim
- Prompts in the console for a valid starting vertex for Prim
- Python 3.9+
python mst_visualizer.pyFollow the console prompt to enter the total number of vertices. In the GUI:
- Click to place exactly N vertices.
- Click two vertices to add an edge and enter a numeric non-negative weight.
- Click "Run Visualizations (Kruskal → Prim)".
- When prompted, enter the starting vertex for Prim in the console (0-based index).
- Self-loops are ignored. Duplicate edges are prevented.
- The graph is undirected and weights must be non-negative.