Technique · CP 2400+
Block-Cut Tree / Bridge Tree
Compress the graph into a tree of biconnected blocks and articulation points (or of 2-edge-connected components joined by bridges). Questions like 'must every u-v path pass through c' become tree-path and LCA queries.
0%
mastery
0/4 solved
0/4 solved
Recognise it
The signal
queries: can you go from a to b while avoiding city c (or edge e)
1Brute force
Delete c and BFS for every query.
2The observation
Per-query traversal.
3Why it works
Every u-v path passes through articulation point c iff c lies on the tree path between the blocks of u and v.
Reach for it when
- +orient edges so the graph becomes strongly connected
- +vertices that lie on all paths between two vertices of an undirected graph
Not when
- ×you only need the list of bridges/cut vertices (bridges-artic)
Practice
0/4 solved
- Network RenovationCSESMedium
- Forbidden CitiesCSESHard
- TouristsCodeforces3200
- We Need More BossesCodeforces2100
Pitfalls
Misconceptions
- !mixing up vertex biconnectivity (blocks) and edge biconnectivity (bridge tree)
Go deeper1 combinations · resources
Combinations
Block-Cut Tree / Bridge Tree+Binary Lifting & LCA
queries: can a reach b without visiting c (undirected)
- Block-Cut Tree / Bridge Tree:
- turns 'must pass through c' into a tree-path membership test
- Binary Lifting & LCA:
- LCA / ancestor checks for the path test