NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Almost-linear-time algorithms for Markov chains and new spectral primitives for directed graphs

Michael B. Cohen, Jonathan A. Kelner, John Peebles, Richard Peng, Anup B. Rao, Aaron Sidford, Adrian Vladu

TL;DR

This paper presents the first "almost-linear-time" algorithm for solving directed Laplacian systems, a fundamental problem in graph theory. By developing new tools for directed graph sparsification and spectral approximation, the authors enable nearly optimal computation of Markov chain stationary distributions, commute times, and personalized PageRank vectors.

What Problem Does This Paper Address?

In the world of algorithm design, there has long been a frustrating "algorithmic gap" between undirected and directed graphs. For undirected graphs, we have had nearly-linear time solvers for Laplacian systems (the equations that describe things like electrical flow or heat diffusion) for over a decade. These solvers allow us to process massive graphs with millions of edges almost as fast as we can read the data.

However, directed graphs—where an edge from A to B doesn't imply one from B to A—are much harder. The matrices associated with them (directed Laplacians) are asymmetric and lack the "nice" geometric properties (like positive semidefiniteness) that undirected solvers rely on. Before this paper, the best algorithms for finding the stationary distribution of a directed Markov chain were significantly slower, often scaling poorly as the graph grew denser. This paper aims to bring directed graph algorithms into the "almost-linear time" club.

Methods

The authors bridge this gap by reinventing "spectral graph theory" for the directed case. Their approach relies on several key technical innovations:

  1. Eulerian Scaling: The authors show that any strongly connected directed graph can be "rebalanced" into an Eulerian graph (where every vertex's in-degree equals its out-degree) using diagonal scaling. Eulerian graphs are much easier to handle because their "symmetrized" versions preserve more of the original graph's structure.
  2. Directed Spectral Approximation: They introduce a novel definition for what it means for one directed graph to "approximate" another. Traditionally, this was thought to be impossible for directed graphs because removing even a single edge can infinitely change the "reachability" or "flow" in a directed system. Their definition uses the Eulerian scaling as a reference point.
  3. Directed Sparsification: Using their new approximation notion, they provide an algorithm to take a dense directed graph and produce a sparse version (one with far fewer edges) that behaves almost identically in terms of its spectral properties.
  4. Square-Sparsification Chain: To solve the linear system $Lx = b$, they use an iterative method inspired by the "Peng-Spielman" solver. They recursively approximate the square of the graph's adjacency matrix, sparsifying at each step to keep the computation efficient. They use a "recursive Richardson iteration" to prevent errors from blowing up during this process.

Datasets

As a theoretical computer science paper, this work does not use empirical datasets or benchmarks (like those found in machine learning). Instead, the "dataset" is the abstract class of all directed graphs. The results are proven mathematically to hold for any graph with $n$ vertices and $m$ edges, regardless of its specific structure.

Key Insights and Ideas

  • The Eulerian "Secret Sauce": The most profound insight is that Eulerian graphs are the natural directed analogue to undirected graphs. By reducing general directed problems to Eulerian ones, the authors can use the tools of symmetric linear algebra in an asymmetric world.
  • Sparsification is Possible: It was previously a "folk theorem" that directed graphs couldn't be sparsified effectively. This paper proves that if you use the right definition of approximation (one that respects the Eulerian structure), you can indeed represent a dense directed graph with very few edges.
  • Error Control: Solving asymmetric systems is notoriously unstable. The authors' use of a "chain" of sparsifiers combined with carefully timed iterative refinement (Richardson iteration) provides a blueprint for building stable, fast solvers for other asymmetric problems.

Key Results

  • Speedup: The algorithm solves directed Laplacian systems in $O(m + n^{1+o(1)})$ time. This is a massive improvement over the previous best of roughly $O(nm^{3/4})$.
  • Markov Chains: They provide the first almost-linear-time algorithm to compute the stationary distribution of a non-reversible Markov chain.
  • Broad Utility: The solver immediately yields faster algorithms for:
  • Computing expected commute times and hitting times in directed graphs.
  • Calculating escape probabilities.
  • Computing personalized PageRank vectors.

Limitations and Future Work

While a theoretical breakthrough, the "almost-linear" term $n^{1+o(1)}$ hides a factor that grows faster than any polylogarithm (specifically $n^{2^{O(\sqrt{\log n \log \log n})}}$). While technically much faster than previous polynomial bounds for large $n$, it may still be quite large for practical, real-world sized graphs.

The authors suggest that future work could focus on:

  • Reducing the $n^{o(1)}$ factor to a true polylogarithmic factor (making it "nearly-linear").
  • Designing even more robust "condition number" reduction techniques to handle graphs with extremely varied edge weights.
  • Exploring whether these directed spectral primitives can be used for other combinatorial problems like maximum flow or shortest paths in graphs with negative weights.

Summary updated

BibTeX
@inproceedings{cohen2017almost,
  author = {Michael B. Cohen and Jonathan A. Kelner and John Peebles and Richard Peng and Anup B. Rao and Aaron Sidford and Adrian Vladu},
  title = {{Almost-linear-time algorithms for Markov chains and new spectral primitives for directed graphs}},
  booktitle = {STOC},
  year = {2017},
  doi = {10.1145/3055399.3055463},
}
Figure