Skip to content

jamylak/unionfind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Union-Find Gravity Wells

This visualisation uses AI Generated code, finetuned for the best visualisation, not code quality

unionfind.mov

Interactive C++ + Raylib visualizer for disjoint-set union, using a gravity-well metaphor to explain union by rank, path compression, and evolving connected components.

What This Visualisation Shows

  • How roots represent components and absorb smaller structures
  • How union by rank controls tree growth
  • How path compression shortens future traversals
  • A debugger-style view that links DSU operations to code and live metrics

Visual Map

flowchart LR
    A["Separate Elements"]
    B["Find Roots"]
    C["Union by Rank"]
    D["Compress Paths"]
    E["Fewer Components"]

    A --> B
    B --> C
    C --> D
    D --> E
Loading

Controls

  • q: quit
  • space: step one operation
  • a: toggle auto-play
  • r: reset
  • h: toggle help

Run

make run

Releases

No releases published

Packages

 
 
 

Contributors