The Ford-Fulkerson algorithm computes a maximum network flow by repeatedly augmenting along a source-to-sink path in the residual network,
whose edge capacities record how much the current flow can be increased or undone.
If an augmenting path has residual capacity ,
the algorithm increases the flow by
on its forward edges and decreases it by
on its backward edges.
The algorithm stops when no augmenting path remains. The resulting flow is maximum by the max-flow min-cut theorem. With integer capacities, every augmentation increases the flow by at least 1, so the method terminates after at most the value of a maximum flow many augmentations. With arbitrary irrational capacities, an unsuitable sequence of paths can fail to terminate. The Edmonds-Karp choice of a shortest augmenting path gives a polynomial-time variant.