Technique · CP 2400+
Dominator Tree
In a directed graph rooted at s, u dominates v if every s -> v path passes through u. The dominator tree (Lengauer-Tarjan, near-linear) answers 'which vertices lie on every path'. On a DAG, idom(v) is the LCA of v's predecessors, processed in topological order.
0%
mastery
0/2 solved
0/2 solved
Recognise it
The signal
directed graph: which cities must every route from 1 to n pass through
1Brute force
Delete each vertex and re-test reachability: O(n(n + m)).
2The observation
One reachability test per vertex.
3Why it works
idom(v) is v's closest strict dominator, and v's dominators are exactly its ancestors in the tree.
Reach for it when
- +vertices that lie on all shortest paths (shortest-path DAG)
Not when
- ×undirected graphs (articulation points / block-cut-tree)
Practice
0/2 solved
- Critical CitiesCSESHard
- Visiting CitiesCSESHard
Pitfalls
Misconceptions
- !using articulation points on a directed graph