- Introduced by
- Andrew V. Goldberg and Robert E. Tarjan
- Year
- 1988
- Type
- algorithm
- Family
- Graph Algorithms
What does it do?
The push-relabel algorithm, introduced by Andrew V. Goldberg and Robert E. Tarjan in 1988, computes a maximum flow in a directed network with nonnegative edge capacities, one source and one sink.
Instead of sending flow along whole source-to-sink paths, it maintains a preflow, in which a node may receive more flow than it sends, and moves this excess locally toward the sink. The 1988 paper gives an O(n³) time bound on an n-vertex graph.
The intuition behind the method
Each node carries a height, a distance-like label, and flow may only be pushed from a node to a neighbour with a lower height. A node holding excess flow pushes it downhill when it can; when it cannot, its height is raised (relabelled) so that a route opens up. Excess that cannot reach the sink can be returned toward the source, so the process ends when no node other than the source and sink holds excess. The 1988 abstract describes the method as pushing local excess along what are estimated to be shortest paths, which avoids the repeated whole-path searches of augmenting-path methods.
History
Goldberg and Tarjan introduced the push-relabel method in 1988. Their paper builds on the preflow concept of Karzanov and presents the method as an alternative to augmenting-path algorithms. According to the 1988 paper, all previously known efficient maximum-flow algorithms worked by finding augmenting paths, either one path at a time, as in the original Ford and Fulkerson algorithm, or all shortest-length augmenting paths at once, using Dinic's layered-network approach.
When to use it
Consider push-relabel when the network is large or dense and worst-case time bounds matter, or when a parallel or distributed implementation is planned, since the 1988 paper describes both. The paper reports that its dynamic-tree version is as fast as any known method for any graph density and faster on graphs of moderate density. For small or sparse networks the advantage is less clear, so the choice should be tested on the network at hand. For teaching the idea of augmenting paths, Ford-Fulkerson is the more natural starting point.
Limitations and considerations
- The bookkeeping is heavier than for augmenting-path methods: the height function, residual capacities and active-node set must all be kept consistent.
- Intermediate states are preflows, not flows, so the flow value at any stage before excess is cleared does not describe a feasible flow.
- Practical speed depends on the choice of active node and on heuristics such as the gap heuristic, so the stated worst-case bound alone does not predict running time on a given network.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Worst-case time of O(n³) on an n-vertex graph, obtained without searching for augmenting paths (1988 paper).
- With the dynamic-tree data structure, the running time is O(nm log(n²/m)) on an n-vertex, m-edge graph. The 1988 paper states that this is as fast as any known method for any graph density and faster on graphs of moderate density.
- The 1988 paper states that the algorithm admits efficient distributed and parallel implementations.
- A parallel version runs in O(n² log n) time using n processors and O(m) space, according to the 1988 paper.
Applications
- Computing maximum flow and minimum cut in network-throughput problems, such as communication networks.
- Parallel and distributed flow computation, which the 1988 paper describes as possible for this method.
How it works
How it works
Set the height of the source to the number of vertices and all other heights to zero. Saturate every edge leaving the source, so that each neighbour of the source receives excess flow and the state is a valid preflow.
While some node other than the source and sink holds excess, select such an active node and push its excess along a residual edge to a neighbour of lower height. If no such push is possible, relabel the node to a height just above its lowest residual neighbour. Implementations differ mainly in how they choose the next active node, and this choice affects running time in practice.
Formula
O(n^3)\quad\text{generic method}\qquad O(nm\log(n^2/m))\quad\text{dynamic trees}\qquad O(n^2\log n)\quad\text{parallel version with }n\text{ processors and }O(m)\text{ space}The algorithm stops when no node other than the source and sink holds excess. A preflow is a flow only when inflow equals outflow at every node other than the source and sink, which holds once all excess has been cleared, either delivered to the sink or returned to the source. At that point the preflow is a valid flow, and its value equals the total flow arriving at the sink.
Common pitfalls
- Pushing along an edge that does not go to a lower height, or relabelling a node by too little, breaks the height condition. Once that condition fails, the correctness argument no longer holds, and the final preflow need not be a maximum flow.
- Omitting heuristics such as the gap heuristic and using a poor order of active-node selection can make the implementation far slower than its worst-case bound suggests.
- Reading the preflow as a flow before all excess has been resolved, which gives a wrong flow value.
Frequently asked questions
What is the difference between preflow and flow?
In a preflow, the inflow at a node other than the source may exceed its outflow, so the node holds excess flow. In a true flow, inflow equals outflow at every node except the source and sink. The algorithm ends when the excess is cleared, at which point the preflow is a valid flow.
What is the purpose of the height function?
Heights act as a distance-like measure: flow is only pushed from a node to a neighbour of lower height. This restriction prevents unnecessary cycling and helps guarantee termination. Heights are increased by relabelling when a node needs a new route.
What is the gap heuristic and why is it important?
The gap heuristic detects when no node has a certain height value, which means nodes above that gap cannot reach the sink. Such nodes can be identified and handled early, which improves practical performance.
How does push-relabel compare with augmenting-path methods?
All previously known efficient maximum-flow algorithms work by finding augmenting paths, one at a time or all shortest-length ones at once. Push-relabel avoids this search. The 1988 paper states that it runs as fast as any other known method on dense graphs, with an O(n³) time bound on an n-vertex graph. For small or sparse networks the advantage is less clear, so the choice should be tested on the network at hand.
Related methods
Sources
Goldberg, A. V., & Tarjan, R. E. (1988). A new approach to the maximum flow problem. Journal of the ACM, 35(4), 921-940.
Open DOI referenceGoldberg, A. V. (1998). Recent advances in maximum flow and minimum-cost flow algorithms. In Algorithm Theory (pp. 1-10). Springer, Berlin.
Open publication reference