Discrete Mathematics and Combinatorics

Network Flows and the Max-Flow Min-Cut Theorem

Work through a small pipe network to see why the most you can send always equals the capacity of the tightest bottleneck.

Key takeaways

  • A flow network has one source, one sink, and directed links that each have a maximum capacity.
  • A valid flow never exceeds any capacity and loses nothing at intermediate points.
  • Every cut separating the source from the sink gives an upper limit on the flow, and the largest flow equals the smallest cut.
  • The Ford–Fulkerson method repeatedly pushes more along paths with spare room, including paths that undo earlier choices.
  • The same theorem solves problems that look unrelated to flow, such as matching applicants to jobs and counting independent routes.

The max-flow min-cut theorem says that the largest amount you can send from a starting point to an end point through a network equals the smallest total capacity of any set of links whose removal separates the two. In short, the best flow is exactly as large as the tightest bottleneck.

It is easy to believe that a bottleneck limits the flow. The surprising part is that you can always reach that limit, and that a simple procedure finds both the best flow and the bottleneck that proves it is best.

Setting up the problem

A flow network is a directed graph, meaning every link has a direction. Each link has a capacity, the most it can carry. One vertex is the source, where material enters, and another is the sink, where it leaves. Think of water pipes, data links or one-way roads.

A flow assigns an amount to every link subject to two rules. First, each amount lies between zero and the link's capacity. Second, at every vertex other than the source and sink, the total coming in equals the total going out. This second rule is called conservation. The value of the flow is the net amount leaving the source.

A worked network

Take a source s, a sink t and two intermediate points a and b, with these capacities:

Link Capacity
s → a 10
s → b 8
a → b 5
a → t 7
b → t 10

The source could push out 18, and the sink could accept 17, so the answer is at most 17. Can you achieve it? Send 7 units along s, a, t. Send 8 along s, b, t. Link s → a still has 3 spare, a → b has 5 spare and b → t has 2 spare, so send 2 more along s, a, b, t.

The total is 7 + 8 + 2 = 17. Check conservation: point a receives 9 and sends 7 + 2 = 9. Point b receives 8 + 2 = 10 and sends 10.

What a cut is

A cut splits the vertices into two groups, with the source in one and the sink in the other. Its capacity is the total capacity of links that go from the source's group to the sink's group. Links running backward do not count.

Our network has four possible cuts:

Source side Links crossing forward Capacity
s s→a, s→b 10 + 8 = 18
s, a s→b, a→b, a→t 8 + 5 + 7 = 20
s, b s→a, b→t 10 + 10 = 20
s, a, b a→t, b→t 7 + 10 = 17

The smallest is 17, matching the flow we built. Neither answer could be improved: no flow can exceed a cut, and no cut can fall below a flow. Each certifies the other.

A flow and a cut certify each other
Value 17 Best flow = smallest cut No spare path Signals the flow is maximal Every cut Caps the value of every flow Capacity rule No link carries more than its limit Conservation Inflow equals outflow in the middle Value 17 Best flow = smallest cut Capacity rule No link carries more than its limit Conservation Inflow equals outflow in the middle Every cut Caps the value of every flow No spare path Signals the flow is maximal

Why every flow fits under every cut

Everything leaving the source must eventually reach the sink, so it must cross from the source side of any cut to the other side. The net amount crossing equals the value of the flow. The forward links crossing the cut can carry at most their capacity, and any backward flow only subtracts. So value ≤ capacity, for every flow and every cut.

This half is called weak duality. The theorem's real content is that some flow and some cut meet exactly.

Finding the maximum by augmenting paths

L. R. Ford Jr. and D. R. Fulkerson published the theorem and a method in the mid-1950s, and other researchers found the result around the same time. The idea is to keep improving a flow until you cannot.

  1. Start with zero flow.
  2. Look for a path from source to sink along which you can still push something.
  3. Push as much as the tightest step on that path allows.
  4. Repeat until no such path exists.

The subtlety is in step 2. You must allow paths that travel backward along a link that already carries flow, which means canceling some of it and rerouting.

Consider a tiny network with links s → a, s → b, a → b, a → t and b → t, all of capacity 1. Suppose your first path is s, a, b, t. Now no forward path remains, yet the flow is only 1 and the best is 2. The fix is the path s, b, then backward along a → b, then a, t. Pushing 1 along it cancels the flow on a → b and leaves two clean routes, s, a, t and s, b, t.

The record of what can still be pushed forward or undone is called the residual network.

Why the method proves the theorem

Suppose no augmenting path exists. Let S be the set of vertices you can still reach from the source in the residual network. The sink is not in S, so S defines a cut.

Every link leaving S must be full, or you could extend your reach along it. Every link entering S from outside must carry zero, or you could undo it and reach further. So the flow across this cut equals the cut's capacity exactly. You have a flow and a cut with the same value, which proves both are optimal.

This is a constructive proof: the failure of the search hands you the bottleneck.

Running time and whole numbers

If all capacities are whole numbers, each augmentation raises the value by at least 1, so the process ends. It also ends with a whole-number flow on every link, a fact called the integrality theorem.

Choosing paths badly can make the method very slow, and with irrational capacities there are contrived examples where it never finishes. Always choosing a path with the fewest links avoids both problems. This version, associated with Jack Edmonds and Richard Karp, runs in time bounded by a polynomial in the number of vertices and links. Faster algorithms exist, and research on them continues. Big O notation explains how such running times are compared.

Reading the bottleneck

The minimum cut is often more useful than the flow itself, because it tells you where to spend money. In the worked network the tight links are a → t and b → t, the two roads into the sink. Both are full in every maximum flow.

Suppose you can widen one link by 3 units. Widening s → a to 13 changes nothing, since the cut around the sink still has capacity 17. Widening a → t from 7 to 10 raises that cut to 20. The smallest cut is then the one around the source, at 18, so the best flow becomes 18, a gain of only 1.

Two points follow. Improving a link that crosses no minimum cut cannot raise the maximum flow at all. Improving a link that does cross one helps only until some other cut becomes the tightest. When several minimum cuts exist, you must widen something in every one of them before the total moves.

To find the cut after computing a flow, mark every vertex you can still reach from the source along links with spare room, or backward along links carrying flow. The links running from marked to unmarked vertices are your bottleneck.

Problems that are secretly flows

Matching. To assign applicants to jobs, connect a source to each applicant, each applicant to the jobs they qualify for, and each job to a sink, all with capacity 1. A maximum whole-number flow is a largest assignment. This yields results about bipartite matching and leads to Hall's theorem.

Disjoint routes. Give every link capacity 1. The maximum flow counts the routes from s to t that share no link, and the minimum cut counts the fewest links whose failure disconnects them. This is Menger's theorem, which predates the flow version.

Image splitting. Some methods separate the foreground of a picture from its background by building a network over pixels and computing a minimum cut.

Project selection. Choosing a set of tasks with profits and prerequisites can be rewritten as a minimum cut.

Maximizing flow is a linear programming problem: a linear goal with linear constraints. Its dual problem is, in effect, the minimum cut. The theorem is a particularly clean case of the duality that runs through optimization, where a maximization and a minimization squeeze toward the same number.

Common mistakes

  • Counting backward links in a cut's capacity. Only links from the source side to the sink side count.
  • Stopping as soon as no forward path remains, without checking paths that undo flow.
  • Assuming the minimum cut is unique. A network can have several cuts with the same smallest capacity.
  • Picking the cut around the source or the sink and calling it minimal without checking the others.

Common questions

Can there be many sources and sinks?

Yes. Add one artificial super-source feeding all the sources and one super-sink collecting from all the sinks.

What if different goods share the network?

When several distinct commodities each need to travel between their own endpoints, the neat equality between flow and cut generally fails, and finding whole-number solutions becomes computationally hard.

How large a network can you handle?

The standard algorithms handle very large networks in practice, which is one reason modelers like to express a problem as a flow when they can.

Written for 4Mathematics with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 45 articles in Discrete Mathematics and Combinatorics →

Latest news on this topic