Graph Topological Sort

Order the nodes of a directed acyclic graph with Kahn's algorithm, always emitting the lexicographically smallest available node first.

Description

Order a directed acyclic graph so every source precedes each destination.

Topological Sort Calculator order a directed acyclic graph so every source precedes each destination.

Use this for dependency planning, build steps, prerequisite ordering, migration sequences, and validating that a directed graph is acyclic.

When to use Topological Sort Calculator

Use this for dependency planning, build steps, prerequisite ordering, migration sequences, and validating that a directed graph is acyclic.

How it works

Kahn's algorithm tracks incoming-edge counts and repeatedly emits the lexicographically smallest zero-indegree node for deterministic output.

Interpreting the result

Keep the input units, direction conventions, encoding, and ordering rules visible when reusing the result. Preserve the full returned value for downstream calculations and round only for presentation.

Assumptions and limitations

A topological order exists only for directed acyclic graphs and may not be unique. This tool rejects cycles rather than returning a partial order.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies