Network Flows, Cuts & Matching

flow conservation

At a pipe junction that is neither the source nor the drain, water cannot pile up or vanish — every drop that flows in has to flow back out. Flow conservation is exactly this rule for networks: interior vertices are pass-through points, not reservoirs and not springs. It is the constraint that makes a flow behave like a steady current rather than an arbitrary labeling of edges.

Precisely, for every vertex v other than the source s and the sink t, the sum of flow on edges entering v equals the sum of flow on edges leaving v: sum of f(u, v) over in-edges = sum of f(v, w) over out-edges. Only s and t are exempt — s is allowed a net surplus going out, and t a net deficit (it absorbs). This is the network analogue of Kirchhoff's current law in circuits. Together with the capacity constraint (0 <= f <= c on each edge), conservation is one of the two rules that define a legal flow; everything else in flow theory is built on these two.

Conservation is what guarantees the value of a flow is well defined — that net out of the source equals net into the sink, with nothing leaking in between. It is also why a flow can always be decomposed into a handful of source-to-sink paths plus some internal cycles: the paths carry the value, the cycles conserve trivially and carry none. A subtle point: conservation does not forbid flow on a cycle, it only forbids accumulation at a vertex; useless circulating cycles are legal but pointless, and good algorithms never create them.

Vertex a receives 3 from s and 1 from b, so 4 units enter. Conservation forces 4 units to leave a — say 2 to t and 2 to c. If instead only 3 left, a would be illegally storing 1 unit, and f would not be a valid flow.

Balance the books at every interior vertex: in equals out. Source and sink are the only accounts allowed to be unbalanced.

Conservation applies to interior vertices only. Forgetting that s and t are exempt is a classic modeling error — it would force value 0, since a balanced source produces nothing.

Also called
conservation constraintKirchhoff's law for flow守恆約束