- Introduced by
- Lester R. Ford and Delbert R. Fulkerson
- Year
- 1956
- Type
- algorithm
- Family
- Graph Algorithms
What does it do?
The Ford-Fulkerson algorithm, published by Lester R. Ford and Delbert R. Fulkerson in 1956, computes the maximum flow in a flow network: the largest amount of material that can be sent from a designated source to a designated sink when each edge has a capacity limit.
The method is usually presented for directed networks, and undirected edges can be handled by a standard transformation described below.
The intuition behind the method
The algorithm repeatedly searches for an augmenting path from source to sink in the residual network, where each edge's remaining capacity is what is left after the flow already sent. Each such path can carry additional flow equal to its bottleneck, the smallest residual capacity along it. Flow is increased along the path, and the residual capacities are reduced accordingly. When no augmenting path remains, the accumulated flow is maximum. The reason this stopping condition is trustworthy is the max-flow min-cut theorem: at that point, the vertices still reachable from the source in the residual network define a cut whose capacity equals the flow sent, so no larger flow is possible.
History
Ford and Fulkerson's 1956 paper, 'Maximal flow through a network', formulated the problem of finding a maximal flow between two points of a network, a question which the paper attributes to T. Harris in the context of a rail network, and gave the augmenting-path method for solving it. The same paper is the source of the max-flow min-cut relation used to certify the result. Edmonds and Karp (1972) later improved the worst-case bound by using breadth-first search to choose augmenting paths, and further algorithms by Dinic and by Karzanov gave faster methods, but the Ford-Fulkerson method remains a standard reference point in algorithm courses.
When to use it
Choose Ford-Fulkerson when the goal is to understand augmenting-path reasoning or the max-flow min-cut relation, or when the network is small and its capacities are modest. The method works on directed networks directly and on undirected networks after each undirected edge is replaced by two opposite directed edges. Because the number of augmentations depends on the capacity values, the plain method can be slow even on a small network when capacities are large. Do not choose it for large networks or when a running time that does not depend on capacity values is required. In those cases, Edmonds-Karp (which selects shortest augmenting paths by breadth-first search) or Dinic's algorithm is the more appropriate choice.
Limitations and considerations
- The number of augmentations depends on the capacity values, not only on the size of the network, so the running time is pseudo-polynomial rather than polynomial in the input size.
- With irrational capacities the augmentation process may fail to terminate, so exact arithmetic with rational capacities is needed for a guaranteed finite run.
- On large networks it is generally slower than Edmonds-Karp or Dinic's algorithm, which give polynomial bounds independent of capacity values.
- The sequence of augmenting paths chosen affects how many iterations are needed, so the behaviour is not fixed by the network alone.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- When the search finds no augmenting path, the set of vertices reachable from the source in the residual network gives a minimum cut, so the result can be checked against the cut capacity.
- With integer capacities every augmentation is an integer, so the flow found is integral; with rational capacities the same holds after scaling to integers.
- The method works on directed networks directly and on undirected networks after the standard replacement of each edge by two opposite directed edges.
- The augmenting-path idea is simple enough to implement and trace by hand on small networks, which makes it useful for teaching the max-flow min-cut relation.
Applications
- Network routing: maximizing data throughput from source to destination in communication networks
- Transportation networks: determining maximum cargo capacity between cities considering road and rail constraints
- Bipartite matching: finding maximum matchings in bipartite graphs by constructing flow networks
- Image segmentation: max-flow and min-cut formulations are used to partition images into foreground and background
- Airline network planning: max-flow models of aircraft or passenger capacity between hubs are used in some planning settings
- Biological networks: flow formulations have been applied to interaction networks when analysing possible pathways between components
- Large instances: specialised variants such as Dinic's algorithm or push-relabel are generally preferred to the plain method in practice
How it works
How it works
Set the flow on every edge to zero and take the residual capacities equal to the original edge capacities. Throughout the procedure, the flow on each edge must stay between zero and that edge's capacity, and at every vertex other than the source and sink the incoming flow must equal the outgoing flow. For an edge from u to v with capacity c(u,v) and flow f(u,v), the residual capacity of the forward direction is c(u,v) minus f(u,v). The reverse direction has residual capacity f(u,v), which allows that flow to be cancelled later.
Find a path from source to sink in the residual network using depth-first or breadth-first search. Compute the minimum residual capacity along the path, add that amount of flow to each forward edge on the path, and subtract it from the residual capacity of each forward edge. Update the reverse edges so that flow can later be undone.
Repeat the augmentation step until the search finds no path from source to sink in the residual network. The total flow sent is then the maximum flow, and the vertices reachable from the source in the final residual network form a minimum cut.
Common pitfalls
- Choosing augmenting paths without a rule (for example, arbitrary depth-first search on a graph with large capacities) can lead to many augmentations that each add only a small amount of flow.
- Forgetting to add reverse residual edges means flow cannot be partly undone later, so the procedure can stop before the true maximum is reached.
- Using integer division or floating-point arithmetic on capacities can produce rounding errors that affect termination or the final value; exact arithmetic is needed where correctness depends on it.
Frequently asked questions
What is the max-flow min-cut theorem?
The theorem states that the maximum flow from source to sink equals the minimum capacity of any cut separating the source from the sink. In the algorithm, the cut is read off from the residual network when no augmenting path remains, which gives both a theoretical insight and a check on the computed flow.
Why does the algorithm sometimes converge slowly?
With unfortunate path selections, the algorithm may augment by only a small amount of flow per iteration, even when larger augmentations are possible. Choosing shortest augmenting paths by breadth-first search (Edmonds-Karp) gives a polynomial bound on the number of augmentations.
How does the algorithm handle undirected edges?
Replace each undirected edge with two directed edges in opposite directions, both with the same capacity. The algorithm then finds flow on the directed network.
What is the difference between flow on an edge and residual capacity?
Flow on an edge represents the amount of material sent along it, while residual capacity is the remaining capacity available. Residual capacity decreases as flow increases, and reverse edges track the ability to undo flow.
Related methods
Sources
Ford, L. R., & Fulkerson, D. R. (1956). Maximal flow through a network. Canadian Journal of Mathematics, 8(3), 399-404.
Open DOI referenceCormen, T. H., Leiserson, C. E., Rivest, R. L., & Stein, C. (2009). Introduction to Algorithms (3rd ed.). MIT Press.
ISBN: 978-0-262-03384-8