arXiv:2611.01297cs.DSOct 2026

Manuscript Offprint

arXiv:2611.01297

Reading between the levels: new tools for the Thorup-Zwick hierarchy and their applications

Shiri Chechik, Gur Lifshitz, Avi Kadria, Liam Roditty

Abstract

In this paper, we develop three new analytical tools for the Thorup-Zwick hierarchy: the Mixed-Level Growth, Two-Level Growth, and Long-Short Growth lemmas. Using these tools, we obtain improved approximate distance oracles (ADOs), and algorithms for nn-pairs shortest paths (nn-PSP), multiple-source shortest paths (MSSP), and STST-shortest paths, as well as new hopsets.

One of our main results is a (65k+O(1))(\frac{6}{5}k + O(1))-stretch ADO with O~(mn1/k)\tilde{O}(mn^{1/k}) preprocessing time and space (where O~\tilde{O} hides polylogarithmic factors), and O~(n1/k)\tilde{O}(n^{1/k}) query time, breaking, for sparse graphs, the (2k−O(1))(2k - O(1))-stretch barrier for ADOs with O~(n1+1/k)\tilde{O}(n^{1+1/k}) space and O~(n1/k)\tilde{O}(n^{1/k}) query time. In unweighted graphs, we also obtain a (65k+O(1),O(k))(\frac{6}{5}k + O(1), O(k))-approximate ADO with O~(n1+1/k)\tilde{O}(n^{1+1/k}) space and O~(n1/k)\tilde{O}(n^{1/k}) query time.

This also yields a (65k+O(1))(\frac{6}{5}k + O(1))-approximation algorithm for mm-pairs shortest paths (mm-PSP) in O~(mn1/k)\tilde{O}(mn^{1/k}) time, answering the question of Chechik, Hoch, and Lifshitz [SODA'25] of whether the 2k−O(1)2k-O(1) barrier for nn-PSP in O~(mn1/k)\tilde{O}(mn^{1/k}) time can be broken.

For unweighted graphs, we give a new analysis of the existing O~(mn1/k+n1+2/k)\tilde{O}(mn^{1/k} + n^{1+2/k})-time nn-PSP algorithm of [Chechik et al., SODA'25], and show that, without any modification, it is a (k,k−1)(k, k-1)-approximation, i.e., d(u,v)≤d~(u,v)≤k⋅d(u,v)+k−1d(u, v) \leq \tilde{d}(u, v) \leq k \cdot d(u, v) + k - 1 for every queried pair. This improves its multiplicative factor from 43k+O(1)\frac{4}{3}k + O(1) to kk, and the leading coefficient kk is tight for this algorithm. Moreover, for graphs with m=Ω(n1+1/k)m = \Omega(n^{1+1/k}), this answers the question of Dalirrooyfard et al. [FOCS'22] up to the additive k−1k-1.

*Department of Computer Science, Tel Aviv University, Israel. E-mail shiri.chechik@gmail.com. †Department of Computer Science, Tel Aviv University, Israel. E-mail gur.lifshitz@gmail.com. ‡Department of Computer Science, Bar-Ilan University, Ramat Gan 5290002, Israel. E-mail avi.kadria3@gmail.com. §Department of Computer Science, Bar-Ilan University, Ramat Gan 5290002, Israel. E-mail liam.roditty@biu.ac.il. Supported in part by BSF grants 2016365 and 2020356.

1 Introduction

In their seminal work, Thorup and Zwick [TZ05] introduced an approximate distance oracle (ADO) based on a hierarchical graph decomposition. Let G=(V,E)G = (V, E) be an undirected graph with nn vertices and mm edges. An ADO is a data structure that, given a pair of vertices u,v∈Vu, v \in V, returns an estimate d^(u,v)\hat{d}(u, v) of the distance d(u,v)d(u, v) between them. An ADO has stretch α\alpha if d(u,v)≤d^(u,v)≤αd(u,v)d(u, v) \leq \hat{d}(u, v) \leq \alpha d(u, v) for every pair of vertices u,v∈Vu, v \in V, and it is an (α,β)(\alpha, \beta)-approximation if d(u,v)≤d^(u,v)≤αd(u,v)+βd(u, v) \leq \hat{d}(u, v) \leq \alpha d(u, v) + \beta. For every integer k≥1k \geq 1, the Thorup-Zwick ADO has stretch 2k−12k - 1, uses O~(n1+1/k)\tilde{O}(n^{1+1/k}) space, answers queries in O(k)O(k) time, and is constructed in O~(mn1/k)\tilde{O}(mn^{1/k}) time. 1^{1}

The Thorup–Zwick hierarchy and related techniques have found applications in many graph algorithms and data structures, including ADOs [RTZ05, Wul12, Wul13, Che14, Che15, ENW16, KR25b, KR26a, CZ22], girth and shortest-cycle approximation [KRS+22, HJWX24, KRS+26, KRV26b, Kad26], diameter approximation [CGR16, KRQV26], spanners and emulators [TZ06, BS07, Pet09, HJWX24], APSP approximations [Elk05, BK10, AR20, CZ22, Rod23, DFK+24, AR21, RS25], compact routing [TZ01, Che13, KR25a], distance labeling [AG11, DSDP15, EFN18], and hopsets [HP19, BP20, EN22, NS22].

Our main contributions are three new analytical tools for the Thorup-Zwick hierarchy: the Mixed-Level Growth, Two-Level Growth, and Long-Short Growth lemmas. Using these tools, we obtain new algorithms for a variety of fundamental distance problems, improving upon the state of the art for each of them. We outline the main ideas behind these tools in Section 3.

Next, we describe our contributions for each problem and compare them with previous work. Throughout the paper, k denotes a positive integer parameter. All of these results are direct applications of the new tools, and we believe that the tools can be used to improve algorithms for other graph problems as well.

ADOs with nonconstant query time. To improve upon the (2k−1)(2k-1)-stretch of the Thorup-Zwick ADO in weighted graphs, a common approach is to allow a larger query time and to focus on sparse graphs. 2^{2} ADOs with nonconstant query time have been studied in both weighted and unweighted graphs [AGH11, PR13, AGH12, AG13, PR14, Aga14, DJWW22, KR25b].

We first discuss weighted graphs. Agarwal, Godfrey, and Har-Peled [AGH11] were the first to study this regime. They obtained a (2k−3)(2k-3)-stretch ADO with O(m+n1+1/k)O(m+n^{1+1/k}) space and O(mnn1/k)O(\frac{m}{n}n^{1/k}) query time, constructed in O~(mn2/k)\tilde{O}(mn^{2/k}) time. Later, Kadria and Roditty [KR25b] improved the stretch to 2k-5 with the same space and query time, at the cost of an increased construction time of O~(mn3/k)\tilde{O}(mn^{3/k}). These results left open whether the 2k-O(1) stretch barrier could be broken:

Question 1. Is there an ADO for sparse weighted graphs (with m=O(n)m = O(n)) that uses O~(n1+1/k)\tilde{O}(n^{1+1/k}) space and O~(n1/k)\tilde{O}(n^{1/k}) query time, and has stretch (2−α)k(2 - \alpha)k for some constant α>0\alpha > 0?

The 2k−O(1)2k-O(1) barrier has a common source. In the Thorup-Zwick query, every level at which the search fails to connect uu and vv allows the pivot distance to grow by up to d(u,v)d(u,v). The estimate therefore grows by 2d(u,v)2d(u,v) per level, which gives stretch 2k−12k-1 after kk levels. All previous ADOs with O~(n1/k)\tilde{O}(n^{1/k}) query time, as well as all previous O~(mn1/k)\tilde{O}(mn^{1/k})-time nn-PSP algorithms, improve this analysis only at the first one or two levels. At every other level, they still pay the full 2d(u,v)2d(u,v) of Thorup and Zwick [TZ05]. Hence, their savings are additive, and their stretch remains 2k−O(1)2k-O(1). Our tools limit the growth of the pivot distances at every level of the hierarchy. The savings thus accumulate over all kk levels, which reduces the leading coefficient of the stretch and breaks the 2k−O(1)2k-O(1) barrier.

We answer Question 1 in the affirmative and break the 2k−O(1)2k-O(1) stretch barrier by obtaining a (65k+O(1))\left(\frac{6}{5}k+O(1)\right)-stretch ADO with O~(n1/k)\tilde{O}(n^{1/k}) query time, and O~(mn1/k)\tilde{O}(mn^{1/k}) space and preprocessing time.

Theorem 1 (ADO-weighted). There is an O~(mn1/k)\tilde{O}(mn^{1/k})-time algorithm that constructs a (65k+7)\left(\frac{6}{5}k+7\right)-stretch ADO for weighted undirected graphs, with O~(mn1/k)\tilde{O}(mn^{1/k}) space and O~(n1/k)\tilde{O}(n^{1/k}) query time.

1^{1}The O~(⋅)\tilde{O}(\cdot) notation suppresses polylogarithmic factors in nn. Since n1/k=O(1)n^{1/k}=O(1) for k≥log⁡nk\geq\log n, we assume that k≤log⁡nk\leq\log n, so O~(⋅)\tilde{O}(\cdot) also suppresses factors polynomial in kk.

2^{2}Assuming the Erdős girth conjecture, the lower bound of Thorup and Zwick [TZ05] rules out stretch below 2k−12k-1 with O(n1+1/k)O(n^{1+1/k}) space in general graphs, regardless of query time.

GraphsReferencePreprocessingSpaceQueryApproximation
Weighted[TZ05]O~(mn1/k)\tilde{O}(mn^{1/k})O~(n1+1/k)\tilde{O}(n^{1+1/k})O(k)O(k)2k−12k-1
[DJWW22]O~(mn1/k)\tilde{O}(mn^{1/k})O~(m+n1+1/k)\tilde{O}(m+n^{1+1/k})O(mnn1/k)O(\frac{m}{n}n^{1/k})2k−22k-2
[AGH11]O~(mn2/k)\tilde{O}(mn^{2/k})O(m+n1+1/k)O(m+n^{1+1/k})O(mnn1/k)O(\frac{m}{n}n^{1/k})2k−32k-3
[KR25b]O~(mn3/k)\tilde{O}(mn^{3/k})O(m+n1+1/k)O(m+n^{1+1/k})O(mnn1/k)O(\frac{m}{n}n^{1/k})2k−52k-5
Theorem 1O~(mn1/k)\tilde{O}(mn^{1/k})O~(mn1/k)\tilde{O}(mn^{1/k})O~(n1/k)\tilde{O}(n^{1/k})65k+7\frac{6}{5}k+7
Unweighted[TZ05]O~(mn1/k)\tilde{O}(mn^{1/k})O~(n1+1/k)\tilde{O}(n^{1+1/k})O(k)O(k)2k−12k-1
[DJWW22]O~(mn1/k)\tilde{O}(mn^{1/k})O~(n1+1/k)\tilde{O}(n^{1+1/k})O(n1/k)O(n^{1/k})(2k−2,1)(2k-2,1)
[AGH11]O~(mn2/k)\tilde{O}(mn^{2/k})O~(n1+1/k)\tilde{O}(n^{1+1/k})O(n1/k)O(n^{1/k})(2k−3,O(1))(2k-3,O(1))
[KR25b]O~(mn3/k)\tilde{O}(mn^{3/k})O~(n1+1/k)\tilde{O}(n^{1+1/k})O(n1/k)O(n^{1/k})(2k−5,6)(2k-5,6)
Theorem 2O~(mn1/k)\tilde{O}(mn^{1/k})O~(n1+1/k)\tilde{O}(n^{1+1/k})O~(n1/k)\tilde{O}(n^{1/k})(65k+O(1),O(k))(\frac{6}{5}k+O(1),O(k))

Table 1: ADOs with nonconstant query time.

In unweighted graphs, allowing an additive error removes the dependence on mm from the space and query time. Here, the state of the art is the (2k−5,6)(2k-5,6)-approximate ADO of Kadria and Roditty [KR25b], with O~(n1+1/k)\tilde{O}(n^{1+1/k}) space, O(n1/k)O(n^{1/k}) query time, and O~(mn3/k)\tilde{O}(mn^{3/k}) preprocessing time. The main question is whether the 2k−O(1)2k-O(1) barrier can be broken:

Question 2. Is there an ADO for unweighted graphs that uses O~(n1+1/k)\tilde{O}(n^{1+1/k}) space and O~(n1/k)\tilde{O}(n^{1/k}) query time, and is a ((2−α)k,O(k))((2-\alpha)k,O(k))-approximation for some constant α>0\alpha>0?

Using our new tools, we answer Question 2 in the affirmative: we obtain a (65k+O(1),O(k))(\frac{6}{5}k+O(1),O(k))-approximate ADO with O~(n1/k)\tilde{O}(n^{1/k}) query time, O~(n1+1/k)\tilde{O}(n^{1+1/k}) space, and O~(mn1/k)\tilde{O}(mn^{1/k}) preprocessing time.

Corollary 2 (ADO-unweighted). There is an O~(mn1/k)\tilde{O}(mn^{1/k})-time algorithm that constructs a (65k+O(1),O(k))(\frac{6}{5}k+O(1),O(k))-approximate ADO for unweighted undirected graphs, with O~(n1+1/k)\tilde{O}(n^{1+1/k}) space and O~(n1/k)\tilde{O}(n^{1/k}) query time.

Table 1 compares our ADOs with the previous ADOs with nonconstant query time.

The tt-PSP, nn-PSP, and mm-PSP problems. The tt-pairs shortest paths problem (tt-PSP) generalizes APSP by asking only for the distances between a prescribed set of tt pairs, instead of all n2n^2 pairs. Specifically, given a set I⊆V×VI \subseteq V \times V of tt pairs, the goal is to compute an estimate d~(u,v)\tilde{d}(u,v) for every (u,v)∈I(u,v) \in I. The tt-PSP problem has been studied since the 1990s by Cohen [Coh98] and by Aingworth, Chekuri, Indyk, and Motwani [ACIM99], and has received renewed attention in recent years [DJWW22, CHL25, KRV26a]. This line of research has focused primarily on the case t=nt=n, which we denote by nn-PSP. We write mm-PSP for the case t=mt=m.

We first discuss nn-PSP algorithms running in O~(mn1/k)\tilde{O}(mn^{1/k}) time, and then those with an additional n1+2/kn^{1+2/k} term in the running time.

Running time O~(mn1/k)\tilde{O}(mn^{1/k}). For unweighted graphs, Dalirrooyfard, Jin, Vassilevska Williams, and Wein [DJWW22] obtained a (2k−2,1)(2k-2,1)-approximation for nn-PSP in O~(mn1/k)\tilde{O}(mn^{1/k}) time. Chechik, Hoch, and Lifshitz [CHL25] later obtained a purely multiplicative (2k−3)(2k-3)-approximation in the same running time, for k≥3k\geq 3, in both unweighted and weighted graphs. The main open problem in this regime is whether the 2k−O(1)2k-O(1) barrier can be broken:

Question 3. Is there a (2−α)k(2-\alpha)k-approximation algorithm for nn-PSP in unweighted graphs that runs in O~(mn1/k)\tilde{O}(mn^{1/k}) time, for some constant α>0\alpha>0? Is there such an algorithm for weighted graphs?

We answer both parts of Question 3 in the affirmative. We present a (65k+O(1))(\frac{6}{5}k+O(1))-approximation algorithm that runs in O~(mn1/k)\tilde{O}(mn^{1/k}) time on weighted graphs, and hence also on unweighted graphs. Moreover, it handles mm pairs instead of nn.

GraphsReference#PairsRunning timeApproximation
Weighted[TZ05]tO~(mn1/k+t)\tilde{O}(mn^{1/k} + t)2k−12k - 1
[CHL25]nO~(mn1/k)\tilde{O}(mn^{1/k})2k−32k - 3
[KRV26a]nO~(mn1/k+n1+2/k)\tilde{O}(mn^{1/k} + n^{1+2/k})1.622k1.622k
Theorem 3mO~(mn1/k)\tilde{O}(mn^{1/k})65k+7\frac{6}{5}k + 7
Unweighted[DJWW22]nO~(mn1/k)\tilde{O}(mn^{1/k})(2k−2,1)(2k - 2, 1)
[CHL25]nO~(mn1/k)\tilde{O}(mn^{1/k})2k−32k - 3
[CHL25]nO~(mn1/k+n1+2/k)\tilde{O}(mn^{1/k} + n^{1+2/k})(⌈4k/3⌉−1,⌈4k/3⌉−1)(\lceil 4k/3 \rceil - 1, \lceil 4k/3 \rceil - 1)
[KRV26a]nO~(mn1/k+n1+2/k)\tilde{O}(mn^{1/k} + n^{1+2/k})⌈4k/3−5/3⌉\lceil 4k/3 - 5/3 \rceil
Theorem 4nO~(mn1/k+n1+2/k)\tilde{O}(mn^{1/k} + n^{1+2/k})(k,k−1)(k, k - 1)
Theorem 3mO~(mn1/k)\tilde{O}(mn^{1/k})65k+7\frac{6}{5}k + 7

Table 2: n-PSP and m-PSP algorithms.

Theorem 3 (m-PSP-weighted). There is an O~(mn1/k)\tilde{O}(mn^{1/k})-time (65k+7)(\frac{6}{5}k+7)-approximation algorithm for m-PSP in weighted undirected graphs.

Running time O~(mn1/k+n1+2/k)\tilde{O}(mn^{1/k} + n^{1+2/k}). With an additional n1+2/kn^{1+2/k} term in the running time, better leading coefficients were known. In unweighted graphs, Chechik, Hoch, and Lifshitz [CHL25] obtained a (⌈4k/3⌉−1,⌈4k/3⌉−1)(\lceil 4k/3 \rceil - 1, \lceil 4k/3 \rceil - 1)-approximation, and Kadria, Roditty, and Vassilevska Williams [KRV26a] improved it to a purely multiplicative ⌈4k/3−5/3⌉\lceil 4k/3 - 5/3 \rceil-approximation, for k≥4k \geq 4. Both results analyze the same algorithm, which connects uu and vv through the middle vertex of their shortest path (see Section 3). In weighted graphs, Kadria, Roditty, and Vassilevska Williams [KRV26a] obtained a 1.622k1.622k-approximation. Theorem 3 already improves upon this result. It has a smaller leading coefficient, it runs in O(mn1/k)O(mn^{1/k}) time, and it handles mm pairs instead of nn. The main open problem in this regime is whether this running time suffices for stretch kk:

Question 4. Is there a multiplicative kk-approximation algorithm for nn-PSP that runs in O~(mn1/k+n1+2/k)\tilde{O}(mn^{1/k} + n^{1+2/k}) time?

In unweighted graphs, we answer Question 4 in the affirmative. Using our new analytical tools, we show that the algorithm of [KRV26a] is a (k,k−1)(k, k-1)-approximation algorithm for nn-PSP. This improves the leading coefficient from 43k\frac{4}{3}k to exactly kk with the same running time. Moreover, the leading coefficient kk is tight for this algorithm (see Section 4).

Theorem 4 (n-PSP-unweighted). There is an O~(mn1/k+n1+2/k)\tilde{O}(mn^{1/k} + n^{1+2/k})-time (k,k−1)(k, k-1)-approximation algorithm for n-PSP in unweighted undirected graphs.

When m=Ω(n1+1/k)m = \Omega(n^{1+1/k}), the running time of Theorem 4 is O~(mn1/k)\tilde{O}(mn^{1/k}). Hence, for such graphs, Theorem 4 also answers, up to the same additive k−1k-1, the question of Dalirrooyfard, Jin, Vassilevska Williams, and Wein [DJWW22], who asked whether a kk-approximation for nn-PSP is possible in O~(mn1/k)\tilde{O}(mn^{1/k}) time.

Table 2 summarizes our nn-PSP and mm-PSP results and compares them with previous algorithms.

(t,s)(t, s)-PSP: ST-shortest paths and MSSP. Two extensively studied problems that are closely related to tt-PSP (see, e.g., [Kle05, CC07, CCE13, EK13, DHZ00, Elk05, DJWW22]) are multiple-source shortest paths (MSSP) and ST-shortest paths (STST-SP). Given a set S⊆VS \subseteq V, MSSP asks to estimate d(u,v)d(u, v) for every (u,v)∈S×V(u, v) \in S \times V. Given two sets S,T⊆VS, T \subseteq V, ST-SP asks to estimate d(u,v)d(u, v) for every (u,v)∈S×T(u, v) \in S \times T. All of these problems are special cases of a single source-sensitive problem, which we call (t,s)(t, s)-PSP.

Definition 5 ((t, s)-PSP). The input is a set II of tt prescribed pairs such that there exists a set A⊆VA \subseteq V of ss sources that hits every pair, that is, A∩{u,v}≠∅A \cap \{u, v\} \neq \emptyset for every ⟨u,v⟩∈I\langle u, v \rangle \in I. The goal is to compute an estimate

GraphsProblemReferenceRunning timeApproximation
Weighted(t, s)-PSP[RTZ05]O~(ms1/k+t)\tilde{O}(ms^{1/k} + t)2k−12k - 1
Theorem 6O~(ms1/k+t⋅s1/k)\tilde{O}(ms^{1/k} + t \cdot s^{1/k})65k+11\frac{6}{5}k + 11
MSSP[RTZ05]O~(ms1/k+ns)\tilde{O}(ms^{1/k} + ns)2k−12k - 1
Theorem 10O~(ms1/k+ns⋅s1/k)\tilde{O}(ms^{1/k} + ns \cdot s^{1/k})65k+11\frac{6}{5}k + 11
Unweighted(t, s)-PSP[RTZ05]O~(ms1/k+t)\tilde{O}(ms^{1/k} + t)2k−12k - 1
Theorem 7O~(ms1/k+ns2/k+t⋅s2/k)\tilde{O}(ms^{1/k} + ns^{2/k} + t \cdot s^{2/k})(k+2,k−1)(k+2, k-1)
MSSP[RTZ05]O~(ms1/k+ns)\tilde{O}(ms^{1/k} + ns)2k−12k - 1
Theorem 11O~(ms1/k+ns⋅s2/k)\tilde{O}(ms^{1/k} + ns \cdot s^{2/k})(k+2,k−1)(k+2, k-1)

Table 3: (t,s)(t,s)-PSP and MSSP algorithms. Here, ss is the number of sources (for MSSP, s=∣S∣s = |S|).

d^(u,v)\hat{d}(u,v) for every ⟨u,v⟩∈I\langle u,v \rangle \in I.³

For example, nn-PSP is (n,n)(n,n)-PSP, mm-PSP is (m,n)(m,n)-PSP, and tt-PSP is (t,min⁡{t,n})(t,\min\{t,n\})-PSP. Similarly, STST-SP is (∣S∣⋅∣T∣,min⁡{∣S∣,∣T∣})(|S| \cdot |T|, \min\{|S|, |T|\})-PSP, and MSSP is (n⋅∣S∣,∣S∣)(n \cdot |S|, |S|)-PSP.

Using our new tools and ideas from the parameterized distance oracles of [KR26a, RTZ05], we obtain the following result for (t,s)(t,s)-PSP in weighted graphs:

Theorem 6 ((t,s)-PSP-weighted). There is an O~((m+t)s1/k)\tilde{O}((m+t)s^{1/k})-time (65k+11)(\frac{6}{5}k+11)-approximation algorithm for (t,s)(t,s)-PSP in weighted undirected graphs.

Thus, the n1/kn^{1/k} factor in the running time of Theorem 3 is replaced by s1/ks^{1/k}: the cost is governed by the number of sources ss, rather than by the number of vertices nn.⁴

For unweighted graphs, we obtain:

Theorem 7 ((t,s)-PSP-unweighted). There is an O~(ms1/k+(n+t)s2/k)\tilde{O}(ms^{1/k} + (n+t)s^{2/k})-time (k+2,k−1)(k+2, k-1)-approximation algorithm for (t,s)(t,s)-PSP in unweighted undirected graphs.

As immediate corollaries, we obtain algorithms for STST-SP and MSSP. Let σ=min⁡{∣S∣,∣T∣}\sigma = \min\{|S|, |T|\}. For STST-SP, we substitute s=σs = \sigma and t=∣S∣⋅∣T∣t = |S| \cdot |T|:

Corollary 8 (STST-SP-weighted). There is an O~((m+∣S∣⋅∣T∣)σ1/k)\tilde{O}((m+|S| \cdot |T|)\sigma^{1/k})-time (65k+11)(\frac{6}{5}k+11)-approximation algorithm for STST-SP in weighted undirected graphs.

Corollary 9 (STST-SP-unweighted). There is an O~(mσ1/k+(n+∣S∣⋅∣T∣)σ2/k)\tilde{O}(m\sigma^{1/k} + (n+|S| \cdot |T|)\sigma^{2/k})-time (k+2,k−1)(k+2, k-1)-approximation algorithm for STST-SP in unweighted undirected graphs.

For MSSP, we substitute s=∣S∣s = |S| and t=n∣S∣t = n|S|:

Corollary 10 (MSSP-weighted). There is an O~((m+n∣S∣)∣S∣1/k)\tilde{O}((m+n|S|)|S|^{1/k})-time (65k+11)(\frac{6}{5}k+11)-approximation algorithm for MSSP in weighted undirected graphs.

Corollary 11 (MSSP-unweighted). There is an O~(m∣S∣1/k+n∣S∣1+2/k)\tilde{O}(m|S|^{1/k} + n|S|^{1+2/k})-time (k+2,k−1)(k+2, k-1)-approximation algorithm for MSSP in unweighted undirected graphs.

Table 3 compares these results with the source-restricted ADO of Roditty, Thorup, and Zwick [RTZ05].

Finally, by taking s=min⁡{t,n}s = \min\{t, n\} in Theorems 6 and 7, we obtain the following algorithms for tt-PSP. When t≪nt \ll n, they improve upon Theorems 3 and 4 by replacing the n1/kn^{1/k} factor in the running time with t1/kt^{1/k}. In the unweighted case, this comes with a slightly larger stretch, (k+2,k−1)(k+2, k-1) instead of (k,k−1)(k, k-1).

³The set AA does not need to be given. Scanning the pairs one by one and adding both endpoints of every pair that is not yet hit gives, in O(t)O(t) time, a hitting set of size at most 2s2s.

⁴The constant term in the stretch grows from 7 in Theorem 3 to 11, since with s<ns < n sources the hierarchy no longer starts at h0(u)=h0(v)=0h_0(u) = h_0(v) = 0, which adds at most 4d(u,v)4d(u,v) to the estimate. See Section 8.

Corollary 12 (t-PSP-weighted). There is an O~((m+t)t1/k)\tilde{O}((m+t)t^{1/k})-time (65k+11)(\frac{6}{5}k+11)-approximation algorithm for t-PSP in weighted undirected graphs.

Corollary 13 (t-PSP-unweighted). There is an O~(mt1/k+(n+t)t2/k)\tilde{O}(mt^{1/k}+(n+t)t^{2/k})-time (k+2,k−1)(k+2,k-1)-approximation algorithm for t-PSP in unweighted undirected graphs.

Hopsets. A b-hops (α,β)(\alpha,\beta)-approximation hopset is a set H\mathcal{H} of weighted edges whose addition to GG preserves distances and gives every pair u,v∈Vu,v\in V a path in G∪HG\cup\mathcal{H} with at most bb edges and length at most αd(u,v)+β\alpha d(u,v)+\beta. Hopsets have been studied extensively, both in upper bounds [Coh00, MPVX15, HKN18, EN19, HP19, BP20, EM21, EN22, KP22b, NS22, BW23, ABD+^{+}25] and in lower bounds [ABP18, KP22a, NS22, BH23, HXX25].

Huang and Pettie [HP19] observed that the Thorup-Zwick [TZ05] distance oracle yields a 2-hops (2k−1,0)(2k-1,0)-approximation hopset of size O~(n1+1/k)\tilde{O}(n^{1+1/k}), and asked the following question:

Question 5. Are other tradeoffs between size and stretch possible for hopsets whose hopbound is a fixed constant, such as 3 or 4, independent of kk?

We answer this question in the affirmative and present several new hopsets with constant hopbounds that break the 2k−O(1)2k-O(1) barrier. For unweighted graphs, we obtain a (k,k−1)(k,k-1)-approximation with 4 hops:

Corollary 14 (Hopset-unweighted). There is a 4-hops (k,k−1)(k,k-1)-approximation hopset of size O~(n1+1/k)\tilde{O}(n^{1+1/k}) for unweighted graphs.

For weighted graphs, we obtain three hopsets with 3, 4, and 5 hops. Each additional hop improves the tradeoff: the fourth hop reduces stretch, and the fifth reduces size. First, with 3 hops and O~(mn1/k)\tilde{O}(mn^{1/k}) edges, we obtain stretch 65k+7\frac{6}{5}k+7:

Corollary 15 (Hopset-weighted-3-hops). There is a 3-hops (65k+7)(\frac{6}{5}k+7)-stretch hopset of size O~(mn1/k)\tilde{O}(mn^{1/k}) for weighted graphs.

With one additional hop, we reduce the stretch to kk at the same size.

Corollary 16 (Hopset-weighted-4-hops). There is a 4-hops kk-stretch hopset of size O~(mn1/k)\tilde{O}(mn^{1/k}) for weighted graphs.

A fifth hop preserves stretch kk while reducing the hopset size to O~(n1+1/k)\tilde{O}(n^{1+1/k}).

Corollary 17 (Hopset-weighted). There is a 5-hops kk-stretch hopset of size O~(n1+1/k)\tilde{O}(n^{1+1/k}) for weighted graphs.

The Thorup-Zwick bunches and pivots used by Theorems 4 and 14 are also nearly optimal in the pivot-based model of Kadria and Roditty [KR26b]. In a pp-pivot β\beta-hop ADO, every vertex has at most pp pivots, including itself, and every estimate is the length of a walk of stored distances with at most β\beta hops, where, unlike in a hopset, pivot jumps between a vertex and one of its pivots are not counted as hops. Every estimate in our analysis of Theorem 4 is the length of a walk u→pu→px→x→px′→pv→vu\to p_u\to p_x\to x\to p'_x\to p_v\to v, where pu,px,px′p_u,p_x,p'_x, and pvp_v are Thorup-Zwick pivots of u,x,xu,x,x, and vv, respectively, and the only hops are the bunch distances from pup_u to pxp_x and from px′p'_x to pvp_v. Since this holds for every pair u,v∈Vu,v\in V, the Thorup-Zwick bunch and pivot distances form a kk-pivot 2-hop (k,k−1)(k,k-1)-approximation ADO with O~(n1+1/k)\tilde{O}(n^{1+1/k}) space. Under the Erdős girth conjecture, there are sparse unweighted graphs on which every O~(1)\tilde{O}(1)-pivot 2-hop ADO with O~(n1+1/k)\tilde{O}(n^{1+1/k}) space has stretch at least k−1k-1, even with an additive error independent of nn [KR26b]. Thus, within this model, the leading coefficient kk is optimal up to an additive 1.

Short paths. In addition, we obtain an improved algorithm for mm-PSP when the shortest paths of the queried pairs have at most two edges. This result also answers a question of Kadria and Roditty [KR25b], who asked whether stretch exactly kk is achievable for vertex pairs at distance 2 in unweighted graphs:

Theorem 18 (mm-PSP-short paths). There is an O~(mn1/k)\tilde{O}(mn^{1/k})-time kk-approximation algorithm for mm-PSP in weighted undirected graphs, for queried pairs (u,v)(u,v) whose shortest path P(u,v)P(u,v) has at most 2 edges.

Related work: Conditional lower bounds. Abboud, Bringmann, Khoury, and Zamir [ABKZ22] initiated the study of conditional lower bounds for approximate distance oracles with nonconstant query time. Building on their work, Abboud, Bringmann, and Fischer [ABF23] and, independently, Jin and Xu [JX23] proved stronger lower bounds under the 3SUM hypothesis: for a fixed kk, every ADO with O~(mn1/k)\tilde{O}(mn^{1/k}) preprocessing time and no(1)n^{o(1)} query time must have stretch at least k−O(1)k-O(1), even in unweighted graphs. Jin and Xu [JX23] also proved lower bounds for the offline setting, in which all pairs are given in advance. In particular, their result [JX23, Theorem 1.9] implies that, for every integer k≥3k \geq 3 and constant ε>0\varepsilon > 0, there is no (k/2−ε)(k/2-\varepsilon)-approximation algorithm for mm-PSP that runs in O~(mn1/k)\tilde{O}(mn^{1/k}) time, even in unweighted graphs, unless the 3SUM hypothesis fails. Hence, the leading coefficient 65\frac{6}{5} of Theorem 3 is within a factor of 125\frac{12}{5} of the best possible.

For pairs at distance 2, Jin and Xu [JX23] proved, under the 3SUM hypothesis, that for every constant integer k≥2k \geq 2 and every ε,δ>0\varepsilon, \delta > 0, there is no O(m1+12k−1−ε)O(m^{1+\frac{1}{2k-1}-\varepsilon})-time algorithm that (k−δ)(k-\delta)-approximates the distances of mm given pairs in an unweighted undirected graph with m=Θ(n1+12k−2)m = \Theta(n^{1+\frac{1}{2k-2}}), even when every queried pair is at distance at most 2. On such graphs, m12k−1=Θ(n12k−2)m^{\frac{1}{2k-1}} = \Theta(n^{\frac{1}{2k-2}}), so their lower bound rules out stretch k−δk-\delta in O(mn12k−2−ε)O(mn^{\frac{1}{2k-2}-\varepsilon}) time. Applying it with k2+1\frac{k}{2}+1 in place of kk (for even kk) shows that no algorithm with stretch k2+1−δ\frac{k}{2}+1-\delta runs in O(mn1k−ε)O(mn^{\frac{1}{k}-\varepsilon}) time. Since a pair at distance 2 in an unweighted graph has a shortest path with 2 edges, Theorem 18 applies, and it achieves stretch kk in O~(mn1/k)\tilde{O}(mn^{1/k}) time, which is within a factor of 2 of this lower bound. A similar factor of 2 in the stretch appears for ADOs. Jin and Xu [JX23] also rule out a (k−δ)(k-\delta)-stretch ADO with O(n1+1k−1−ε)O(n^{1+\frac{1}{k-1}-\varepsilon}) preprocessing time and no(1)n^{o(1)} query time on graphs with O(n)O(n) edges. Applying it with k+1k+1 in place of kk shows that no such ADO with stretch k+1−δk+1-\delta has O(n1+1k−ε)O(n^{1+\frac{1}{k}-\varepsilon}) preprocessing time, whereas the Thorup-Zwick ADO with stretch 2k−12k-1 is constructed in O~(n1+1/k)\tilde{O}(n^{1+1/k}) time on such graphs. It is therefore plausible that in both cases the lower bound, rather than the algorithm, can be improved, in which case Theorem 18 would be tight.

Organization. In Section 2 we fix our notation and review the Thorup-Zwick hierarchy, and in Section 3 we give a technical overview of our three growth lemmas and of how they replace the middle-vertex analysis. In Section 4 we prove the Mixed-Level Growth Lemma and use it to obtain the unweighted (k,k−1)(k, k-1)-approximation of Theorem 4, and in Section 5 we present the (65k+O(1))(\frac{6}{5}k+O(1))-approximation algorithm of Theorem 3, together with the Two-Level Growth Lemma and the Long-Short Growth Lemma. In Section 6 we prove Theorem 18, which shows that stretch kk is achievable for pairs whose shortest path has at most two edges. In Section 7 we derive our ADOs, Theorems 1 and 2, and our hopsets, and in Section 8 we generalize our algorithms to (t,s)(t, s)-PSP, obtaining Theorems 6 and 7 and their corollaries for ST-SP, MSSP, and t-PSP. Finally, the numerical optimization lemmas used by our stretch analyses, Lemmas 6 and 11, are proved in Section A.

References (70)