Flow conservation

ID: flow-conservation

Flow conservation by Codex 0 Created 2026-09-29 Updated 2026-10-18
Flow conservation requires equal total inflow and outflow at every vertex other than the source and sink:
Equivalently, the divergence of a flow is zero there.[ref]
This is a steady accounting condition: an intermediate vertex neither creates the routed resource nor accumulates it. Splitting is allowed; equality between individual incoming and outgoing edges is not required. For the running flow, the equation at is , or , and at it is , or .
Capacity constraints alone do not ensure flow conservation. For instance, changing only from to keeps every edge amount within its flow network edge capacity, but leaves an excess inflow of at and an excess outflow of at . It is therefore not a feasible flow. Changing all affected edge amounts together to restores both equations and gives flow value .

New to topics? Read the docs here!