Simple Algorithm
Algorithms & Data Structures · Optimal · 28 min

Maximum Flow in Almost-Linear Time

Interior-point methods, min-ratio cycles and the 2022 breakthrough.

For more than six decades, maximum-flow algorithms improved by polynomial factors: augmenting paths, blocking flows, push-relabel, Orlin's O(nm)O(nm). In 2022, Chen, Kyng, Liu, Peng, Probst Gutenberg and Sachdeva computed exact maximum flows, and minimum-cost flows, in m1+o(1)m^{1+o(1)} time, barely more than it takes to read the graph. Their algorithm is not combinatorial: it follows an interior-point method, one approximately best cycle at a time.

What you’ll learn

  • Trace the history of maximum-flow bounds and the two barriers that stalled it: flow decomposition for path-based methods, and about m\sqrt m expensive iterations for interior-point methods.
  • Derive electrical flows from energy minimization and Laplacian systems, and explain how near-linear Laplacian solvers led to fast approximate undirected maximum flow.
  • Describe the 2022 framework, a potential-reduction interior-point method whose steps are approximate min-ratio cycles, and prove that a fundamental cycle of a low-stretch spanning tree is a good enough step.
  • State the theorem and its deterministic follow-up precisely, list its consequences, and know what remains open.

Six decades of bounds, and two barriers

YearWorkBound (capacities ≤U\le U)
1956–1998Augmenting paths, blocking flows, push-relabel; Goldberg & Rao's binary blocking flowsdown to O~(mmin⁡{m,n2/3}log⁡U)\tilde O(m \min\{\sqrt m, n^{2/3}\} \log U)
2011Christiano, Kelner, Mądry, Spielman & Teng: electrical flows (approximate, undirected)O~(mn1/3ε−11/3)\tilde O(m n^{1/3} \varepsilon^{-11/3})
2013–14Sherman; Kelner, Lee, Orecchia & Sidford (approximate, undirected)m1+o(1)ε−2m^{1+o(1)} \varepsilon^{-2}
2013Mądry: interior point with electrical flows (exact, unit capacities)O~(m10/7)\tilde O(m^{10/7})
2013Orlin (strongly polynomial)O(nm)O(nm)
2014Lee & Sidford: interior point with fewer iterationsO~(mn)\tilde O(m\sqrt n), polylogarithmic in UU
2020Kathuria, Liu & Sidfordm4/3+o(1)U1/3m^{4/3 + o(1)} U^{1/3}
2020–21van den Brand et al. (dense graphs)O~((m+n1.5)log⁡U)\tilde O((m + n^{1.5}) \log U)
2021Gao, Liu & Peng (sparse graphs)O~(m3/2−1/328log⁡U)\tilde O(m^{3/2 - 1/328} \log U)
2022Chen, Kyng, Liu, Peng, Probst Gutenberg & Sachdevam1+o(1)log⁡Um^{1+o(1)} \log U, randomized
2023van den Brand, Chen, Peng, Kyng, Liu, Probst Gutenberg, Sachdeva & Sidfordm1+o(1)log⁡Um^{1+o(1)} \log U, deterministic
O~\tilde O hides polylogarithmic factors. The 2011–2014 approximate results are for undirected graphs; all others compute exact maximum flows in directed graphs.

Two obstacles explain the long plateau near m1.5m^{1.5}.

  • Flow decomposition. Algorithms that build a flow path by path can face Θ(m)\Theta(m) paths of length Θ(n)\Theta(n), so they spend Ω(nm)\Omega(nm) time writing them down (the Optimal lesson Max-Flow Min-Cut in Depth). Orlin's O(nm)O(nm) meets this barrier; it cannot be beaten by listing paths.
  • Interior-point iterations. Maximum flow is a linear program, and interior-point methods solve it by following a central path through the interior of the feasible region. Classic methods need about m\sqrt m iterations, each solving a linear system, which caps them near m1.5m^{1.5}; Lee and Sidford cut the count to about n\sqrt n. Even with linear-time solvers, m\sqrt m iterations of Ω(m)\Omega(m) work each are too many.

The 2022 algorithm escapes both: it never lists paths, and it takes m1+o(1)m^{1+o(1)} interior-point steps that each cost only mo(1)m^{o(1)} amortized time.

Check your understanding

Why can no algorithm that builds a maximum flow by writing down one augmenting path at a time run in o(nm)o(nm) time on every input?

  1. Because breadth-first search takes Ω(m)\Omega(m) time per path
  2. Because some networks need Θ(m)\Theta(m) paths of length Θ(n)\Theta(n) in every path decomposition of their maximum flows, and writing them down already costs Θ(nm)\Theta(nm)
  3. Because the number of augmentations always equals the flow value
  4. Because maximum flow is NP-hard for large capacities
Show the answer

B. Because some networks need Θ(m)\Theta(m) paths of length Θ(n)\Theta(n) in every path decomposition of their maximum flows, and writing them down already costs Θ(nm)\Theta(nm)

The cost is in the output: if every way of expressing the flow as paths needs many long paths, any algorithm that materializes them pays for it. Dinic, push-relabel with dynamic trees and Orlin's algorithm all live at or above this barrier; the almost-linear algorithm works with the flow vector directly.

Electrical flows and Laplacian solvers

DerivationOhm’s law and the Laplacian
  1. f=R−1B ϕ,that is,fuv=ϕu−ϕvruvf = R^{-1} B\,\phi, \qquad\text{that is,}\qquad f_{uv} = \frac{\phi_u - \phi_v}{r_{uv}}

    Minimize the energy subject to B⊤f=dB^\top f = d with Lagrange multipliers ϕ∈Rn\phi \in \R^n, one per vertex. Setting the gradient of ∑erefe2−2ϕ⊤(B⊤f−d)\sum_e r_e f_e^2 - 2\phi^\top(B^\top f - d) to zero gives Ohm's law: the multipliers are vertex potentials.

  2. L ϕ=d,L=B⊤R−1B,Luu=∑e∋u1re,Luv=−1ruvL\,\phi = d, \qquad L = B^\top R^{-1} B, \qquad L_{uu} = \sum_{e \ni u} \frac{1}{r_e},\quad L_{uv} = -\frac{1}{r_{uv}}

    Substituting into the constraint gives a linear system in the potentials, whose matrix is the weighted Laplacian of the graph:

  3. E(f)=ϕ⊤B⊤R−1B ϕ=ϕ⊤d=ϕs−ϕt=Reff(s,t)\mathcal E(f) = \phi^\top B^\top R^{-1} B\,\phi = \phi^\top d = \phi_s - \phi_t = R_{\mathrm{eff}}(s, t)

    For one unit from ss to tt, the minimum energy is the effective resistance between them:

Predict before you look

One unit of electrical flow goes from ss to tt along two parallel routes with resistances 1 and 3. What fraction of the unit takes the route of resistance 1?

Show the answer

0.75

Both routes see the same potential difference VV, so they carry V/1V/1 and V/3V/3, which must add up to 1: V=3/4V = 3/4, and the split is 3/43/4 and 1/41/4. The energy is 1⋅(3/4)2+3⋅(1/4)2=3/41 \cdot (3/4)^2 + 3 \cdot (1/4)^2 = 3/4, which is the effective resistance 1⋅3/(1+3)1 \cdot 3/(1 + 3). Electrical flow spreads over all routes in proportion to conductance, unlike a shortest path.

Fast solvers. Spielman and Teng (2004) showed that Laplacian systems can be solved to accuracy ε\varepsilon in nearly linear time, O~(mlog⁡(1/ε))\tilde O(m \log(1/\varepsilon)), so one electrical flow costs about as much as reading the graph. Christiano, Kelner, Mądry, Spielman and Teng (2011) turned this into approximate undirected maximum flow by multiplicative weights: compute an electrical flow, raise the resistance of every edge whose capacity it overloads, repeat, and average. Sherman (2013) and Kelner, Lee, Orecchia and Sidford (2014) then reached m1+o(1)m^{1+o(1)} time for approximate undirected maximum flow.

Two things were still missing: exactness, since approximate methods converge slowly to the precise optimum, and direction, since electrical flows treat edges as two-way. Interior-point methods supply both, and Mądry (2013) combined them with electrical flows to break m1.5m^{1.5} for unit capacities. The 2022 algorithm keeps the interior-point method but replaces each step's linear system, an ℓ2\ell_2 problem, by an ℓ1\ell_1-type problem that combinatorial graph data structures can solve approximately.

Interior points and min-ratio cycles

The algorithm solves minimum-cost flow: minimize c⊤fc^\top f subject to B⊤f=dB^\top f = d and l≤f≤ul \le f \le u; maximum flow is a special case. It starts from a feasible flow and repeatedly adds a circulation Δ\Delta, a flow with B⊤Δ=0B^\top \Delta = 0, so the demands stay met. Progress is measured by a potential function that combines the gap to the optimal cost F∗F^* (found by binary search) with barriers that keep every edge strictly inside its bounds:

Φ(f)=C mlog⁡(c⊤f−F∗)+∑e[(ue−fe)−α+(fe−le)−α],α=Θ(1log⁡(mU))\Phi(f) = C\,m \log\big(c^\top f - F^*\big) + \sum_{e} \Big[ (u_e - f_e)^{-\alpha} + (f_e - l_e)^{-\alpha} \Big], \qquad \alpha = \Theta\Big(\frac{1}{\log(mU)}\Big)
CC is a large constant. The first term falls as the cost approaches F∗F^*; the barrier terms explode near a capacity bound. Once Φ\Phi is low enough, the flow is so close to optimal that rounding gives an exact optimum.

Why a cycle. Any circulation splits into simple cycles that each follow its directions, so both g⊤Δg^\top\Delta and ∥LΔ∥1\norm{L\Delta}_1 split into sums over those cycles, and by the mediant inequality one cycle's ratio is at least as good as the whole. The step is therefore a single cycle, a combinatorial object.

Why it suffices. Chen et al. show that a step along a κ\kappa-approximate min-ratio cycle, suitably scaled, lowers Φ\Phi by an amount that depends only on κ\kappa; with κ=mo(1)\kappa = m^{o(1)}, it is m−o(1)m^{-o(1)} per step. Φ\Phi starts at O(mlog⁡(mU))O(m \log(mU)), so m1+o(1)m^{1+o(1)} steps (with logarithmic dependence on UU) reach the end. Everything hinges on finding good cycles fast.

DerivationA tree cycle is good enough
  1. Δ∗=∑e∉TΔe∗ Ce,g⊤Δ∗=∑e∉TΔe∗ g⊤Ce\Delta^* = \sum_{e \notin T} \Delta^*_e\, C_e, \qquad g^\top \Delta^* = \sum_{e \notin T} \Delta^*_e\, g^\top C_e

    Let Δ∗\Delta^* be an optimal circulation and TT a spanning tree. For an edge e∉Te \notin T, let CeC_e be its fundamental cycle: ee plus the tree path back. Every circulation is determined by its values off the tree, so

  2. ∑e∉T∣Δe∗∣ ∥LCe∥1=∑e∉T∣Δe∗∣ ℓe(1+strT(e))\sum_{e \notin T} \abs{\Delta^*_e}\, \norm{L C_e}_1 = \sum_{e \notin T} \abs{\Delta^*_e}\, \ell_e \big(1 + \mathrm{str}_T(e)\big)

    The length of CeC_e is ℓe\ell_e plus the length of the tree path, that is, ℓe(1+strT(e))\ell_e (1 + \mathrm{str}_T(e)), where the stretch strT(e)\mathrm{str}_T(e) is the tree path's length divided by ℓe\ell_e:

  3. min⁡e∉TΔe∗ g⊤Ce∣Δe∗∣ ∥LCe∥1 ≤ g⊤Δ∗∑e∣Δe∗∣ ℓe(1+strT(e))\min_{e \notin T} \frac{\Delta^*_e\, g^\top C_e}{\abs{\Delta^*_e}\, \norm{L C_e}_1} \ \le\ \frac{g^\top \Delta^*}{\sum_{e} \abs{\Delta^*_e}\, \ell_e (1 + \mathrm{str}_T(e))}

    By the mediant inequality, the best single cycle ±Ce\pm C_e (oriented like Δe∗\Delta^*_e) has a ratio at least as negative as the ratio of the two sums:

  4. g⊤C∥LC∥1 ≤ 1O~(log⁡n)⋅g⊤Δ∗∥LΔ∗∥1\frac{g^\top C}{\norm{L C}_1} \ \le\ \frac{1}{\tilde O(\log n)} \cdot \frac{g^\top \Delta^*}{\norm{L \Delta^*}_1}

    Draw TT from a distribution of low-stretch spanning trees, an idea introduced by Alon, Karp, Peleg and West (1995); constructions in the line of Abraham and Neiman (2012) give every edge expected stretch O~(log⁡n)\tilde O(\log n). Then the denominator is O~(log⁡n) ∥LΔ∗∥1\tilde O(\log n)\,\norm{L\Delta^*}_1 in expectation, so for a good tree some fundamental cycle is an O~(log⁡n)\tilde O(\log n)-approximate min-ratio cycle:

Making it fast. Scanning the m−n+1m - n + 1 fundamental cycles of a few trees costs Θ(m)\Theta(m), and m1+o(1)m^{1+o(1)} steps of that would be quadratic. But the gradient and the lengths change only a little per step, so Chen et al. maintain trees and their best cycles in a dynamic data structure. It recursively shrinks the graph, replacing parts of it by much smaller core graphs built from the trees (vertex sparsification) and thinning edges with spanners (edge sparsification), with mo(1)m^{o(1)} amortized time per step and approximation κ=mo(1)\kappa = m^{o(1)}, which the interior-point method tolerates. The deterministic version (2023) replaced the random trees and sampling with deterministic constructions.

Check your understanding

Why can each step of the 2022 interior-point method be taken along a single simple cycle?

  1. Because maximum flows always consist of cycles
  2. Because the Laplacian system has a cycle as its solution
  3. Because the step must keep the demands satisfied, and only augmenting paths do that
  4. Because a circulation splits into simple cycles that follow its directions, and with an ℓ1\ell_1 denominator one of them has a ratio at least as good as the whole circulation
Show the answer

D. Because a circulation splits into simple cycles that follow its directions, and with an ℓ1\ell_1 denominator one of them has a ratio at least as good as the whole circulation

The ratio g⊤Δ/∥LΔ∥1g^\top\Delta / \norm{L\Delta}_1 has a numerator and a denominator that are both additive over a conformal cycle decomposition, so the mediant inequality picks out a cycle at least as good. With the ℓ2\ell_2 norm of classical interior-point methods the denominator would not split, and the step would be a dense electrical flow instead.

The theorem, its reach, and what is open

Reach. Every problem that reduces to min-cost flow with polynomially bounded integers inherits the bound: bipartite matching and its weighted version (the assignment problem), single-source shortest paths with negative integer weights, and many problems in the Optimized lesson's modeling toolbox. All-pairs minimum cuts followed: a Gomory–Hu tree in m1+o(1)m^{1+o(1)} time (Abboud, Li, Panigrahi & Saranurak, 2023). Follow-up work has extended the framework to graphs that change over time.

What m1+o(1)m^{1+o(1)} means. For every fixed ε>0\varepsilon > 0, the time is O(m1+ε)O(m^{1+\varepsilon}) for large enough mm. The mo(1)m^{o(1)} factor is subpolynomial, but in the current analyses it is not polylogarithmic, and the algorithm is far from practical: on real inputs, push-relabel and augmenting-path codes remain the tools of choice.

Check your understanding

Which statement about a running time of m1+o(1)m^{1+o(1)} is correct?

  1. For every fixed ε>0\varepsilon > 0, it is O(m1+ε)O(m^{1+\varepsilon}) for large enough mm
  2. It means O(m)O(m), with the o(1)o(1) hiding a constant factor
  3. It means O(mlog⁡m)O(m \log m)
  4. It is at least m1.01m^{1.01} for large mm
Show the answer

A. For every fixed ε>0\varepsilon > 0, it is O(m1+ε)O(m^{1+\varepsilon}) for large enough mm

mo(1)m^{o(1)} is a factor that grows more slowly than any fixed power mεm^\varepsilon. It may still grow faster than every power of log⁡m\log m, which is why "almost-linear" is weaker than "nearly linear" (O~(m)\tilde O(m), polylogarithmic factors).

Key takeaways

  • Path-based maximum-flow algorithms meet the Ω(nm)\Omega(nm) flow-decomposition barrier, and classic interior-point methods need about m\sqrt m costly iterations; the 2022 algorithm avoids both.
  • An electrical flow minimizes ∑erefe2\sum_e r_e f_e^2; its potentials solve the Laplacian system Lϕ=dL\phi = d, which Spielman–Teng-style solvers handle in nearly linear time, and its energy is the effective resistance.
  • The 2022 interior-point method adds circulations that approximately minimize g⊤Δ/∥LΔ∥1g^\top\Delta / \norm{L\Delta}_1. With an ℓ1\ell_1 denominator the best step is a single cycle, and a fundamental cycle of a random low-stretch spanning tree is within O~(log⁡n)\tilde O(\log n) of optimal.
  • A dynamic data structure maintains such cycles in mo(1)m^{o(1)} amortized time per step over m1+o(1)m^{1+o(1)} steps: exact maximum flow and min-cost flow in m1+o(1)m^{1+o(1)} time (randomized 2022, deterministic 2023), with matching, negative-weight shortest paths and Gomory–Hu trees as consequences.
  • Open: nearly linear O~(m)\tilde O(m) time, simple and practical or combinatorial almost-linear algorithms, strongly polynomial bounds below O(nm)O(nm), and general matching.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

In the electrical flow that routes one unit from ss to tt, how is the flow on an edge (u,v)(u, v) determined?

  1. It is the same on every edge of a shortest ss–tt path and zero elsewhere
  2. It is (ϕu−ϕv)/ruv(\phi_u - \phi_v)/r_{uv} for vertex potentials ϕ\phi that solve the Laplacian system Lϕ=dL\phi = d
  3. It is found by augmenting along paths until no path is left
  4. It is proportional to the edge's capacity
Show the answer

B. It is (ϕu−ϕv)/ruv(\phi_u - \phi_v)/r_{uv} for vertex potentials ϕ\phi that solve the Laplacian system Lϕ=dL\phi = d

The electrical flow minimizes energy subject to the demands; its optimality conditions are Ohm's law, and conservation turns them into Lϕ=dL\phi = d. That is why fast Laplacian solvers make electrical flows cheap.

Question 2

What does each step of the 2022 almost-linear-time algorithm compute?

  1. An augmenting path in the residual graph, found by breadth-first search
  2. An exact electrical flow, by solving a Laplacian system
  3. A blocking flow in a level graph
  4. An mo(1)m^{o(1)}-approximate min-ratio cycle, a circulation that nearly minimizes g⊤Δ/∥LΔ∥1g^\top\Delta / \norm{L\Delta}_1, maintained by a dynamic data structure
Show the answer

D. An mo(1)m^{o(1)}-approximate min-ratio cycle, a circulation that nearly minimizes g⊤Δ/∥LΔ∥1g^\top\Delta / \norm{L\Delta}_1, maintained by a dynamic data structure

The interior-point method reduces its potential by adding circulations; the gradient gg and the lengths ℓ\ell come from the potential. Approximation by an mo(1)m^{o(1)} factor costs only an mo(1)m^{o(1)} factor in the number of steps, and a dynamic data structure finds each cycle in mo(1)m^{o(1)} amortized time.

Question 3

Why does some fundamental cycle of a low-stretch spanning tree approximate the min-ratio cycle well?

  1. Because every fundamental cycle has length at most O(log⁡n)O(\log n)
  2. Because the optimal circulation is a sum of fundamental cycles whose total length exceeds its own by only an O~(log⁡n)\tilde O(\log n) factor, so by the mediant inequality one cycle is within that factor
  3. Because low-stretch trees are minimum spanning trees
  4. Because the optimal circulation is always a single fundamental cycle
Show the answer

B. Because the optimal circulation is a sum of fundamental cycles whose total length exceeds its own by only an O~(log⁡n)\tilde O(\log n) factor, so by the mediant inequality one cycle is within that factor

Write Δ∗=∑e∉TΔe∗Ce\Delta^* = \sum_{e \notin T} \Delta^*_e C_e. The numerators add up exactly; the denominators add up to ∑e∣Δe∗∣ℓe(1+strT(e))\sum_e \abs{\Delta^*_e} \ell_e (1 + \mathrm{str}_T(e)), which low stretch keeps within O~(log⁡n)\tilde O(\log n) of ∥LΔ∗∥1\norm{L\Delta^*}_1. The best term of a sum of ratios is at least as good as the ratio of the sums.

Question 4

Which of these does not follow directly from almost-linear-time minimum-cost flow?

  1. Maximum matching in a bipartite graph
  2. Single-source shortest paths with negative integer edge weights
  3. Maximum matching in a general (non-bipartite) graph
  4. The assignment problem with integer costs
Show the answer

C. Maximum matching in a general (non-bipartite) graph

General matching is not a flow problem: odd cycles break the reduction, and it needs blossoms or algebra. No almost-linear algorithm is known for it. The other three are min-cost flow problems with polynomially bounded integers.

Further reading

  • D. A. Spielman & S.-H. Teng, "Nearly-linear time algorithms for graph partitioning, graph sparsification, and solving linear systems," Proceedings of the 36th ACM Symposium on Theory of Computing (2004).
  • P. Christiano, J. A. Kelner, A. Mądry, D. A. Spielman & S.-H. Teng, "Electrical flows, Laplacian systems, and faster approximation of maximum flow in undirected graphs," Proceedings of the 43rd ACM Symposium on Theory of Computing (2011).
  • L. Chen, R. Kyng, Y. P. Liu, R. Peng, M. Probst Gutenberg & S. Sachdeva, "Maximum Flow and Minimum-Cost Flow in Almost-Linear Time," Proceedings of the 63rd IEEE Symposium on Foundations of Computer Science (2022).
  • J. van den Brand, L. Chen, R. Peng, R. Kyng, Y. P. Liu, M. Probst Gutenberg, S. Sachdeva & A. Sidford, "A Deterministic Almost-Linear Time Algorithm for Minimum-Cost Flow," Proceedings of the 64th IEEE Symposium on Foundations of Computer Science (2023).
  • A. V. Goldberg & S. Rao, "Beyond the flow decomposition barrier," Journal of the ACM 45(5) (1998), 783–797.