English

Fast 2-Approximate All-Pairs Shortest Paths

Data Structures and Algorithms 2023-10-31 v2

Abstract

In this paper, we revisit the classic approximate All-Pairs Shortest Paths (APSP) problem in undirected graphs. For unweighted graphs, we provide an algorithm for 22-approximate APSP in O~(n2.5r+nω(r))\tilde O(n^{2.5-r}+n^{\omega(r)}) time, for any r[0,1]r\in[0,1]. This is O(n2.032)O(n^{2.032}) time, using known bounds for rectangular matrix multiplication nω(r)n^{\omega(r)} [Le Gall, Urrutia, SODA 2018]. Our result improves on the O~(n2.25)\tilde{O}(n^{2.25}) bound of [Roditty, STOC 2023], and on the O~(mn+n2)\tilde{O}(m\sqrt n+n^2) bound of [Baswana, Kavitha, SICOMP 2010] for graphs with mn1.532m\geq n^{1.532} edges. For weighted graphs, we obtain (2+ϵ)(2+\epsilon)-approximate APSP in O~(n3r+nω(r))\tilde O(n^{3-r}+n^{\omega(r)}) time, for any r[0,1]r\in [0,1]. This is O(n2.214)O(n^{2.214}) time using known bounds for ω(r)\omega(r). It improves on the state of the art bound of O(n2.25)O(n^{2.25}) by [Kavitha, Algorithmica 2012]. Our techniques further lead to improved bounds in a wide range of density for weighted graphs. In particular, for the sparse regime we construct a distance oracle in O~(mn2/3)\tilde O(mn^{2/3}) time that supports 22-approximate queries in constant time. For sparse graphs, the preprocessing time of the algorithm matches conditional lower bounds [Patrascu, Roditty, Thorup, FOCS 2012; Abboud, Bringmann, Fischer, STOC 2023]. To the best of our knowledge, this is the first 2-approximate distance oracle that has subquadratic preprocessing time in sparse graphs. We also obtain new bounds in the near additive regime for unweighted graphs. We give faster algorithms for (1+ϵ,k)(1+\epsilon,k)-approximate APSP, for k=2,4,6,8k=2,4,6,8. We obtain these results by incorporating fast rectangular matrix multiplications into various combinatorial algorithms that carefully balance out distance computation on layers of sparse graphs preserving certain distance information.

Keywords

Cite

@article{arxiv.2307.09258,
  title  = {Fast 2-Approximate All-Pairs Shortest Paths},
  author = {Michal Dory and Sebastian Forster and Yael Kirkpatrick and Yasamin Nazari and Virginia Vassilevska Williams and Tijn de Vos},
  journal= {arXiv preprint arXiv:2307.09258},
  year   = {2023}
}

Comments

Accepted to SODA '24

R2 v1 2026-06-28T11:33:34.983Z