0PricingLogin
Competitive Programming Academy · Lesson

Topological Sort with Kahn's Algorithm

Order tasks that depend on others.

What Topological Order Is

A topological order lists every node of a directed graph so each edge points from earlier to later. Think tasks before the tasks that need them.

Only DAGs Allowed

This works only on a DAG, a directed acyclic graph. If a cycle exists, no valid order can ever satisfy every dependency.

All lessons in this course

  1. Topological Sort with Kahn's Algorithm
  2. Detect Cycles in Directed Graphs
  3. Strongly Connected Components
  4. Bridges & Articulation Points
← Back to Competitive Programming Academy