Lune

STOC2025Top-tier venue

All-Pairs Shortest Paths with Few Weights per Node

Amir Abboud, Nick Fischer, Ce Jin, Virginia Vassilevska Williams, Zoe Xi

Abstract

We study the central All-Pairs Shortest Paths (APSP) problem under the restriction that there are at most d distinct weights on the outgoing edges from every node. For d = n this is the classical (unrestricted) APSP problem that is hypothesized to require cubic time n 3-o(1) , and at the other extreme, for d = 1, it is equivalent to the Node-Weighted APSP problem. We present new algorithms that achieve the following results:

• Node-Weighted APSP can be solved in time O(n (3+ω)/2 ) = O(n 2.686 ), improving on the 15-yearold subcubic bounds O(n (9+ω)/4 ) = O(n 2.843 ) [Chan; STOC '07] and O(n 2.830 ) [Yuster; SODA '09].

This positively resolves the question of whether Node-Weighted APSP is an "intermediate" problem in the sense of having complexity n 2.5+o(1) if ω = 2, in which case it also matches an n 2.5-o(1) conditional lower bound.

• For up to d ≤ n 3-ω-ϵ distinct weights per node (where ϵ > 0), the problem can be solved in subcubic time O(n 3-f (ϵ) ) (where f (ϵ) > 0). In particular, assuming that ω = 2, we can tolerate any sublinear number of distinct weights per node d ≤ n 1-ϵ , whereas previous work [Yuster; SODA '09] could only handle d ≤ n 1/2-ϵ in subcubic time. This promotes our understanding of the APSP hypothesis showing that the hardest instances must exhaust a linear number of weights per node. With the current bounds on ω, we achieve a subcubic algorithm for d ≤ n 0.628 whereas previously a subcubic running time could only be achieved for d ≤ n 0.384 . Our result also applies to the All-Pairs Exact Triangle problem, thus generalizing a result of Chan and Lewenstein on "Clustered 3SUM" from arrays to matrices. Notably, our technique constitutes a rare application of additive combinatorics in graph algorithms.

We complement our positive results with simple hardness reductions even for undirected graphs. Interestingly, under fine-grained assumptions, the complexity in the undirected case jumps from Õ(n ω ) for d = 1 to n 2.5-o(1) for d ≥ 2.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Universe Reduction for APSP: Equivalence of Three Fine-Grained Hypotheses cites Truly Subcubic Min-Plus Product for Less Structured Matrices, with Applications
  • Universe Reduction for APSP: Equivalence of Three Fine-Grained Hypotheses cites More Asymmetry Yields Faster Matrix Multiplication
  • Universe Reduction for APSP: Equivalence of Three Fine-Grained Hypotheses cites Negative-Weight Single-Source Shortest Paths in Near-linear Time
  • Universe Reduction for APSP: Equivalence of Three Fine-Grained Hypotheses cites Faster min-plus product for monotone instances
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. Universe Reduction for APSP: Equivalence of Three Fine-Grained HypothesesNick FischerSTOC 2026 · 2 citations

Builds on14

  1. More Asymmetry Yields Faster Matrix MultiplicationJosh Alman, Ran Duan, Virginia Vassilevska Williams, Yinzhan Xu et al.SODA 2025 · 35 citations
  2. Negative-Weight Single-Source Shortest Paths in Near-linear TimeAaron Bernstein, Danupon Nanongkai, Christian Wulff-NilsenFOCS 2022 · 24 citations
  3. New Algorithms and Lower Bounds for All-Pairs Max-Flow in Undirected GraphsAmir Abboud, Robert Krauthgamer, Ohad TrabelsiSODA 2020 · 22 citations
  4. Truly Subcubic Min-Plus Product for Less Structured Matrices, with ApplicationsVirginia Vassilevska Williams, Yinzhan XuSODA 2020 · 19 citations
  5. Faster min-plus product for monotone instancesShucheng Chi, Ran Duan, Tianle Xie, Tianyi ZhangSTOC 2022 · 12 citations

Related papers

  1. Monochromatic Triangles, Triangle Listing and APSPVirginia Vassilevska Williams, Yinzhan XuFOCS 2020 · 15 citations
  2. Faster Approximate All Pairs Shortest PathsBarna Saha, Christopher YeSODA 2024 · 3 citations
  3. Fredman's Trick Meets Dominance Product: Fine-Grained Complexity of Unweighted APSP, 3SUM Counting, and MoreTimothy M. Chan, Virginia Vassilevska Williams, Yinzhan XuSTOC 2023 · 4 citations
  4. Approximation Algorithms and Hardness for n-Pairs Shortest Paths and All-Nodes Shortest CyclesMina Dalirrooyfard, Ce Jin, Virginia Vassilevska Williams, Nicole WeinFOCS 2022 · 3 citations
  5. Improved Additive Approximation Algorithms for APSPCe Jin, Yael Kirkpatrick, Michal Stawarz, Virginia Vassilevska WilliamsSODA 2026
Dusk over the sea between two cliffs drawn in fine vertical lines