What is a Union Find Visualizer?
A union find visualizer shows how disjoint set union keeps track of connected components. Each node has a parent pointer. The root of a set represents the component.
Union find is common in graph connectivity, Kruskal’s minimum spanning tree algorithm, cycle detection, network grouping, and coding interview problems.
For the full cluster of related tools, browse the Data Structure Visualizers hub.
How to use this union find visualizer
- Create nodes such as
A B C D E F. - Run
union A Bto merge two sets. - Run
find Ato find the root of a node. - Run
connected A Cto check whether two nodes share the same root. - Toggle path compression to see parent pointers flatten after find operations.
The diagram shows each node, its parent pointer, rank, and current component root.
Union find and graph connectivity
Union find answers whether two nodes belong to the same connected component. It does not traverse a graph edge by edge like BFS or DFS. Instead, it merges components as edges are processed.
To compare both approaches, use this page with the Graph BFS DFS Visualizer. For a direct minimum spanning tree use case, try the Kruskal Algorithm Visualizer. For weighted graph shortest paths, use the Dijkstra Algorithm Visualizer.