Graphs¶
Core Bridge
Graphs are one of the central contest areas because many problems are really about states and transitions in disguise.
How This Family Splits¶
This repo treats graphs as four big branches:
modeling and traversal: BFS, DFS, shortest paths, MST, SCCtrees: subtree structure, LCA, decomposition, and dynamic forestscuts and flow: max-flow, lower bounds, cut trees, and min-cost flowpairing families: matching, assignment, stable marriage, blossom
If you are unsure where a problem belongs, decide the branch first and only then choose the leaf topic.
Use This Area When¶
- the clean model is vertices plus edges, even if the story hides that fact
- you are being asked about reachability, cuts, trees, paths, or pairings
- the main difficulty is choosing the right graph family, not writing raw loops
Start With One Route¶
| If your bottleneck is... | Open first | Then |
|---|---|---|
| basic modeling and traversals | Graph Modeling | BFS And DFS, Shortest Paths, Minimum Spanning Tree |
| tree topics feel fragmented | Trees | Euler Tour / Subtree Queries, LCA, Heavy-Light Decomposition |
| cut, flow, and circulation topics feel fragmented | Maximum Flow | Flow With Lower Bounds, Gomory-Hu Tree, Min-Cost Flow |
| matching or assignment is the real family | Matching | Stable Marriage, Hungarian / Assignment Problem, Edmonds Blossom / General Matching |
Core Progression¶
Core first- Graph Modeling
- BFS / DFS
- Shortest Paths
- Minimum Spanning Tree
-
Topological Sort / SCC
-
Then add - Bridges / Articulation / BCC
- Eulerian Path / Cycle
- Trees / Euler Tour / LCA
-
Two-SAT
-
Deep later - Virtual Tree / HLD / Centroid Decomposition
- Link-Cut Tree / Euler Tour Tree
- Maximum Flow / Lower Bounds / Min-Cost Flow
- Global Min-Cut / Gomory-Hu
- Stable Marriage / Hungarian / Blossom
- Tree Isomorphism / De Bruijn Sequence
Good First Repo Anchors¶
Browse All Subtopics¶
- Graph Modeling
- BFS And DFS
- Bridges, Articulation Points, And Biconnected Components
- Eulerian Path / Cycle
- De Bruijn Sequence
- Shortest Paths
- Minimum Spanning Tree
- Topological Sort And SCC
- 2-SAT
- Trees
- Tree Isomorphism
- Euler Tour / Subtree Queries
- LCA
- Virtual Tree / Auxiliary Tree
- Heavy-Light Decomposition
- Centroid Decomposition
- Link-Cut Tree
- Euler Tour Tree
- Maximum Flow
- Randomized / Global Min-Cut
- Gomory-Hu Tree
- Flow With Lower Bounds
- Min-Cost Flow
- Matching
- Stable Marriage
- Hungarian / Assignment Problem
- Edmonds Blossom / General Matching
Go Deeper¶
- Course: Stanford CS161
- Course: Cornell CS 4820
- Reference: CP-Algorithms
- Practice: ICPC Curriculum