- Published on
Network Flows - Part 5
- Authors

- Name
- Till Heller
So far in this series, we've built up the theory of network flows — definitions, the Max-Flow Min-Cut Theorem, and efficient algorithms. Now comes the payoff. Maximum flow is not just a problem in its own right; it's a tool for solving a surprising variety of other problems. In this part, we'll see three applications that look very different on the surface but all reduce to finding a maximum flow in a cleverly constructed network.
Bipartite Matching
Our first application connects directly to the Introduction to Graph Theory series. In Part 8 of that series, we studied matchings in bipartite graphs — pairing up vertices from two groups so that no vertex is used twice. It turns out that finding a maximum matching in a bipartite graph is equivalent to finding a maximum flow in a specific network.
Given a bipartite graph , we construct a flow network as follows:
- Create a source and a sink .
- For each vertex , add an arc with capacity .
- For each edge with and , add an arc with capacity .
- For each vertex , add an arc with capacity .
Every arc has capacity , so by the Integrality Theorem (Theorem 2 from Part 3), there exists a maximum flow that is integer-valued — meaning each arc carries either or unit of flow.

Theorem 4. The value of a maximum flow in equals the size of a maximum matching in .
Proof. We show a bijection between integer flows and matchings.
Given an integer flow in , consider the set . We claim is a matching. For any , at most unit of flow enters (since ), so at most one arc from to carries flow — meaning appears in at most one edge of . Similarly, for any , at most unit leaves through , so appears in at most one edge. Thus is a valid matching of size .
Conversely, given a matching in , define a flow by setting for each edge and everywhere else. This is a valid flow of value : capacity constraints are satisfied (all capacities are ), and flow conservation holds at every intermediate vertex.
Since larger flows correspond to larger matchings and vice versa, maximizing one is equivalent to maximizing the other.
Let's try a small example. Consider the bipartite graph with , , and edges . The flow network adds connected to all of and connected from all of , all with capacity . Running Edmonds-Karp on this network finds a maximum flow of value , corresponding to the matching (or equivalently ). Since , we cannot match all three vertices in — and indeed Hall's condition fails for : .
This reduction also gives us a new proof of König's theorem (Theorem 12 from the graph theory series). The minimum cut in corresponds to a minimum vertex cover in , so König's equality follows directly from the Max-Flow Min-Cut Theorem1.
Edge-Disjoint Paths
Our second application answers a natural question about connectivity: how many "independent" routes exist between two vertices? More precisely, given a directed graph and two vertices and , how many paths from to can we find that share no arcs?
Definition 11. Two --paths are edge-disjoint (or arc-disjoint in digraphs) if they share no arc.

The connection to flows is immediate: treat the digraph as a flow network with capacity on every arc. An integer flow of value decomposes into unit-flow paths from to , and since each arc has capacity , these paths are arc-disjoint.
Theorem 5 (Menger, 1927). In a directed graph, the maximum number of arc-disjoint --paths equals the minimum number of arcs whose removal disconnects from .
Proof. This is a direct consequence of the Max-Flow Min-Cut Theorem applied to the network with unit capacities. The maximum flow value equals the maximum number of arc-disjoint paths (by integrality and flow decomposition). The minimum cut capacity equals the minimum number of arcs that must be removed to separate from (since each arc has capacity , the cut capacity is just the number of arcs crossing the cut). By max-flow min-cut, these two quantities are equal.
Menger's theorem predates the Max-Flow Min-Cut Theorem by nearly three decades — Menger proved it in 1927, while Ford and Fulkerson's theorem came in 1956. In a sense, Menger's theorem was a precursor that hinted at the deeper duality between flows and cuts.
There is also a vertex-disjoint version: two paths are vertex-disjoint if they share no internal vertex (they may share and ).
Theorem 6 (Menger, vertex version). The maximum number of internally vertex-disjoint --paths equals the minimum number of vertices (other than and ) whose removal disconnects from .
This can also be proved via max-flow, using a standard trick: replace each vertex (other than and ) with two copies and connected by an arc of capacity . All arcs originally entering now enter , and all arcs originally leaving now leave from . The capacity- arc between the copies ensures that at most one path passes through , effectively enforcing vertex-disjointness.
Project Selection
Our third application comes from optimization and has a very different flavor. Imagine a company evaluating a set of potential projects. Each project has a profit (which may be positive or negative — some projects are investments that cost money). Some projects depend on others: if you undertake project , you must also undertake project . The goal is to select a subset of projects that maximizes total profit while respecting all dependencies.
Formally, we have a set of projects with profits , and a set of dependencies — pairs meaning "if project is selected, then project must also be selected." We want to find a subset such that is closed (if and is a dependency, then ) and is maximized.
This is the project selection problem (also called the closure problem), and it can be solved by a maximum flow computation.
We construct the following flow network:
- Create a source and a sink .
- For each project with , add an arc with capacity .
- For each project with , add an arc with capacity .
- For each dependency , add an arc with capacity .
The infinite capacities on dependency arcs ensure that they are never part of a minimum cut — cutting them would give infinite capacity. A finite minimum cut with and corresponds to a closed set: the selected projects are .

Theorem 7. The maximum profit of a closed set equals , where is the maximum flow value (equivalently, the minimum cut capacity).
The intuition is as follows. Start by tentatively selecting all profitable projects — this gives profit . The minimum cut tells us the "cost" of making the selection feasible: we either give up some profitable projects (cutting their arcs from ) or include some unprofitable ones (cutting their arcs to ). The minimum cut minimizes this total cost, and what remains is the optimal profit.
Consider a small example with four projects: , , , , and dependencies and . Project yields profit but requires project (which costs ), and project yields but requires project (which costs ).
The flow network has arcs with capacity , with capacity , with capacity , with capacity , with capacity , and with capacity . The minimum cut turns out to have capacity : we cut and , meaning we include all four projects. The maximum profit is , which matches . Selecting all projects is optimal because the profitable ones outweigh the costs of their dependencies2.
The Power of Reductions
The three applications in this part illustrate a general principle: many combinatorial optimization problems can be reduced to maximum flow. The art lies in designing the right network — choosing the vertices, arcs, and capacities so that the max-flow min-cut structure captures the problem's constraints and objectives.
This is one of the reasons network flow theory occupies such a central place in optimization: not because flow problems themselves are so common, but because so many other problems can be expressed as flow problems and solved with the same efficient algorithms.
Looking Ahead
We've seen that maximum flow is a versatile tool, but it optimizes only one thing: the total amount of flow. What if we also care about cost — for example, different routes have different shipping costs, and we want to maximize flow at minimum expense? In the next part, we'll introduce the minimum-cost flow problem, which adds a cost dimension to our networks and opens up an even richer set of applications.
Footnotes
To see this, note that every --cut in with capacity corresponds to choosing vertices from that cover all edges. The unit capacities ensure that the minimum cut picks individual arcs — each arc or in the cut corresponds to including or in the vertex cover. ↩
If instead , then the dependency of project on project would make selecting project unprofitable overall (). The minimum cut would cut with capacity , meaning we give up project . The optimal selection would be with profit . ↩