CalcWorldHub
Free online calculator · no signup

Dependency graph topological ordering calculator

Order dependency-constrained nodes so that every predecessor appears before its successor.

4,000 tools
Dependency graph topological ordering calculator — Activity or node count, Dependencies as from to, comma separated and calculation method
Dependency graph topological ordering calculator: inputs and calculation method.

How to use this calculator

Order dependency-constrained nodes so that every predecessor appears before its successor.

  1. Enter Activity or node count, Dependencies as from to, comma separated. Match the units shown beside each field and review the result together with the assumptions below.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Calculation guide

Dependency graph topological ordering explained

Nodes in valid order4
Nodes in valid order: 4 in the worked scenario.

How the calculation works

Kahn zero-indegree ordering

Count incoming dependencies, repeatedly emit a ready node, and remove its outgoing dependencies. Ready nodes are selected in increasing numeric order. If fewer than n nodes can be emitted, a directed cycle remains.

Set up the calculation

n — Activity or node count
Activity or node count. Enter a whole number.
e — Dependencies as from to, comma separated
Dependencies as from to, comma separated.

Limits of this model

Directed acyclic graphs only; cycles are rejected. Isolated nodes are retained and lower-numbered ready nodes are preferred.

Check this example

Activity or node count = 4; Dependencies as from to, comma separated = 1 2, 1 3, 2 4, 3 4.

  • Nodes in valid order: 4
  • Topological order: 1, 2, 3, 4

Interpreting the result

The listed sequence is one valid order in which every prerequisite appears before its dependent node. A different order may also be valid when independent activities can be swapped; this result assigns no durations or resources.

Frequently asked questions

Can more than one correct order exist?

Yes.

Does this calculate activity timing?

No, use the critical-path calculator for durations and float.

How do I represent an edgeless graph?

Enter none.

How do I use the Dependency graph topological ordering calculator?

Enter Activity or node count, Dependencies as from to, comma separated. Match the units shown beside each field and review the result together with the assumptions below.

What is a worked example of Dependency graph topological ordering?

Activity or node count = 4; Dependencies as from to, comma separated = 1 2, 1 3, 2 4, 3 4. Nodes in valid order: 4 Topological order: 1, 2, 3, 4