DISCRETE MATH • GRAPH THEORY

Network flow concepts (max flow intro)

Understanding how to maximize the throughput of a directed network from source to sink.

Historical Context & Motivation

The study of network flows originated not in a mathematics department, but in the context of Cold War logistics and military planning. During the 1950s, the United States Air Force sought to determine the maximum capacity at which supplies could be shipped through the Soviet railway network — and, conversely, the minimum set of links whose destruction would sever that capacity entirely. This practical question gave rise to one of the most elegant and widely applicable frameworks in combinatorial optimization, connecting graph theory, linear programming, and algorithm design in a single coherent structure.

The foundational result, the Max-Flow Min-Cut Theorem, was proved independently by multiple researchers and revealed a deep duality: the maximum amount of flow that can be pushed through a network equals the minimum capacity that must be removed to disconnect the source from the sink. This insight transformed operations research, telecommunications, and eventually computer science, where network flow algorithms underpin everything from image segmentation to bipartite matching.

1954
Ford & Fulkerson Begin Flow Research
L.R. Ford Jr. and D.R. Fulkerson, working at the RAND Corporation, develop the foundational framework for maximum flow problems in directed networks as part of U.S. Air Force logistics research.
1956
Max-Flow Min-Cut Theorem Published
Ford and Fulkerson publish their seminal paper establishing the max-flow min-cut duality and introduce the augmenting path method for computing maximum flows.
1970
Dinic's Algorithm
Yefim Dinitz introduces a strongly polynomial algorithm using blocking flows and layered graphs, achieving O(V²E) time complexity and inspiring further algorithmic improvements.
1972
Edmonds–Karp Algorithm
Jack Edmonds and Richard Karp prove that the Ford–Fulkerson method, when augmenting paths are found via breadth-first search, runs in O(VE²) time, making it the first provably polynomial variant.
1986–present
Modern Advances
Goldberg and Tarjan introduce the push-relabel algorithm. Subsequent decades bring nearly-linear time algorithms, connecting max flow to interior point methods and spectral graph theory.

The central question that the maximum flow framework addresses is deceptively simple: given a directed graph with edge capacities, a designated source vertex, and a designated sink vertex, what is the greatest total rate of flow that can be routed from source to sink while respecting every edge's capacity constraint? As we will see, answering this question requires a careful interplay between local decisions at individual edges and global structure across the entire network.

Core Principles & Definitions

A flow network is a directed graph G = (V, E) equipped with a non-negative capacity function c : E → ℝ≥0 and two distinguished vertices: a source s (which only emits flow) and a sink t (which only absorbs flow). The capacity c(u, v) on each edge (u, v) represents the upper bound on the rate at which material — data packets, fluid, goods — can traverse that link. If an edge (u, v) is not in E, we define c(u, v) = 0 by convention.

1

Capacity Constraint

For every edge (u, v), the flow f(u, v) must satisfy 0 ≤ f(u, v) ≤ c(u, v). No edge can carry more flow than its capacity permits.
2

Flow Conservation

At every internal vertex (neither s nor t), the total flow entering equals the total flow leaving. Flow is neither created nor destroyed at intermediate nodes.
3

Value of a Flow

The value |f| is the net flow leaving the source s. By conservation, this equals the net flow arriving at the sink t. Maximizing |f| is the objective.
4

Residual Graph

Given a flow f, the residual graph G_f contains edges with remaining (forward) capacity and reverse edges representing the ability to cancel previously sent flow.
5

Augmenting Path

A path from s to t in the residual graph G_f along which additional flow can be pushed. If no augmenting path exists, the current flow is maximum.
KEY TAKEAWAY
Think of a flow network like a system of pipes carrying water from a reservoir (source) to a city (sink). Each pipe has a maximum diameter limiting how much water it can carry. Flow conservation means no water leaks at junctions — every drop entering a junction must leave through some outgoing pipe. The maximum flow is the greatest volume per second you can deliver to the city, determined not by any single pipe, but by the tightest bottleneck across the entire system.

Visual Explanation — A Flow Network

The following diagram depicts a flow network with source s and sink t. Each directed edge is labeled with the notation f / c where f denotes the current flow and c denotes the edge capacity. The coloring indicates how saturated each edge is: fully used edges appear in red, partially used edges in amber, and unused capacity edges in cyan.

A flow network with six vertices. The source s pushes flow through internal vertices A, B, C, D to the sink t. Each label shows current flow / capacity. This flow has value 19 but is not yet maximum — augmenting paths still exist in the residual graph.

Observe that the edge s → A is fully saturated at 10/10, meaning no additional flow can be pushed along it directly. However, the edge A → D carries only 4 of its 9 available capacity, and C → D is completely unused at 0/7. The existence of these slack edges suggests that there may be alternative routes through which additional flow could reach t. The residual graph formalizes this intuition by introducing reverse edges that permit the rerouting of previously assigned flow, opening up new augmenting paths that were invisible in the original network.

Mathematical Framework

We now formalize the definitions introduced above. Let G = (V, E) be a directed graph with capacity function c and distinguished vertices s, t ∈ V. A flow in G is a function f : V × V → ℝ satisfying two properties: the capacity constraint and flow conservation. From these two simple axioms, the entire theory unfolds.

CAPACITY CONSTRAINT
0 ≤ f(u, v) ≤ c(u, v) for all (u, v) ∈ E
The flow on each edge must be non-negative and cannot exceed the edge's capacity. If (u, v) ∉ E, then f(u, v) = 0.
FLOW CONSERVATION
∑_{v∈V} f(u, v) = ∑_{v∈V} f(v, u) for all u ∈ V \ {s, t}
For every internal vertex u, the total outgoing flow equals the total incoming flow. The source s and sink t are exempt — s is a net producer and t is a net consumer of flow.
VALUE OF A FLOW
|f| = ∑_{v∈V} f(s, v) − ∑_{v∈V} f(v, s)
The value of a flow is the net flow out of the source. Equivalently, |f| equals the net flow into the sink. The maximum flow problem asks for a feasible flow f* that maximizes |f|.
RESIDUAL CAPACITY
c_f(u, v) = c(u, v) − f(u, v) (forward edge) or f(v, u) (reverse edge)
The residual capacity along a forward edge (u, v) is the unused capacity. The residual capacity along a reverse edge (u, v) — representing the ability to cancel flow on (v, u) — equals the current flow on (v, u). The residual graph Gf consists of all edges with positive residual capacity.

A crucial structural concept is an s–t cut (S, T), which is a partition of V into two disjoint sets S and T with s ∈ S and t ∈ T. The capacity of this cut is c(S, T) = ∑ c(u, v) over all edges with u ∈ S, v ∈ T. The Max-Flow Min-Cut Theorem states that the maximum value of any s–t flow equals the minimum capacity of any s–t cut. This duality is both theoretically profound — it connects to LP duality — and computationally useful, as it provides a certificate of optimality: once we exhibit a flow and a cut of equal value, both are optimal.

The Ford–Fulkerson Method & Residual Graphs

The Ford–Fulkerson method is the canonical algorithm for computing maximum flows. It is technically a method rather than an algorithm because it does not specify how to find augmenting paths — that choice yields different algorithmic variants with different time complexities. The procedure is elegant: start with zero flow on all edges, repeatedly find an augmenting path from s to t in the residual graph, push the maximum possible flow along that path (the bottleneck capacity), update the residual graph, and repeat until no augmenting path exists.

  1. Initialize: Set f(u, v) = 0 for all edges. Construct the residual graph Gf = G (since all capacity is residual).
  2. Search: Find any s–t path P in Gf. If none exists, terminate — the current flow is maximum.
  3. Augment: Compute the bottleneck Δ = min cf(u, v) over all edges (u, v) on P. Push Δ units along P.
  4. Update: For each forward edge on P, decrease its residual capacity by Δ and increase the reverse edge by Δ. Return to Search.
Left: the original network with capacities (the augmenting path s → A → C → t is shown dashed in green). Right: the residual graph after pushing Δ = 6 units along that path. Forward edges show reduced residual capacity (amber), and new reverse edges (pink dashed) appear, enabling future flow rerouting.

The reverse edges in the residual graph are the key insight that makes the Ford–Fulkerson method correct. Without them, a greedy first choice could permanently block the optimal solution. Consider a scenario where an early augmenting path uses an edge that would have been more valuable on a different route. The reverse edge in Gf effectively allows a later iteration to "undo" that assignment by routing flow backward along the reverse edge, thereby rerouting the original flow to a more productive path. This self-correcting mechanism guarantees that the method converges to the true maximum flow regardless of the order in which augmenting paths are selected — provided, in the case of irrational capacities, that an appropriate path selection strategy (such as BFS) is used.

⚠️ Termination Caveat
When all capacities are integers, the Ford–Fulkerson method terminates in at most |f*| iterations (where |f*| is the maximum flow value), since each augmentation increases the flow by at least 1. With rational capacities, termination is also guaranteed. However, Ford and Fulkerson themselves constructed examples with irrational capacities where a poor augmenting path strategy causes the method to run forever without converging. The Edmonds–Karp variant avoids this by always choosing shortest augmenting paths via BFS.

Worked Example — Finding Maximum Flow

Consider a simple flow network with vertices {s, A, B, t} and edges: s → A (capacity 10), s → B (capacity 5), A → B (capacity 4), A → t (capacity 7), B → t (capacity 10). We apply the Ford–Fulkerson method to find the maximum flow from s to t.

Max Flow via Ford–Fulkerson
1
Step 1 — InitializeSet f(e) = 0 for all edges. The residual graph Gf is identical to the original network since all capacity is unused. Current flow value: |f| = 0.
|f| = 0
2
Step 2 — First Augmenting Path: s → A → tFind path P₁ = s → A → t in Gf. The bottleneck is Δ₁ = min(cf(s,A), cf(A,t)) = min(10, 7) = 7. Push 7 units along P₁. Update: f(s,A) = 7, f(A,t) = 7. Residual: cf(s,A) = 3, cf(A,t) = 0; reverse edges (A,s) = 7, (t,A) = 7 appear.
|f| = 7
3
Step 3 — Second Augmenting Path: s → B → tFind path P₂ = s → B → t. Bottleneck: Δ₂ = min(cf(s,B), cf(B,t)) = min(5, 10) = 5. Push 5 units. Update: f(s,B) = 5, f(B,t) = 5.
|f| = 12
4
Step 4 — Third Augmenting Path: s → A → B → tThe direct path s → A → t is blocked (A → t saturated). But in Gf, we can use s → A → B → t. Bottleneck: Δ₃ = min(cf(s,A), cf(A,B), cf(B,t)) = min(3, 4, 5) = 3. Push 3 units. Update: f(s,A) = 10, f(A,B) = 3, f(B,t) = 8.
|f| = 15
5
Step 5 — Termination CheckSearch for an s–t path in Gf. Edge s → A has cf = 0 (saturated), edge s → B has cf = 0 (saturated). No outgoing residual edge from s remains. No augmenting path exists, so the current flow is maximum.
Maximum flow |f*| = 15
6
Step 6 — Verify via Min-CutConsider the cut S = {s}, T = {A, B, t}. The capacity crossing the cut is c(s,A) + c(s,B) = 10 + 5 = 15. Since |f*| = c(S,T) = 15, the Max-Flow Min-Cut Theorem confirms optimality. This cut is a minimum cut.
Min cut capacity = 15 = Max flow ✓

Algorithm Variants — Strengths & Limitations

The Ford–Fulkerson method is a template, and its efficiency depends critically on the strategy used to select augmenting paths. Different choices yield algorithms with vastly different worst-case time complexities. The table below compares the most important variants, their path selection strategies, and their computational guarantees.

Comparison of major maximum flow algorithms
AlgorithmPath StrategyTime ComplexityKey Strength
Ford–Fulkerson (DFS)Any path (typically DFS)O(E × |f*|)Simple to implement; good for small integer capacities
Edmonds–KarpShortest path (BFS)O(VE²)Polynomial; independent of capacity magnitudes
Dinic's AlgorithmBlocking flows in level graphO(V²E)Faster in practice; O(E√V) for unit-capacity graphs
Push–RelabelLocal push operations with height labelsO(V²E) or O(V³)No global path search; highly parallelizable
KEY TAKEAWAY
Choosing the right max-flow algorithm is analogous to choosing the right sorting algorithm: the abstract problem is identical, but the data characteristics — network density, capacity range, whether the graph is unit-capacity or has astronomical weights — determine which variant dominates in practice. For most classroom purposes, the Edmonds–Karp algorithm (Ford–Fulkerson with BFS) is the go-to choice because it is both polynomial and straightforward to implement.

Connections to Advanced Theory

The maximum flow problem sits at the heart of combinatorial optimization and connects to a remarkably wide array of more advanced topics. Understanding max flow provides the conceptual scaffolding for problems in matching, covering, scheduling, and even machine learning. The table below highlights several important generalizations and the role max flow plays in each.

Advanced topics connected to maximum flow theory
Advanced TopicConnection to Max Flow
Bipartite MatchingA maximum matching in a bipartite graph can be found by constructing a flow network with unit capacities. The max flow equals the size of the maximum matching (König's theorem connects the min cut to the minimum vertex cover).
Minimum Cost FlowExtends max flow by assigning costs per unit flow on each edge. The objective becomes: among all maximum flows, find the one with minimum total cost. Solved via successive shortest paths or cycle-canceling algorithms.
Linear Programming DualityThe Max-Flow Min-Cut Theorem is a special case of LP strong duality. The max flow LP's dual has the same optimal value and corresponds to the min cut problem. This generalizes to arbitrary LP via the duality theorem of linear programming.
Image SegmentationIn computer vision, separating foreground from background in an image is modeled as a min-cut problem on a pixel graph. Efficient max-flow solvers enable real-time segmentation in medical imaging and video editing.
Multi-Commodity FlowGeneralizes max flow to multiple source-sink pairs sharing edge capacities. Unlike single-commodity flow, the problem becomes NP-hard in the integer case. LP relaxations and approximation algorithms are active research areas.

Looking forward, recent breakthroughs have achieved nearly linear time algorithms for maximum flow in general graphs, combining techniques from continuous optimization (interior point methods), graph sparsification, and data structures for dynamic trees. These results, published by Chen et al. (2022), represent a culmination of decades of research and demonstrate that the simple question posed by Ford and Fulkerson in the 1950s continues to drive frontier research in theoretical computer science. For the student of discrete mathematics, mastering the basics of network flow provides both a powerful algorithmic toolkit and an entry point into the deep structural theory of graphs and optimization.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain in your own words why reverse edges are necessary in the residual graph. What could go wrong if the Ford–Fulkerson method only considered forward (unused capacity) edges?
PROBLEM 2BASIC CALCULATION
Consider a flow network with vertices {s, a, b, t} and edges: s → a (cap 8), s → b (cap 6), a → b (cap 3), a → t (cap 5), b → t (cap 9). Apply the Ford–Fulkerson method using BFS to find the maximum flow. Show each augmenting path and the resulting flow value.
PROBLEM 3INTERMEDIATE
A network has vertices {s, v₁, v₂, v₃, t} with edges: s → v₁ (cap 10), s → v₂ (cap 10), v₁ → v₂ (cap 2), v₁ → v₃ (cap 8), v₂ → v₃ (cap 6), v₂ → t (cap 5), v₃ → t (cap 12). Find the maximum flow and identify a minimum cut. Is the minimum cut unique?
PROBLEM 4APPLIED
A university internet network routes traffic from a central server (source) through 3 routers to a student dormitory (sink). The server connects to routers R₁, R₂, R₃ with bandwidths 100, 80, 60 Mbps respectively. R₁ → R₂ has 30 Mbps, R₁ → dorm has 70 Mbps, R₂ → R₃ has 20 Mbps, R₂ → dorm has 50 Mbps, R₃ → dorm has 60 Mbps. What is the maximum bandwidth the dorm can receive? If one router fails, which causes the greatest reduction in max bandwidth?
PROBLEM 5CRITICAL THINKING
Prove that in any flow network with integer capacities, there exists a maximum flow in which every edge carries an integer amount of flow. Then explain why this integrality property is essential for reducing the maximum bipartite matching problem to a max-flow computation.

Summary

A flow network is a directed graph with edge capacities, a source, and a sink. A feasible flow satisfies the capacity constraint (flow ≤ capacity on every edge) and flow conservation (inflow = outflow at every internal vertex). The maximum flow problem asks for the greatest total flow from source to sink. The Ford–Fulkerson method solves this by iteratively finding augmenting paths in the residual graph — a graph that includes both forward edges (unused capacity) and reverse edges (cancellable flow) — until no such path exists.

The Max-Flow Min-Cut Theorem establishes that the maximum flow value equals the minimum capacity of any s–t cut, providing both a duality result and a certificate of optimality. Polynomial variants like the Edmonds–Karp algorithm (O(VE²)) guarantee efficient computation. Network flow theory extends naturally to bipartite matching, minimum cost flow, and LP duality, making it one of the most versatile tools in combinatorial optimization.

Varsity Tutors • Discrete Math • Network flow concepts (max flow intro)