Topological Sort

DAG ordering with Kahn's Algorithm (BFS) — step by step
DAG type
Nodes
9
Step delay (ms)
600
Click "Run Kahn's" to animate topological sort
Kahn's algorithm: enqueue nodes with in-degree 0, process them one by one,
decrement neighbors' in-degrees. If a cycle exists, not all nodes are sorted.