Manuscript Offprint
arXiv:2610.18328A Practical Combinatorial Interior Point Method for Minimum-Cost Flow
Abstract
In a recent breakthrough, Chen, Kyng, Liu, Peng, Probst Gutenberg, and Sachdeva [CKL+25] designed the first almost-linear-time algorithm for minimum-cost flow. Their approach uses an Interior Point Method (IPM) to achieve complexity . However, the factor hides intricate recursive data structures, large constants and multiple log factors. In this paper, we give an implementation following the core ideas of their IPM with practical data structures and empirically obtained decision rules. We compare our solver with the cost scaling and network simplex solvers of LEMON on the instance families of the DIMACS Flow Challenge 2.0 core benchmark. Our implementation scales competitively on five of twelve families and better on two. On grid-wide we observe close to linear scaling: against for LEMON. We read these results as first evidence that the almost-linear-time framework can be relevant in practice, discuss our insights gained during the implementation process, and motivate where future work should focus to bridge the theory-practice gap.
*The research leading to these results has received funding from the starting grant “A New Paradigm for Flow and Cut Algorithms” (no. TMSGI2 218022) and grant no. 200021 204787 of the Swiss National Science Foundation.
1 Introduction
The minimum-cost flow problem and its special case, the maximum flow problem, are among the most foundational problems in combinatorial optimization [AMO93]. Since their origins in the transportation problem [Sch02], they have served as a testbed for a variety of algorithmic paradigms [Sch02]; they are the central primitive in a large number of graph algorithms [LP25; LNPSY21; HHS24; ALPS23; AKL+25]; and they arise directly in applications across transportation and logistics [AMO93], image segmentation [BK04], and machine learning, where computing optimal transport distances reduces to a minimum-cost flow computation [PW09; PC19]. Formally, we consider the following problem.
Definition 1.1 (Minimum-cost flow). Let be a directed graph with vertices and edges, let denote its vertex-edge incidence matrix, and let and be integral edge capacities and costs. Given a demand vector with , the minimum-cost flow problem asks for a flow that achieves
where succinctly encodes that flow routes demand (flow conservation) and encodes that the flow does not exceed capacities (capacity constraint).
Throughout, we write and , and we measure running times in terms of , , and . Since the constraint matrix in Definition 1.1 is totally unimodular, the optimum is attained at an integral flow whenever the instance is feasible.
Recent Progress on the Minimum-Cost Flow Problem. Decades of work produced a rich family of algorithms for minimum-cost flow, culminating in weakly polynomial cost scaling methods [GT90] and in strongly polynomial algorithms [Orl93]. By the 1990s several algorithms had been refined to the point of being genuinely implementable and were being run on real instances at scale [BKV98; Löb96]; the 1991 DIMACS Implementation Challenge on network flows both reflected and accelerated this effort [JM93].
Despite this sustained attention, an algorithm that solves the minimum-cost flow problem in provably almost-linear time remained elusive. By the end of the 1990s, the best runtimes remained for maximum flow [GR98], and for minimum-cost flow [GT90].
The decisive shift came in the early 2000s when Spielman and Teng [ST04] employed methods from convex optimization to solve electric flow problems in near-linear time. Building on this, Daitch and Spielman [DS08] applied Interior Point Methods (IPMs) to minimum-cost flow and obtained a running time of , the first improvement on the problem to come out of the continuous paradigm.
Finally, in 2022, Chen, Kyng, Liu, Peng, Probst Gutenberg, and Sachdeva [CKL+22; CKL+25] achieved the first algorithm to solve minimum-cost flow exactly in time – a major milestone in algorithmic graph theory. Their algorithm combines a new interior point method, based on the work of Karmarkar [Kar84] and Wallacher-Zimmermann [WZ92], with sophisticated graph data structures. The result has reshaped the area, and has since been strengthened and simplified in several directions, including deterministic and more modular variants [CKLMP24; BCK+23; BCK+24].
The Theory-Practice Gap. None of the IPM-based approaches, the centerpiece of algorithmic research since the 2000s, has so far reached practice. In particular, even the almost-linear-time algorithm based on the novel combinatorial IPM has not been implemented, and the practical state of the art relies entirely on insights preceding this new era. The reference point remains the experimental evaluation of Kovács [Kov15], which benchmarks the minimum-cost flow solvers of the LEMON library [DJK11]. Two of them are usually the most efficient: 1) a cost scaling solver, building on and refining the implementation of [Gol97] of the push-relabel cost scaling method of Goldberg and Tarjan [GT90], and 2) a network simplex solver adapted to minimum-cost flow [AMO93]. Network simplex is particularly fast on small networks of up to a few thousand nodes. Cost scaling scales better with instance size and takes over on larger inputs. Nonetheless, on most benchmarks, both solvers exhibit super-linear scaling [Kov15].
There is therefore a substantial gap between the asymptotics of the best algorithms we know and the asymptotics of the algorithms we can run. Closing it is one of the stated motivations for the ongoing DIMACS Flow Challenge 2.0 [DIM26], the first DIMACS challenge devoted to flow problems since [JM93]. There is a concrete obstacle: the factor in [CKL+25] hides recursively constructed data structures whose depth and constants make a faithful implementation hopeless, so it is not clear if the IPM framework and sophisticated data structures could translate to a practical implementation.
Our Contribution. This paper gives the first practical implementation of the almost-linear-time minimum-cost flow algorithm of . Our contributions are as follows:
-
We give a practical implementation of the combinatorial IPM of . In doing so, we overcome obstacles arising from numerical precision by discretizing the IPM implementation. Further, our implementation removes the need for oracle access to the optimal cost.
-
We estimate progress more carefully, which allows us to take larger steps, thereby improving progress-per-step by orders of magnitude. We also introduce rules to drive the IPM more aggressively, making the IPM feasible in practice.
-
We implement a heuristic version of the intricate min-ratio cycle data structure of that repeatedly extracts progress steps. In particular, we start with a single shortest-path tree. We then iterate over its fundamental cycles to take IPM steps. After processing each of these cycles, we consider swapping the off-tree edge with a tree edge, which ensures good progress of later IPM steps along fundamental cycles in practice.
-
We evaluate our solver against the LEMON cost scaling and network simplex solvers on 12 instance families from [Kov15]. We present the insights generated from our implementation and where future work should continue.
Despite larger constant factors of our solver, the results are already encouraging: our solver exhibits better empirical scaling than both LEMON solvers on instances from vision_rnd and grid_wide. On the latter, we observe polynomial scaling of versus LEMON's . Given how heavily engineered the LEMON solvers are, and that our implementation is a first attempt, which has not been optimized for constants, we read this as evidence that the almost-linear-time framework has at least some relevance in practice.
IPM. The starting point of [CKL+25; BCK+23; CKLMP24; BCK+24] is a potential-reducing IPM due to Karmarkar [Kar84] and Wallacher-Zimmermann [WZ92] who named it a combinatorial IPM. At each iteration, the method decreases the potential of the current solution f, which measures the solution's closeness to the optimal cost and its feasibility through a barrier term:
where . If is unknown, it can be determined by a binary search. The barrier plays the role of the more standard , with the precise form chosen for numerical stability.
The IPM requires an initial flow with and , which we call strictly feasible. Such a flow can always be constructed without changing the optimal solution .
At each step, the IPM updates the current solution by a circulation (i.e., ), setting . Flow conservation is maintained by induction: . The step size is restricted so that strict feasibility is preserved: . To reduce the potential, is chosen to minimize the inner product with the gradient of , relative to an -norm weighted by the lengths (arising from the second derivative). Writing for the diagonal matrix of , the update problem is:
By a standard path-cycle decomposition, there always exists a cycle such that the unit circulation along the cycle is optimal for (3). We call this the min-ratio cycle problem. It is shown in [CKL+25] that augmenting along an -approximate min-ratio cycle decreases the potential by , so after iterations the IPM converges to a solution that can be rounded to the minimum-cost flow. The IPM further exhibits a certain robustness in that the multiplicative changes to g and are bounded over the entire update sequence. Thus approximations of g and can be maintained efficiently without requiring too many changes.
Min-Ratio Cycle Data Structure. The central object in [CKL+25] is an -approximate low-stretch spanning tree (LSST): a probabilistic spanning tree in which the st-distance under is at most times the corresponding distance in in expectation, for all . By linearity, some fundamental cycle, formed by an off-tree edge and the u-to-v path in , is an -approximate min-ratio cycle in expectation. Markov's inequality then gives that with probability at least 1/2, at least one fundamental cycle is a -approximation. Maintaining independent LSSTs and applying Chernoff's bound ensures that some contains a good fundamental cycle with high probability.
As flow is augmented and lengths are updated, the trees may degrade. The data structure in [CKL+25] handles this by identifying off-tree edges and trees such that either the fundamental cycle of in is an approximate min-ratio cycle or swapping with an edge in restores its quality.
3 Transfer to Practice
Numerical Precision. In our implementation of the IPM proposed in [CKL+25], we have to be particularly careful with numerical stability. Floating point numbers follow the idea of scientific notation with a fixed number of digits and thus the smallest representable unit depends on the magnitude of the number itself [IEEE19]. The associated loss of associativity might result in breaking flow conservation when routing flow mass. As preserving flow conservation is highly critical, we restrict ourselves to routing small atoms whose amount of flow is guaranteed to be representable exactly by all flow amounts in the feasible range. Then, associativity holds again as addition and subtraction stay exact. As a side effect, as soon as , we can employ rounding from [Coh95] to obtain an optimal integral solution, which is representable no matter the choice of . Smaller allow us to control proximity to barriers at a finer granularity at the cost of more updates and thus runtime. Consequently, we choose the largest that still leads to the exact optimum.
Loss of Strict Feasibility. The idea of strict feasibility is to always allow us to route a small amount along every cycle in both directions. Using atoms to discretize the values that the flow can take necessarily leads to a loss of this property, as the flow is restricted to the feasible range and thus there must be some discrete threshold at which flow mass can only be routed in one direction. All that remains to choose is whether this threshold at which edges turn directed is 0 or away from the hard bounds of the feasible range. We choose it at 0 to make the exact optimum reachable by our IPM.
Refined IPM. The potential in (2) depends on the cost of an optimal flow , which we usually do not know. While it can easily be binary-searched, this adds an undesirable logarithmic factor in practice.
Instead, we can introduce a cost scale that does not depend on . This cost scale is initialized such that the cost and barrier term have the same magnitude. We use barrier obtained by shifting horizontally by a single atom to ensure well-definedness even under the loss of strict feasibility. To ease scaling, we also shift the barrier vertically by , which yields that the minimum of the barrier terms becomes 0. We summarize the potential used in our implementation below:
We now periodically increase , crudely mimicking the effect of the logarithm in (2). We give more details on how to increase in the last paragraph of this section.
Refined Update Problem. As seen in Section 2, [CKL+25] routes a small amount on an approximate min-ratio cycle to make good progress and guarantee almost-linearly many updates. While the ratio between gradient and length of a cycle serves as a good proxy for progress in the IPM, our implementation makes more accurate estimations and takes more carefully calculated steps. More precisely, the progress made by pushing an update amount along an oriented cycle consists of three summands: 1) the linear change in cost (total cost along the cycle times ); 2) the convex change in forward barriers (increasing in ); 3) the convex change in reverse barriers (decreasing in ). This split allows us to bound each term individually, obtain a better estimate and take much larger steps. We call the cycles that optimize our function max-progress cycles.
Bounding the Progress. Since the progress is the sum of the three convex functions, flow mass has to be routed in the direction of negative gradient to reduce the potential. We bound the summands as follows: 1) for the cost we keep the exact term; 2) for the increase in forward barrier terms we use a second-order approximation with the second-order term scaled depending on the ratio between and the minimum residual capacity of any edge such that this yields a sound upper bound; 3) for the decrease in reverse barrier terms we use a single barrier term which we offset and scale such that the first and second derivatives match the respective sums of the actual reverse barriers (proof in Appendix B).
Computing Step Size and Progress. Because this upper bound is convex again, we can find its minimum efficiently and an approximate minimum, which suffices in practice, even more efficiently. In total, computing the progress bound requires six aggregates of the cycle: the total cost, the total first derivative and second derivative of the forward and reverse barriers, and the minimum residual capacity of the forward edges.
Finding Max-Progress Cycles. In [CKL+25], the min-ratio cycle data structure maintains -approximate LSSTs for along with estimates of the ratio for all fundamental tree cycles. However, these LSSTs are intricate and complex, and thus not feasible in practice, leading us to a simplified approach: we only maintain a single tree , and we do not enforce it to be an LSST of good quality. Instead, we fix a root , and initialize to be a single-source shortest paths (SSSP) tree of with respect to the lengths . We observed empirically that is typically a good LSST. We have shared this insight with a group of researchers who have since shown that shortest path trees yield an -approximate LSST under smoothed analysis [DHP+27].
As in [CKL+25], we evaluate all fundamental cycles and calculate their progress. To collect the required aggregates efficiently, we use a depth-first search on the tree along with a modified union-find data structure [Tar83]. We then choose the max-progress cycles to update our solution. Since our progress estimates are more informative than the gradient-length ratios, this allows us to find a fundamental cycle that makes at least as much progress as the min-ratio cycles of our tree T. For efficiency, we maintain T in a link-cut data structure (like [CKL+25]), which enables fast queries given an off-tree edge for the progress by maintaining an -approximation of the aggregates under fast flow updates along fundamental cycles.
Maintaining Max-Progress Cycles. To find good fundamental cycles, we maintain a queue that groups the off-tree edges by the magnitude of the progress achieved by their fundamental cycles. We then repeatedly pop the edge with the largest progress estimate in the queue and use it for an IPM step. Note that the progress initially computed for off-tree edges might become stale, i.e., change significantly. Thus, whenever an edge is popped from the queue, we first re-evaluate the aggregates and re-calculate the optimal step size.
As lengths change, we observed that the LSST quality deteriorates quickly, leading to low progress. Recomputation from scratch is, however, too costly, as our IPM runs for many iterations. Instead, we also repair our tree T. To this end, after considering a fundamental cycle to update the solution, we check whether swapping its off-tree edge brings the tree closer to an SSSP tree again, and thus to an LSST. In practice, these repairs are so efficient that we never have to redraw the LSST from scratch.
Lastly, we say that inspecting 2m off-tree edges constitutes a phase and at the beginning of a new phase, we recompute all aggregates exactly and repopulate our queue with fresh estimates. We point out two remarkable facts. 1) The SSSP tree seems to always allow for good updates, suggesting that the IPM lengths are sufficiently random for the analysis in [DHP+27] to hold, 2) we generally do not need to converge closely to the exact SSSP; few updates typically suffice.
Dealing With Directed Edges. Recall how atomic flow leads to directed edges, and we have so far ignored this issue in our description of the data structure. Having directed edges in the tree T is unfavorable because all cycles with opposite directed edges become unroutable. To mitigate this, we enforce as an invariant that we can always route flow away from the root. We found this to reduce the number of unroutable cycles drastically in practice. However, we can only maintain this invariant if all nodes are reachable from the root, which is not true in general graphs. Thus, we split the residual graph of the initial flow into strongly connected components during preprocessing and solve them individually: clearly, this enables the invariant while leaving the optimum unchanged (it is not possible to route any flow on edges between components).
Adjusting the Cost Scale. We previously defined a phase to be the inspection of 2m off-tree edges. Recall that at the beginning of each phase, we recompute all progress estimates for off-tree edges. Note that due to atomic flow, this estimate might be 0 because routing in the direction of negative gradient can already overshoot the minimum of our bound. We take a high share of such cycles as our signal that the IPM is well-balanced and thus double the cost scale until at least a constant fraction (10 %) of cycles makes progress again. Eventually, when almost all cycles either have an edge directed against the direction of negative gradient or have cost 0, doubling will have almost no effect anymore and we instead round to an integral solution and terminate. Otherwise, we compute the to use for this phase. Larger reduce the work required to maintain the link-cut tree but worsen our progress estimates (because we have to assume that we are on the worst-case end of the -band around the current aggregates). In practice, choosing such that at least half of the cycles that make progress at maintain at least 65 % of their progress works well. We also employ several heuristics to detect livelocks due to numerical discretization.
4 Experiments
IPM Implementation. Our IPM chooses as a compile-time constant power of two. Further, we choose : larger tend to admit exact convergence under larger but past a certain threshold, we no longer converge to the exact optimum.
Baselines and Instances. We follow the call for papers and compare our IPM implementation to the network simplex and cost scaling implementations from LEMON 1.3.1 [DJK11] on the core instances from [Kov15]: netgen_* [KNS74], goto_* [GK92], grid_* [RV93], road_* [DGJ09], and vision_* [Com; BF06]. We also extend grid_wide, for which our solver showed promising scaling, by 6 more sizes (with a modified GRIDGRAPH).
Machine and Setup. We conduct our experiments on a machine with an AMD EPYC 7742 processor with 64 cores (hyperthreading disabled). The L1 instruction cache is 32 KiB per core and data caches are 32 KiB per-core L1, 512 KiB per-core L2, and 16 MiB per-4-cores L3. The CPU has a base frequency of 2.25 GHz and has frequency scaling enabled (up to 3.4 GHz; cannot be disabled due to cloud setting). The machine has 512 GB of DDR4 RAM. We run Ubuntu 24.04.5 LTS with kernel 6.8.0-139-generic. All code was compiled using g++ 13.3.0 and flags -std=c++23 -03 -march=native -ffast-math -fno-finite-math-only. Due to time constraints, we only measured the wall time of a single run on a single seed for each family/size pair. Only one solver was active at a time and no other work was performed simultaneously. The first instance of each family is started at , which is then halved until we reach the exact optimum. Each consecutive point follows the same strategy warm-started from the of the previous instance. We assume oracle access to the largest that achieves the exact minimum for our runtime plots.
Plots. On page 8 we present our evaluation. On the x-axis, we report the size of the instance in edges and on the y-axis the runtime in seconds. Both axes are logarithmic. Each line represents one solver: orange is LEMON's network simplex, purple is LEMON's cost scaling and blue is our IPM implementation. The small numbers above the IPM line mark increases in bits required to solve the instance exactly ( ). We report timeouts after 2 hours (red line) with a cross. Timeouts did not apply to the extended grid_wide instances but we retired LEMON cost scaling after it was persistently slower than our IPM.
Failures. Two IPM points marked with a red star returned a feasible but non-optimal flow, for distinct reasons. On grid_long, our termination rule fires too early (smaller cannot compensate). This issue persists on the next larger instance of the family, which is why we retire the IPM on this family. On the largest road_flow instance, the starred point is the smallest at which the IPM terminates at all; at every smaller we enter a livelock that our current heuristics cannot detect.
Scaling. For the remaining families, we mainly care about the exponent of the least-squares power-law fit (which is the slope in the log-log plot) because our implementation is not highly optimized and thus loses a constant factor compared to the baselines. We highlight a few selected exponents in the plots. We observe that our exponent is competitive with the best baseline solver for many families: netgen_sr, netgen_deg, grid_square, road_paths, and vision_prop. For two families, our solver wins: slightly for vision_rnd and significantly for grid_wide ( vs. ). In contrast, we lose on netgen_8 ( vs. ) and goto_sr ( vs. ). For goto_8, we encounter a lot of variance on all solvers.
Extending vision_rnd. Because the exponent in the overview figure seemed promising, we conducted a scaling experiment on a family constructed from the LB07-bunny-lrg surface-fitting instance [Com; LB07]. Similarly to vision_rnd in the overview, our IPM has the best exponent. Further, for the largest datapoint, we beat LEMON cost scaling, which times out at 48h. However, LEMON network simplex shows a much lower exponent than in the overview, which keeps our IPM from crossing below both baselines. Nevertheless, we observe stable scaling with a low exponent over more than 4 decades.

Figure 1: An extended scaling experiment on the LB07-bunny-lrg surface-fitting instance.
5 Insights
Other Approaches. Before settling on the design introduced above, we also evaluated several alternatives: extending the barrier past the feasible range to avoid directed edges, different LSST designs, different rules to increase the cost scale and detect convergence, using forests instead of trees to route flow in a parallel and cache-friendly manner, and scaling precision dynamically instead of choosing statically. While some of these approaches showed interesting constant improvements, we decided to submit the presented algorithm because it is more stable and scales competitively across many instance families and sizes.
Coupling Between Cost Scale and Precision. One particularly interesting lesson of our research is that and are coupled. Increasing very carefully leads to convergence to the optimum even at large but also bad runtime scaling. On the other hand, we came up with a formula for a constant choice of (and a corresponding ) for which the IPM always converges to the exact optimum but first experiments have shown bad scaling too. As the presented algorithm exhibits better scaling than either extreme, choosing a good strategy to drive the cost scale and adequate precision seems crucial for good scaling.
Future Work. Our current rules seem to work especially well for the grid_wide family, demonstrating that our approach can scale (almost) linearly in practice. Thus, understanding why our IPM scales well on this family and struggles on others could lead to even better steering rules for the IPM and practical almost-linear minimum-cost flow on more, if not all, instance families.
DIMACS Flow 2.0 core benchmark — wall clock vs edges, one run at a time, shared axes
wall clock (s), one run at a time

netgen 8
netgen sr
netgen deg
goto 8
road paths
vision_rnd
goto_sr
road flow
vision_prop
edges
This solver (IPM)
LEMON NetworkSimplex
LEMON CostScaling
power-law fit, over exactly the fitted points
feasible but non-optimal flow
out of time, at the time it was stopped
the cap a run was killed at
our extension past Kovács' ladder
References
[AKL+25] Amir Abboud, Rasmus Kyng, Jason Li, Debmalya Panigrahi, Maximilian Probst Gutenberg, Thatchaphol Saranurak, Weixuan Yuan, and Wuwei Yuan. “Deterministic Almost-Linear-Time Gomory-Hu Trees”. In: arXiv preprint arXiv:2507.20354 (2025) (cit. on p. 1).
[ALPS23] Amir Abboud, Jason Li, Debmalya Panigrahi, and Thatchaphol Saranurak. “All-Pairs Max-Flow is no Harder than Single-Pair Max-Flow: Gomory-Hu Trees in Almost-Linear Time”. In: 2023 IEEE 64th Annual Symposium on Foundations of Computer Science (FOCS). 2023, pp. 2204–2212. DOI: 10.1109/FOCS57990.2023.00137 (cit. on p. 1).
[AMO93] Ravindra K. Ahuja, Thomas L. Magnanti, and James B. Orlin. Network Flows: Theory, Algorithms, and Applications. Englewood Cliffs, NJ: Prentice Hall, 1993 (cit. on pp. 1, 2).
[BCK+23] Jan van den Brand, Li Chen, Rasmus Kyng, Yang P Liu, Richard Peng, Maximilian Probst Gutenberg, Sushant Sachdeva, and Aaron Sidford. “A deterministic almost-linear time algorithm for minimum-cost flow”. In: 2023 IEEE 64th Annual Symposium on Foundations of Computer Science (FOCS). IEEE. 2023, pp. 503–514 (cit. on pp. 1–3).
[BCK+24] Jan van den Brand, Li Chen, Rasmus Kyng, Yang P Liu, Simon Meierhans, Maximilian Probst Gutenberg, and Sushant Sachdeva. “Almost-linear time algorithms for incremental graphs: Min-cost flow and more via duality”. In: 2024 IEEE 65th Annual Symposium on Foundations of Computer Science (FOCS). IEEE. 2024, pp. 2010–2032 (cit. on pp. 1–3).
[BF06] Yuri Boykov and Gareth Funka-Lea. “Graph Cuts and Efficient N-D Image Segmentation”. In: International Journal of Computer Vision 70.2 (Nov. 2006), pp. 109–131 (cit. on p. 6).
[BK04] Yuri Boykov and Vladimir Kolmogorov. “An experimental comparison of min-cut/max-flow algorithms for energy minimization in vision”. In: IEEE Transactions on Pattern Analysis and Machine Intelligence 26.9 (2004), pp. 1124–1137 (cit. on p. 1).
[BKV98] Ursula Bünnagel, Bernhard Korte, and Jens Vygen. “Efficient implementation of the Goldberg-Tarjan minimum-cost flow algorithm”. In: Optimization Methods and Software 10.2 (1998), pp. 157–174 (cit. on p. 1).
[CKL+22] Li Chen, Rasmus Kyng, Yang P. Liu, Richard Peng, Maximilian Probst Gutenberg, and Sushant Sachdeva. “Maximum flow and minimum-cost flow in almost-linear time”. In: IEEE 63rd Annual Symposium on Foundations of Computer Science (FOCS). 2022, pp. 612–623 (cit. on p. 1).
[CKL+25] Li Chen, Rasmus Kyng, Yang Liu, Richard Peng, Maximilian Probst Gutenberg, and Sushant Sachdeva. “Maximum flow and minimum-cost flow in almost-linear time”. In: Journal of the ACM 72.3 (2025), pp. 1–103 (cit. on pp. 0–5).
[CKLMP24] Li Chen, Rasmus Kyng, Yang P Liu, Simon Meierhans, and Maximilian Probst Gutenberg. “Almost-linear time algorithms for incremental graphs: Cycle detection, sccs, st shortest path, and minimum-cost flow”. In: Proceedings of the 56th Annual ACM Symposium on Theory of Computing. 2024, pp. 1165–1173 (cit. on pp. 1–3).
[Coh95] Edith Cohen. “Approximate Max-Flow on Small Depth Networks”. In: SIAM Journal on Computing 24.3 (1995), pp. 579–597. DOI: 10.1137/S0097539792236717 (cit. on p. 4).
[Com] Computer Vision Research Group, University of Western Ontario. Max-flow problem instances in vision. https://vision.cs.uwaterloo.ca/data/maxflow (cit. on pp. 6, 7).
[DGJ09] Camil Demetrescu, Andrew V Goldberg, and David S Johnson. The shortest path problem: Ninth DIMACS implementation challenge. Vol. 74. American Mathematical Soc., 2009 (cit. on p. 6).
[DHP+27] Ioannis Dorkofikis, Bernhard Haeupler, Maximilian Probst Gutenberg, Antti Roeyskoe, Aurelio Sulser, and Gernot Zöcklein. "Low-Stretch Spanning Trees via Smoothed Analysis of Dijkstra's Algorithm". In: Submitted to ACM-SIAM Symposium on Discrete Algorithms (SODA) 2027. 2027 (cit. on p. 5).
[DIM26] DIMACS Implementation Challenge: Flow Challenge 2.0. https://coral.ise.lehigh.edu/flow-challenge-2-0/. 2026 (cit. on p. 2).
[DJK11] Balázs Dezsó, Alpár Jüttner, and Péter Kovács. “LEMON – an open source C++ graph template library”. In: Electronic Notes in Theoretical Computer Science 264.5 (2011), pp. 23–45 (cit. on pp. 2, 6).
[DS08] Samuel I Daitch and Daniel A Spielman. “Faster approximate lossy generalized flow via interior point algorithms”. In: Proceedings of the fortieth annual ACM symposium on Theory of computing. 2008, pp. 451–460 (cit. on p. 1).
[GK92] Andrew V Goldberg and Michael Kharitonov. On implementing scaling push-relabel algorithms for the minimum-cost flow problem. Department of Computer Science, Stanford University, 1992 (cit. on p. 6).
[Gol97] Andrew V Goldberg. “An efficient implementation of a scaling minimum-cost flow algorithm”. In: Journal of algorithms 22.1 (1997), pp. 1–29 (cit. on p. 2).
[GR98] Andrew V. Goldberg and Satish Rao. "Beyond the flow decomposition barrier". In: Journal of the ACM 45.5 (1998), pp. 783–797 (cit. on p. 1).
[GT90] Andrew V. Goldberg and Robert E. Tarjan. “Finding minimum-cost circulations by successive approximation”. In: Mathematics of Operations Research 15.3 (1990), pp. 430–466 (cit. on pp. 1, 2).
[HHS24] Zhongtian He, Shang-En Huang, and Thatchaphol Saranurak. “Cactus Representations in Polylogarithmic Max-flow via Maximal Isolating Mincuts”. In: Proceedings of the 2024 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA). 2024, pp. 1465–1502. DOI: 10.1137/1.9781611977912.60 (cit. on p. 1).
[IEEE19] “IEEE Standard for Floating-Point Arithmetic”. In: IEEE Std 754-2019 (Revision of IEEE 754-2008) (2019), pp. 1–84. DOI: 10.1109/IEEESTD.2019.8766229 (cit. on p. 3).
[JM93] David S. Johnson and Catherine C. McGeoch, eds. Network Flows and Matching: First DIMACS Implementation Challenge. Vol. 12. DIMACS Series in Discrete Mathematics and Theoretical Computer Science. American Mathematical Society, 1993 (cit. on pp. 1, 2).
[Kar84] Narendra Karmarkar. “A new polynomial-time algorithm for linear programming”. In: Proceedings of the sixteenth annual ACM symposium on Theory of computing. 1984, pp. 302–311 (cit. on pp. 1, 3).
[KNS74] D. Klingman, A. Napier, and J. Stutz. "NETGEN: A Program for Generating Large Scale Capacitated Assignment, Transportation, and Minimum Cost Flow Network Problems". In: Management Science 20.5 (1974), pp. 814–821 (cit. on p. 6).
[Kov15] Péter Kovács. “Minimum-cost flow algorithms: an experimental evaluation”. In: Optimization Methods and Software 30.1 (2015), pp. 94–127 (cit. on pp. 2, 6).
[LB07] Victor Lempitsky and Yuri Boykov. “Global optimization for shape fitting”. In: 2007 IEEE Conference on Computer Vision and Pattern Recognition. IEEE. 2007, pp. 1–8 (cit. on p. 7).
[LNPSY21] Jason Li, Danupon Nanongkai, Debmalya Panigrahi, Thatchaphol Saranurak, and Sorrachai Yingchareonthawornchai. “Vertex connectivity in poly-logarithmic max-flows”. In: Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing. 2021, pp. 317–329 (cit. on p. 1).
[Löb96] Andreas Löbel. Solving large-scale real-world minimum-cost flow problems by a network simplex method. Tech. rep. SC-96-07. Konrad-Zuse-Zentrum für Informationstechnik Berlin (ZIB), 1996 (cit. on p. 1).
[LP25] Jason Li and Debmalya Panigrahi. “Deterministic minimum cut in poly-logarithmic maximum flows”. In: Journal of the ACM 72.4 (2025), pp. 1–18 (cit. on p. 1).
[Orl93] James B. Orlin. “A faster strongly polynomial minimum cost flow algorithm”. In: Operations Research 41.2 (1993), pp. 338–350 (cit. on p. 1).
[PC19] Gabriel Peyré and Marco Cuturi. “Computational optimal transport with applications to data sciences”. In: Foundations and Trends in Machine Learning 11.5-6 (2019), pp. 355–607 (cit. on p. 1).
[PW09] Ofir Pele and Michael Werman. “Fast and robust earth mover’s distances”. In: IEEE International Conference on Computer Vision (ICCV). 2009, pp. 460–467 (cit. on p. 1).
[RV93] Mauricio GC Resende and Geraldo Veiga. “An efficient implementation of a network interior point method”. In: Network flows and matching: first DIMACS implementation challenge 12 (1993), pp. 299–348 (cit. on p. 6).
[Sch02] Alexander Schrijver. “On the history of the transportation and maximum flow problems”. In: Mathematical programming 91.3 (2002), pp. 437–445 (cit. on p. 1).
[ST04] Daniel A. Spielman and Shang-Hua Teng. “Nearly-linear time algorithms for graph partitioning, graph sparsification, and solving linear systems”. In: Proceedings of the 36th Annual ACM Symposium on Theory of Computing (STOC). 2004, pp. 81–90 (cit. on p. 1).
[Tar83] Robert Endre Tarjan. Data structures and network algorithms. SIAM, 1983 (cit. on p. 5).
[WZ92] C. Wallacher and U. Zimmermann. “A Combinatorial Interior Point Method for Network Flow Problems”. In: Mathematical Programming 56.1-3 (Aug. 1992), pp. 321–335. DOI: 10.1007/BF01580905 (cit. on pp. 1, 3).
A AI Use
We used AI to spell and grammar check, get feedback on readability, polish individual sentences, generate the plots, and find related literature. We used agentic AI for coding and evaluation for some parts of the implementation. The proof in Appendix B was generated with AI; two authors independently verified it.
B Proof of Upper Bound
Setting. Fix a real number . For , let
so that and
Given , and , put ; note . Since a sum of terms with distinct is not itself of the form , the conditions and are imposed at the single point .
Theorem B.1 (Bernoulli's inequality, negative exponent). Let . Then for all , with equality if and only if .
Proof. Let for . Then and
Because , the map is strictly decreasing on , so is positive for and negative for . Since , we get on and on . Hence is strictly decreasing on and strictly increasing on , so with equality only at .
Theorem B.2. Let , , and . There exist unique , with
namely
For this choice,
and the inequality is strict for every unless (in which case ).
Proof. Write and
Step 1: the fit. Dividing by and by , the two conditions read
Dividing the first equation by the second gives , and then the first gives ; both are positive, and these values satisfy both equations. This proves existence, uniqueness and the stated formulas.
Step 2: rewriting and . Put . Then
so is the -weighted mean of . Fix and set
Then
and therefore, using and ,
Step 3: Jensen's inequality for . Let and . Then , and Theorem B.1 gives
Since all , equality holds if and only if , i.e. , i.e. or .
Step 4: conclusion. Multiplying the inequality of Step 3 by and using Step 2 yields
Since ,
If the are not all equal, the equality statement of Step 3 shows that the continuous integrand is strictly positive on , hence for . If , then and , so the fit returns and , and .
Remark B.3. The argument uses only the power rule on and Theorem B.1, both valid for arbitrary real exponents, so may be any positive real number.