# Ford-Fulkerson

## General information

Algorithmic problem: Max-flow problems (standard version)

Type of algorithm: loop

## Abstract view

Invariant: After $i \ge 0$ iterations:

1. The flow $f$ is a feasible flow.
2. If all upper bounds are integral, $f$ is integral as well.

Variant: The flow value of $f$ increases.

Break condition: There is no flow-augmenting path.

## Induction basis

Abstract view: We start with some feasible flow, for example, the zero flow.

Implementation: Obvious.

Proof: Obvious.

## Induction step

Abstract view: Find a flow-augmenting path and increase $f$ along this path up to saturation. If no path is found, the break condition applies, and the loop is terminated.

Proof: If the graph traversal does not hit $t$, the break condition is fulfilled, and nothing is to show. So consider the case that the graph traversal does hit $t$. Then an $(s,t)$-path is found. Augmenting along this path up to saturation preserves feasibility of the flow.

## Correctness

Due to the invariant, the flow is feasible before and after each iteration. Termination results from the complexity considerations below. Due to the max-flow min-cut theorem, the break condition implies that the final flow is maximum.

## Complexity

Statement: If all capacity values are integral, the asymptotic worst-case complexity is $\mathcal{O} (m\cdot F)$, where $m = |A|$ and $F$ is the maximum total flow value.

Proof: A graph search from $s$ requires $\Omicron (m)$ . Obviously, determining $x$ and $y$ and changing the flow values along $p$ requires $\mathcal{O}(m)$ as well. It is also evident that, before and after each iteration, the flow values on all arcs are integral. In particular, the total flow value is integral. The variant implies that, in case of integral capacity values, the total flow value increases by at least one unit in every iteration. Since the total flow value is always in the interval $[0...F]$, this may happen at most $F$ times.

Remark: The number of nodes is irrelevant because at most $m$ nodes are reachable from $s$ (not including $s$ itself).