Topological Sort (Kahn's Algorithm)

Arthur Kahn, 1962

O(V + E)

Published by Arthur Kahn in 1962, this algorithm produces a topological ordering of a directed acyclic graph by repeatedly removing nodes with zero in-degree. Each removed node is appended to the sorted output, and its outgoing edges are deleted, potentially creating new zero-degree nodes. The visualization shows a DAG with directed arrows, in-degree labels on each node, and a growing sorted output row at the bottom. Removed nodes and edges fade, while the currently peeled node glows gold.