advanced22 min studyLesson 288 in Mathematics

Network-flow linear programs

Formulate conservation and capacity constraints, then connect integral flows, cuts, and min-cost potentials.

On this page

What you’ll understand

  • Write a bounded network-flow LP with an explicit incidence sign convention.
  • Certify a maximum flow with an equal-capacity cut.
  • Interpret min-cost potentials and distinguish integral data from arbitrary real data.

A flow model represents divisible material moving along directed arcs under local conservation and capacity restrictions. Its compact matrix form makes it look like an ordinary linear program, while its incidence structure yields stronger conclusions: integer supplies and capacities admit integer optimal vertices. Certificates also become interpretable. A cut can explain a throughput bottleneck, and vertex potentials can explain why no residual rerouting reduces transportation cost.

Conservation with a declared sign

Assign each directed arc a column with minus one at its tail and plus one at its head. Then Af=bAf=b means inflow minus outflow equals bvb_v at each vertex. A positive bvb_v is demand and a negative one is supply. For a connected graph the incidence rows sum to zero, so total demand must equal total supply; one row is redundant. This necessary balance is not sufficient for feasibility, since arc directions and capacities may prevent delivery. Include bounds 0≤fe≤ue0\le f_e\le u_e and a linear transportation objective cTfc^Tf.

The incidence matrix is TU, and adding upper-bound and nonnegativity rows preserves that property. Integral supplies, demands, and finite capacities therefore produce integral vertices of the feasible flow polytope. With finite capacities, the region is bounded; if it is nonempty, a minimum-cost integral vertex exists for any real linear costs. This is an existence statement and does not require every feasible flow to be integral. If capacities are real and nonintegral, the LP remains meaningful but the integer-flow guarantee cannot be asserted from TU alone.

min⁡fcTfsubject toAf=b,0≤f≤u,∑vbv=0\min_f c^Tf\quad\text{subject to}\quad Af=b,\qquad 0\le f\le u,\qquad \sum_v b_v=0
With incidence entries −1 at tails and +1 at heads, positive b means required net inflow.↔ Scroll wide equations horizontally.

A cut is a throughput certificate

For maximum source-to-sink flow, conserve flow at every other vertex and maximize net flow leaving the source. For a cut SS containing the source and excluding the sink, sum conservation over its vertices. Internal arc contributions cancel; the flow value equals flow leaving the cut minus flow entering it. Outgoing flows are at most their capacities and incoming flows are nonnegative, so the cut's outgoing capacity is an upper bound. A feasible flow matching that bound proves optimality immediately, without requiring a description of every augmenting path used to find it.

The max-flow min-cut theorem states that a feasible finite-capacity network has a maximum flow whose value equals the capacity of a minimum source-sink cut. In a residual-network proof, when no augmenting path exists, take the set reachable from the source by positive residual-capacity arcs. Every original arc leaving that set is saturated, and every arc entering it carries zero flow. These conditions make the cut bound tight. Integral capacities allow augmentation in integer amounts, while particular path-selection rules determine the algorithm's complexity; arbitrary augmentations with irrational capacities require extra care and need not terminate.

∣f∣=∑e∈δ+(S)fe−∑e∈δ−(S)fe≤∑e∈δ+(S)ue|f|=\sum_{e\in\delta^+(S)}f_e-\sum_{e\in\delta^-(S)}f_e\le\sum_{e\in\delta^+(S)}u_e
Summed conservation cancels internal arcs and turns each source-sink cut into a global throughput upper bound.↔ Scroll wide equations horizontally.

Costs and residual potentials

For a fixed-balance min-cost flow, residual arcs represent feasible marginal adjustments: a forward residual arc has original cost cec_e, while a backward residual arc has cost −ce-c_e and permits canceling existing flow. A negative-cost residual cycle allows a cost-reducing circulation. For a feasible flow with finite capacities, absence of such cycles characterizes minimum cost. Potentials provide a checkable sufficient certificate: if every residual arc from vv to ww has reduced cost cvw+πv−πw≥0c_{vw}+\pi_v-\pi_w\ge0, every cycle has nonnegative original cost because potential differences telescope.

These potentials resemble shortest-path labels, but their sign must match the chosen reduced-cost convention. Parallel arcs, negative original costs, and saturated arcs all fit the residual formulation. Shared side constraints can break the simple network structure: a bound on the sum of selected unrelated arc flows is not necessarily another ordinary capacity row preserving TU. Multi-commodity flow also couples several conservation systems through shared capacity and generally loses the elementary integral guarantee. A network-shaped picture is therefore not enough; inspect the actual variables and coupling restrictions before choosing a specialized algorithm.

A maximum-flow certificate

A network has arcs s→a of capacity 3, s→b of capacity 2, a→t of capacity 2, b→t of capacity 3, and a→b of capacity 1. Find a maximum flow and a matching cut.

  1. Send three units from s to a and two from s to b. Route two units from a directly to t and one from a to b; b then sends three units to t.

  2. At a, inflow three equals outgoing two plus one. At b, inflow two plus one equals outgoing three. Every listed arc respects its capacity, so the total flow value five is feasible.

  3. The cut consisting only of s has outgoing capacity three plus two, equal to five. No source-sink flow can exceed this bound, so the feasible value five is maximum.

The result

An integral flow of five and a cut of capacity five jointly certify optimal throughput.

Explore the model

Interactive lab

Interactive lab · queue

Local rate balance before a network model

Pause and Reset; set arrival rate to 3 and service rate to 2. Predict the fluid backlog grows from four at one unit per second, then Play. For a fresh run Reset, set arrival rate to 2 and service rate to 3, and compare the drain toward zero. Both parameters must be set again because Reset restores defaults.

Local rate balance before a network modelFluid backlog starts at 4 and follows max(0, 4 + (λ − μ)t). The separate M/M/1 residence-time formula assumes Poisson arrivals, exponential service and λ < μ. Current readings: Fluid backlog: 4; Net rate · λ − μ: −1 /s; M/M/1 mean residence: 1 s. All parameters are adjustable with the labeled controls below.02.557.51001.534.56Elapsed time · sFluid backlogλ < μ
Fluid backlogCurrent time
Fluid backlog
4
Net rate · λ − μ
−1 /s
M/M/1 mean residence
1 s
t = 0 s

Fluid backlog starts at 4 and follows max(0, 4 + (λ − μ)t). The separate M/M/1 residence-time formula assumes Poisson arrivals, exponential service and λ < μ. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forThe toy queue shows one buffer's rate balance, supporting the conservation intuition. It is not a max-flow algorithm, multi-node routing model, or measured throughput forecast; its separate M/M/1 readout requires stochastic assumptions.

Check your understanding

Using incidence −1 at an arc tail and +1 at its head, what does bᵥ = −4 in Af = b mean?

Try it yourself

In the worked network, reduce the capacity of a→t from two to one. Construct a flow and a cut proving the new maximum.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Inspect the cut containing s and a, then route the remaining source flow consistently.

Compare with the solution

The cut {s,a} has outgoing arcs s→b of capacity two, a→b of capacity one, and a→t of capacity one, totaling four. Send two from s to a, split one to t and one to b, and send two from s to b. Vertex b sends three to t. This feasible flow has value four and matches the cut upper bound, proving the new maximum.

Take it with you

  • Declare the incidence sign convention before interpreting supplies and demands.
  • An equal-valued feasible flow and cut give a complete maximum-flow certificate.
  • Integral network data yield integral vertices, but arbitrary coupling constraints can remove that guarantee.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.