Skip to content

jamylak/kahns01

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kahn's Algorithm Visualizer

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.

What This Visualisation Shows

  • 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

Visual Map

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
Loading

Controls

  • q: quit
  • space: autoplay or pause
  • r: reset
  • esc: exit
  • Additional queue and graph controls are shown in-app

Run

make run

About

Kahns Visualiser

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors