English

All-Pairs Shortest Paths with Few Weights per Node

Data Structures and Algorithms 2025-06-26 v1

Abstract

We study the central All-Pairs Shortest Paths (APSP) problem under the restriction that there are at most dd distinct weights on the outgoing edges from every node. For d=nd=n this is the classical (unrestricted) APSP problem that is hypothesized to require cubic time n3o(1)n^{3-o(1)}, and at the other extreme, for d=1d=1, it is equivalent to the Node-Weighted APSP problem. We present new algorithms that achieve the following results: 1. Node-Weighted APSP can be solved in time O~(n(3+ω)/2)=O~(n2.686)\tilde{O}(n^{(3+\omega)/2}) = \tilde{O}(n^{2.686}), improving on the 15-year-old subcubic bounds O~(n(9+ω)/4)=O~(n2.843)\tilde{O}(n^{(9+\omega)/4}) = \tilde{O}(n^{2.843}) [Chan; STOC '07] and O~(n2.830)\tilde{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 n2.5+o(1)n^{2.5+o(1)} if ω=2\omega=2, in which case it also matches an n2.5o(1)n^{2.5-o(1)} conditional lower bound. 2. For up to dn3ωϵd \leq n^{3-\omega-\epsilon} distinct weights per node (where ϵ>0\epsilon > 0), the problem can be solved in subcubic time O(n3f(ϵ))O(n^{3-f(\epsilon)}) (where f(ϵ)>0f(\epsilon) > 0). In particular, assuming that ω=2\omega = 2, we can tolerate any sublinear number of distinct weights per node dn1ϵd \leq n^{1-\epsilon}, whereas previous work [Yuster; SODA '09] could only handle dn1/2ϵd \leq n^{1/2-\epsilon} 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. 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.

Keywords

Cite

@article{arxiv.2506.20017,
  title  = {All-Pairs Shortest Paths with Few Weights per Node},
  author = {Amir Abboud and Nick Fischer and Ce Jin and Virginia Vassilevska Williams and Zoe Xi},
  journal= {arXiv preprint arXiv:2506.20017},
  year   = {2025}
}

Comments

Appears at STOC '25. Abstract shortened to meet arXiv requirements

R2 v1 2026-07-01T03:32:20.212Z