Network flow algorithms solve optimization problems on directed graphs where edges have capacities and we route flow from a source to a sink. They underpin matching, scheduling, routing, and combinatorial optimization across computer science, operations research, and competitive programming.
What This Cheat Sheet Covers
This topic spans 12 focused tables and 142 indexed concepts, 110 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Flow Network Fundamentals
Every flow algorithm rests on the same vocabulary, and these are the terms you'll lean on throughout. Capacity and conservation constraints define what a valid flow is; the residual graph and augmenting paths define how you improve one; and the s-t cut sets up the duality that the rest of the cheat sheet exploits. Get comfortable here before reaching for any specific algorithm.
| Concept | Example | Description | |
|---|---|---|---|
G=(V,E), s,t∈V, cap:E→ℝ≥0 | Directed graph with source s, sink t, non-negative edge capacities | ||
f(u,v) ∈ [0, cap(u,v)] | Assignment satisfying capacity and conservation constraints | ||
0 ≤ f(u,v) ≤ cap(u,v) | Flow on each edge cannot exceed its capacity | ||
∑f(u,v) = ∑f(v,w) ∀v≠s,t | Flow in equals flow out at every internal vertex | ||
|f| = ∑f(s,v) | Total flow leaving source (or entering sink) | ||
Gf: cf(u,v)=cap(u,v)-f(u,v) | • Graph of remaining capacities • adds backward edge with capacity f(u,v) | ||
cf(u,v) = cap(u,v) - f(u,v) | • Remaining capacity on forward edge • f(u,v) on backward edge | ||
s→a→b→t in Gf | Path from s to t in residual graph with all positive residual capacities | ||
Δ = min{cf(e) : e∈P} | Minimum residual capacity along augmenting path P | ||
(S,T): s∈S, t∈T, S∪T=V | • Partition of V • capacity = sum of caps of edges from S to T | ||
cap(S,T) = ∑cap(u,v): u∈S,v∈T | Sum of capacities of forward edges crossing the cut | ||
min over all s-t cuts of cap(S,T) | • Cut with smallest total capacity • equals max flow by theorem | ||
All cap∈ℤ≥0 ⟹ ∃f∗∈ℤ≥0 | If all capacities are integers, there exists an integer-valued max flow | ||
f(u,v) = -f(v,u) | Anti-symmetry property of flow on pairs of edges | ||
cap[u][v] += c per edge | • Multiple edges between same pair • handled by summing capacities in adjacency matrix |