pushrelabel
Push-relabel, also known as the preflow-push algorithm, is an algorithm for computing the maximum s–t flow in a directed graph with capacities. It maintains a feasible preflow and a height function on vertices that guides flow toward the sink. The source is given a large height and initially saturates all edges leaving it, creating excess flow at downstream vertices. The algorithm repeatedly selects an active vertex (one with positive excess, excluding the sink) and either pushes flow toward a neighboring vertex or, if no push is possible, relabels the vertex to enable further pushes.
Push operation: if there is residual capacity on an edge (u,v) and the height satisfies h(u) = h(v)
Relabel operation: when no admissible edge exists from an active vertex, its height is increased to the
The process uses a residual graph throughout and ends when no active vertices remain besides the source
Variants and heuristics improve performance. The global relabeling heuristic periodically recomputes vertex heights via a backward
Push-relabel was introduced by Goldberg and Tarjan in 1986 and remains a practical, robust method for maximum