An - cut partitions the vertices into and ; its capacity is the total capacity of edges from to . The minimum such cut equals the maximum flow.

Max-Flow Min-Cut Theorem

: every unit of flow must cross every cut, so any flow is bounded by any cut’s capacity.
: at maximum flow, let be the vertices reachable from in the residual graph. Then , every edge is saturated, and every edge carries zero flow — so . ∎

Recovering the cut

long long flow = dinic.maxflow(s, t);
vector<bool> inS(n, false);
queue<int> q; q.push(s); inS[s] = true;
while (!q.empty()) {
    int u = q.front(); q.pop();
    for (int id : g[u])
        if (es[id].cap > 0 && !inS[es[id].to]) { inS[es[id].to] = true; q.push(es[id].to); }
}
// cut edges: original edges (u,v) with inS[u] && !inS[v]

The modelling patterns that matter

Project selection / maximum closure

You may select a set of projects. Project earns (possibly negative). Selecting requires selecting . Maximise total profit.

Build: with capacity for ; with capacity for ; with capacity for each requirement. Then

The infinite edges make it impossible to cut a dependency, so the min cut chooses exactly which profits to forgo and which costs to pay.

Image segmentation / binary labelling

Each pixel gets label A or B. Assigning to A costs , to B costs , and neighbouring pixels with different labels cost . Build with , with , and undirected between neighbours. The min cut is the optimal labelling — this is exactly the “graph cuts” method from computer vision.

This works because the objective is submodular; general multi-label or non-submodular energies are NP-hard.

Minimum vertex cover in a bipartite graph

By König, it equals the maximum matching. Constructively: run max flow, let be the residual-reachable set, and the cover is .

Others

ProblemCut formulation
Minimum edges to disconnect from unit capacities
Minimum vertices to disconnect from split vertices, unit internal capacities (Menger)
Maximum density subgraphbinary search + parametric min cut
Minimum cost to make a grid impassableplanar min cut = shortest path in the dual (Reif)
Partition items into two groups with pairwise penaltiesdirect min cut

Global min cut — a different problem

“Minimum cut over all pairs ” does not need flow computations:

AlgorithmTimeType
max flows (fix , vary )deterministic
Stoer-Wagnerdeterministic, ~30 lines
Kargerrandomized
Karger-Steinrandomized
Gomory-Hu tree max flowsgives all pairs min cuts

See Global Min Cut.

Counting min cuts

There are at most distinct global minimum cuts (a corollary of Karger’s analysis). The number of - min cuts can be exponential, but they form a lattice: enumerate them from the SCCs of the residual graph — the closed sets of the residual condensation correspond exactly to the minimum cuts.

See also: Maximum Flow · Global Min Cut · Dinic