The Ford–Fulkerson method or Ford–Fulkerson algorithm (FFA) is a greedy algorithm that computes the maximum flow in a flow network.
It is sometimes called a "method" instead of an "algorithm" as the approach to finding augmenting paths in a residual graph is not fully specified[1] or it is specified in several implementations with different running times.
[3] The name "Ford–Fulkerson" is often also used for the Edmonds–Karp algorithm, which is a fully defined implementation of the Ford–Fulkerson method.
The idea behind the algorithm is as follows: as long as there is a path from the source (start node) to the sink (end node), with available capacity on all edges in the path, we send flow along one of the paths.
We want to find the maximum flow from the source s to the sink t. After every step in the algorithm the following is maintained: This means that the flow through the network is a legal flow after each round in the algorithm.
Notice that it can happen that a flow from v to u is allowed in the residual network, though disallowed in the original network: if
The path in step 2 can be found with, for example, breadth-first search (BFS) or depth-first search in
When no more paths in step 2 can be found, s will not be able to reach t in the residual network.
If S is the set of nodes reachable by s in the residual network, then the total capacity in the original network of edges from S to the remainder of V is on the one hand equal to the total flow we found from s to t, and on the other hand serves as an upper bound for all such flows.
This proves that the flow we found is maximal.
See also Max-flow Min-cut theorem.
has multiple sources and sinks, we act as follows: Suppose that
By adding the flow augmenting path to the flow already established in the graph, the maximum flow will be reached when no more flow augmenting paths can be found in the graph.
However, there is no certainty that this situation will ever be reached, so the best that can be guaranteed is that the answer will be correct if the algorithm terminates.
In the case that the algorithm runs forever, the flow might not even converge towards the maximum flow.
However, this situation only occurs with irrational flow values.
[4] When the capacities are integers, the runtime of Ford–Fulkerson is bounded by
is the maximum flow in the graph.
time and increases the flow by an integer amount of at least
A variation of the Ford–Fulkerson algorithm with guaranteed termination and a runtime independent of the maximum flow value is the Edmonds–Karp algorithm, which runs in
The following example shows the first steps of Ford–Fulkerson in a flow network with 4 nodes, source
This example shows the worst-case behaviour of the algorithm.
Consider the flow network shown on the right, with source
, and the capacity of all other edges some integer
We use augmenting paths according to the following table, where
infinitely many times and residual capacities of these edges will always be in the same form.
Total flow in the network after step 5 is
If we continue to use augmenting paths as above, the total flow converges to
[5] Another non-terminating example based on the Euclidean algorithm is given by Backman & Huynh (2018), where they also show that the worst case running-time of the Ford-Fulkerson algorithm on a network
Media related to Ford-Fulkerson's algorithm at Wikimedia Commons