English

$\tilde{O}$ptimal Algorithm for 2-Approximate All Pair Shortest Paths -- almost

Data Structures and Algorithms 2026-07-21 v1

Abstract

Given an undirected, unweighted graph GG, we aim to compute a 2-approximation of all-pairs shortest paths (APSP). This problem admits a natural lower bound of Ω(n2)\Omega(n^2) since the output size is Θ(n2)\Theta(n^2). A central goal in this area is to achieve a running time of O(n2)O(n^2). Dor, Halperin, and Zwick (FOCS 1996, SICOMP 2001) designed an algorithm with a running time of O~(n2)\tilde{O}(n^2) that guarantees a 2-approximation only for pairs at a distance of at least O(logn)O(\log n). Recently, Gupta (FOCS 2025) improved this bound, handling all pairs at a distance of at least O(loglogn)O(\log \log n). We nearly resolve this problem. We design a randomized algorithm that runs in O~(n2)\tilde{O}(n^2) time and, with high probability, guarantees a 2-approximation for all pairs at distance at least cc, where c0c \ge 0 is a constant. Unlike the above two results, which were purely combinatorial, our algorithm combines combinatorial techniques with fast matrix multiplication (FMM).

Cite

@article{arxiv.2607.18714,
  title  = {$\tilde{O}$ptimal Algorithm for 2-Approximate All Pair Shortest Paths -- almost},
  author = {Manoj Gupta and Mrigankashekhar Shandilya},
  journal= {arXiv preprint arXiv:2607.18714},
  year   = {2026}
}