This visualisation uses AI Generated code, finetuned for the best visualisation, not code quality
kahns.mov
Interactive Raylib visualizer for topological sorting with Kahn's algorithm, exposing in-degree updates, queue evolution, and the order in which DAG nodes become available.
- How zero in-degree nodes enter the queue
- How removing one node changes the in-degrees of its outgoing neighbors
- How the topological ordering is constructed incrementally
- Why cycles prevent the algorithm from consuming the whole graph
flowchart LR
A["Directed Acyclic Graph"]
B["Compute In-Degrees"]
C["Push Zero In-Degree Nodes"]
D["Pop Queue Front"]
E["Decrement Neighbor In-Degrees"]
F["Topological Order"]
A --> B
B --> C
C --> D
D --> E
E --> C
D --> F
q: quitspace: autoplay or pauser: resetesc: exit- Additional queue and graph controls are shown in-app
make run