Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1.86 KB

File metadata and controls

42 lines (29 loc) · 1.86 KB

Kruskal's Algorithm Project

Overview

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.


Features

  • 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.

How to Run

  1. Clone the repository:
    git clone https://www.github.com/jadwinder/Kruskal_Algorithm_Visualizer.git
    cd Kruskal_Algorithm_Visualizer
    
    

Some Screenshots

image image image image image