This project implements Kruskal's Minimum Spanning Tree (MST) algorithm with both graphical and non-graphical modes. It is built in Java (Swing GUI) for visualizing the algorithm’s steps.
Kruskal's algorithm is a classic greedy algorithm used to find a minimum spanning tree in a weighted, undirected graph. It selects edges in order of increasing weight and adds them to the MST if they do not form a cycle.
-
Graphical Visualization:
- Original graph and MST are displayed side by side.
- Chosen edges are highlighted in green, rejected edges in red.
- Step-by-step animation showing the MST construction.
- Edge weights and node labels are clearly displayed.
-
Non-Graphical Mode:
- User can input adjacency matrix.
- Algorithm prints chosen and rejected edges with minimum cost.
-
User-Friendly Interface:
- Clickable buttons for choosing mode.
- Auto-scrolling console for selected/rejected edges.
- Clone the repository:
git clone https://www.github.com/jadwinder/Kruskal_Algorithm_Visualizer.git cd Kruskal_Algorithm_Visualizer




