How to use this calculator
Order dependency-constrained nodes so that every predecessor appears before its successor.
- 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.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Dependency graph topological ordering explained
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
Method reference: NetworkX graph algorithm definitions.
Read our calculation methodology.