Topological Sort — Process Zero In-degree First

Kahn’s BFS for topological sort repeatedly takes nodes with zero in-degree, and cycle detection comes along without extra logic. The mechanism, the Course Schedule problems, and the selection criteria against DFS post-order.

July 3, 2026 · 5 min read