Generalized Flow in Nearly-linear Time on Moderately Dense Graphs

Shunhua Jiang, Michael Kapralov, Lawrence Li, Aaron Sidford

Abstract

Recent breakthroughs in algorithmic graph theory have brought standard network flow problems into the realm of almost-linear time complexity. However, generalized flow—where edges can multiply or diminish the flow passing through them—has historically remained significantly more computationally expensive. This paper introduces a randomized algorithm that solves the generalized flow problem in $\tilde{O}(m + n^{1.5})$ time. By extending spectral graph theory to "lossy" graphs and leveraging modern Interior Point Methods (IPM), the authors achieve nearly-linear time performance for moderately dense graphs ($m \ge n^{1.5}$), effectively bridging a long-standing efficiency gap in combinatorial optimization.

1. Introduction

In a standard network flow problem, the conservation of flow is absolute: what enters an edge must exit it. In many real-world applications—ranging from financial modeling (currency exchange with transaction fees) to power grid analysis (line losses)—this assumption does not hold. These scenarios are modeled as generalized flow problems, where each edge $e$ is assigned a gain factor $\gamma_e > 0$. If $f_e$ units of flow enter an edge, $\gamma_e f_e$ units arrive at the destination.

While standard max-flow algorithms have recently reached the "golden age" of $O(m^{1+o(1)})$ complexity, generalized flow has lagged behind. The previous state-of-the-art complexity was approximately $\tilde{O}(m\sqrt{n})$, which becomes prohibitively slow as graph density increases. The primary bottleneck is that the matrices associated with generalized flows lack the convenient Laplacian structure that enables fast solvers in standard graph problems.

2. The Two-Sparse LP Framework

The authors approach generalized flow by treating it as a specific instance of a two-sparse Linear Program (LP). A two-sparse LP is a linear optimization problem where each constraint involves at most two variables. This generalization is significant because it suggests that the techniques developed here may apply to a broader class of optimization problems beyond network flow.

To solve this LP, the algorithm employs a modern Interior Point Method (IPM). The efficiency of an IPM depends on the ability to maintain and update the solution to a sequence of linear systems as the "weights" of the edges change during optimization. The authors identify three critical data structures required to make this process efficient:

  1. Heavy Hitters: To identify edges experiencing significant flow or pressure changes.
  2. Sampler: To randomly select edges proportional to their impact on the system.
  3. Inverse Maintenance: To efficiently update the inverse of the system's matrix as edge weights evolve.

3. Spectral Theory for Lossy Graphs

The core theoretical innovation of this paper is the development of Spectral Graph Theory for Lossy Graphs. In standard spectral theory, the Laplacian matrix provides a powerful tool for understanding graph connectivity and flow. Generalized flow, however, results in matrices that do not behave like standard Laplacians.

The authors introduce the concept of a Lossy Laplacian. They prove that if a lossy graph is "balanced" (meaning the losses/gains are relatively small) and its underlying structure is an expander, it mimics the behavior of a standard graph. Specifically, they demonstrate that the smallest eigenvector of a balanced lossy expander is nearly uniform (close to the all-ones vector).

To handle arbitrary graphs, the authors utilize expander decomposition. This technique breaks a general lossy graph into a collection of well-behaved "balanced lossy expanders." This decomposition allows the use of fast spectral tools—previously reserved for standard graphs—to approximate the behavior of the lossy system. They show that a vector with a sufficiently low Rayleigh quotient can provide a spectral approximation robust enough for the IPM to converge rapidly.

4. Results and Complexity

The resulting algorithm achieves a running time of $\tilde{O}((m + n^{1.5}) \cdot \text{polylog}(W/\delta))$, where $W$ represents the maximum magnitude of costs and capacities.

Key Performance Metrics:

  • Dense Graph Efficiency: For graphs where $m \ge n^{1.5}$, the $m$ term dominates, resulting in nearly-linear time complexity.
  • Comparative Speedup: Compared to the previous $\tilde{O}(m\sqrt{n})$ bound, the improvement is substantial. For a graph with $n$ nodes and $m = n^{1.8}$ edges, the new algorithm is approximately $n^{0.3}$ times faster.

5. Limitations and Future Directions

Despite the breakthrough for dense graphs, a "density gap" remains. For sparse graphs where $m \approx n$, the $n^{1.5}$ term dominates the complexity, meaning the algorithm is not yet as efficient as the best solvers for standard max-flow. Additionally, the runtime is "weakly polynomial," as it depends on the logarithm of the numerical values of capacities and costs ($W$).

The authors suggest that the ultimate goal for future research is to achieve "almost-linear" time $m^{1+o(1)}$ for all graph densities, which would finally place generalized flow on the same computational footing as standard network flow problems.

Summary updated

BibTeX
@inproceedings{jiang2025generalized,
  author = {Shunhua Jiang and Michael Kapralov and Lawrence Li and Aaron Sidford},
  title = {{Generalized Flow in Nearly-linear Time on Moderately Dense Graphs}},
  booktitle = {FOCS},
  year = {2025},
  doi = {10.1109/focs63196.2025.00057},
}
Figure