English

Faster Algorithms for $(2k-1)$-Stretch Distance Oracles

Data Structures and Algorithms 2026-04-24 v2

Abstract

Let G=(V,E)G=(V, E) be an undirected nn-vertices mm-edges graph with non-negative edge weights. In this paper, we present three new algorithms for constructing a (2k1)(2k-1)-stretch distance oracle with O(n1+1k)O(n^{1+\frac{1}{k}}) space. The first algorithm runs in \Ot(max(n1+2/k,m11k1n2k1))\Ot(\max(n^{1+2/k}, m^{1-\frac{1}{k-1}}n^{\frac{2}{k-1}})) time, and improves upon the \Ot(min(mn1k,n2))\Ot(\min(mn^{\frac{1}{k}},n^2)) time of Thorup and Zwick [STOC 2001, JACM 2005] and Baswana and Kavitha [FOCS 2006, SICOMP 2010], for every k>2k > 2 and m=Ω(n1+1k+\eps)m=\Omega(n^{1+\frac{1}{k}+\eps}). This yields the first truly subquadratic time construction for every 2<k<62 < k < 6, and nearly resolves the open problem posed by Wulff-Nilsen [SODA 2012] on the existence of such constructions. The two other algorithms have a running time of the form \Ot(m+n1+f(k))\Ot(m+n^{1+f(k)}), which is near linear in mm if m=Ω(n1+f(k))m=\Omega(n^{1+f(k)}), and therefore optimal in such graphs. One algorithm runs in \Ot(m+n32+34k6)\Ot(m+n^{\frac32+\frac{3}{4k-6}})-time, which improves upon the \Ot(n2)\Ot(n^2)-time algorithm of Baswana and Kavitha [FOCS 2006, SICOMP 2010], for 3<k<63 < k < 6, and upon the \Ot(m+n32+2k+O(k2))\Ot(m+n^{\frac{3}{2}+\frac{2}{k}+O(k^{-2})})-time algorithm of Wulff-Nilsen [SODA 2012], for every k6k\geq 6. This is the first linear time algorithm for constructing a 77-stretch distance oracle and a 99-stretch distance oracle, for graphs with truly subquadratic density.\footnote{with m=n2\epsm=n^{2-\eps} for some \eps>0\eps > 0.} The other algorithm runs in \Ot(km+kn1+22k)\Ot(\sqrt{k}m+kn^{1+\frac{2\sqrt{2}}{\sqrt{k}}}) time, (and hence relevant only for k16k\ge 16), and improves upon the \Ot(km+kn1+26k+O(k1))\Ot(\sqrt{k}m+kn^{1+\frac{2\sqrt{6}}{\sqrt{k}}+O(k^{-1})}) time algorithm of Wulff-Nilsen [SODA 2012] (which is relevant only for k96k\ge 96). ...

Keywords

Cite

@article{arxiv.2507.06721,
  title  = {Faster Algorithms for $(2k-1)$-Stretch Distance Oracles},
  author = {Avi Kadria and Liam Roditty},
  journal= {arXiv preprint arXiv:2507.06721},
  year   = {2026}
}
R2 v1 2026-07-01T03:52:58.305Z