Overview
Dynamic Programming on DAGs uses topological order so each node is solved after all states it depends on are ready.
Solves graph problems by processing directed acyclic graph nodes in dependency order.
Compact metadata for implementation and discovery.
Dynamic Programming on DAGs uses topological order so each node is solved after all states it depends on are ready.
Quick facts
Runtime and memory behavior at a glance.
Best
O(V + E)
Average
O(V + E)
Worst
O(V + E)
Space
O(V)
dp[v] = combine(dp[u], edge(u, v)) for predecessors uUpdates a node from already-computed predecessor states.
Show values flowing forward along a DAG after each dependency has been solved.
The method does not apply directly to graphs with cycles unless the cycle structure is handled separately.
What each reference supports for this entry.
Textbook support for Dynamic Programming on DAGs's standard algorithm design, invariants, and complexity analysis.
Open sourceAlgorithm catalog support for Dynamic Programming on DAGs's problem context, known alternatives, and practical selection tradeoffs.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Dynamic programming on DAGs processes states in topological order so dependencies are solved first.