Kruskal's Algorithm is a greedy algorithm used to find the Minimum Spanning Tree (MST) of an undirected graph.
It works by sorting all edges by weight and then adding edges one by one to the MST,
ensuring that no cycles are formed. This visualization demonstrates the construction of the MST
step by step, highlighting the edges in the order they are added.
The algorithm uses the Union-Find data structure to efficiently check if two nodes are in the same connected
component.
Union-Find supports two operations efficiently: Find, to determine the root of a node, and Union, to
merge two components.
By using path compression and union by rank, these operations run in nearly constant time.