Graph Algorithms

Kruskal's Algorithm

Find the Minimum Spanning Tree (MST) by sorting edges by weight and adding them if they don't form a cycle (using Union-Find data structure).

Input Graph

Enter edges as: from to weight (one per line)

Each line represents an edge: source destination weight. Nodes are identified by letters or numbers.

Trace

Step-by-step execution showing sorted edges and cycle detection.

  1. Run the algorithm to populate steps.