Topological Sort (Kahn) Playground

The mill’s job cards from drying to loading on the big board: Kahn with in-degrees and its queue, or DFS tracing to the end (which job enters the order…

Why it matters

Build order (make, bundlers), package installs (npm, apt), database migrations, a spreadsheet recalculating cells, courses with prerequisites: all topological orders. And when dependencies loop, those tools refuse, exactly because no such order exists.

The key idea

Take what waits for no one

Common mistakes

Try it in this playground