Roundtrip All-Pairs Shortest Paths in Directed Graphs
Shiri Chechik, Gur Lifshitz
AI 速览:研究有向图在往返度量下的全对最短路径近似算法与距离预言机,给出新的算法上界与基于 BMM 的下界。
We study approximation algorithms for All-Pairs Shortest Paths (APSP) in directed graphs under the roundtrip metric. In directed graphs, even finite-factor approximation of ordinary one-way distances must distinguish reachable from unreachable vertex pairs, and therefore computes transitive closure, a problem equivalent to Boolean matrix multiplication (BMM) under standard reductions. The roundtrip distance, defined as $\text{dist}_G(u \leftrightarrows v) = \text{dist}_G(u \to v) + \text{dist}_G(v \to u)$, offers a natural and robust relaxation. It measures the cost of traveling from $u$ to $v$ and back, satisfies the triangle inequality, and is inherently symmetric. While this metric has become central to the study of directed roundtrip spanners and compact routing, the fundamental problem of all-pairs roundtrip distance approximation has remained largely unexplored. In this work, we present a comprehensive study of roundtrip APSP and distance oracles, presenting several new lower and upper bounds. On the algorithmic side, our main result is a combinatorial algorithm that computes a stretch-$3$ approximation to all-pairs roundtrip distances in $\widetilde{O}(n^2 + \min\{m\sqrt{n},\, m^{1/3}n^{5/3}\})$ time. For edge weights in $[1,W]$, we also obtain a $(3+\varepsilon)$-approximation in $\widetilde O((n^{2.037}+nm^{2/3})\log(nW)/\varepsilon)$ time and a $(4+\varepsilon)$-approximation in $\widetilde O(n^{2.032}\log(nW)/\varepsilon)$ time using fast matrix multiplication. On the hardness side, we show that any stretch below $3$ would imply a breakthrough for BMM. We also obtain additional tradeoffs between stretch and running time.
Shiri Chechik, Avi Kadria, Gur Lifshitz, Liam Roditty
Compact routing schemes route messages along short paths while every vertex stores little information. We study the trade-off between the stretch and the storage of compact routing schemes in undirected graphs, in four models: labeled and name-independent schemes, with average or worst-case local storage. We improve the best known stretch in all four models. Our main result is a labeled routing scheme with expected stretch $2k-1$ and $\widetilde O(n^{1/k})$ average local storage, in which only the routing is randomized. Under the Erdős girth conjecture, no scheme with this storage has stretch below $2k-1$, so our scheme is optimal, up to polylogarithmic factors in the storage. With deterministic routing, we obtain stretch $\approx2.47k$, the best known deterministic stretch with average storage. Worst-case local storage is the classical setting of compact routing. The leading coefficient $4$ in the stretch $4k-5$ of Thorup and Zwick~[SPAA'01] was improved only by Chechik~[PODC'13], to $\approx3.68$ in unweighted graphs. In unweighted graphs, we obtain expected stretch $(\frac83k+O(1),O(k))$, and deterministic stretch $\approx3.05k$. Name-independent routing is harder, since the source knows only the name of the destination. The best known stretch with $\widetilde O(n^{1/k})$ local storage in unweighted graphs was $96k$, by Abraham, Gavoille, and Malkhi~[DISC'04]. We improve it by more than a factor of $8$. With average storage, we obtain expected stretch $4k-5$, which matches the labeled scheme of Thorup and Zwick. With worst-case storage in unweighted graphs, we obtain expected stretch $(8k+O(1),O(k))$. All our schemes for unweighted graphs extend to weighted graphs with a small loss in the stretch, and still improve the previous unweighted bounds.
In a seminal work [STOC'01; JACM'05], Thorup and Zwick showed that every weighted undirected graph admits a tree cover where each vertex belongs to $O(kn^{1/k})$ trees in expectation, and every pair has a path of stretch at most $2k-1$ in some tree. In this paper, we extend this structural property to directed graphs with nonnegative edge weights. Let $\mathrm{dist}_G(u \leftrightarrows v) = \mathrm{dist}_G(u \to v) + \mathrm{dist}_G(v \to u)$ denote the roundtrip distance. For every integer $k$, we construct a collection $\mathcal{T}$ of tree-pairs, each consisting of an in-tree and an out-tree rooted at the same vertex. Each vertex belongs to $O(kn^{1/k})$ tree-pairs in expectation, and for every ordered pair $(u, v)$ some tree-pair $T_{in}\cup T_{out} \in \mathcal{T}$ satisfies $\mathrm{dist}_{T_{in}\cup T_{out}}(u \to v) \le \mathrm{dist}_G(u \to v) + (k-1)\mathrm{dist}_G(u \leftrightarrows v).$ We call this a \emph{$k$-strong (roundtrip) tree cover}. While prior techniques partition distances into geometric scales and build separate structures for each scale, our construction handles all distances simultaneously within a single, unified hierarchy. This yields the first directed tree cover for general $k$ matching the classic Thorup-Zwick stretch-size trade-off. Our cover immediately implies improved constructions of roundtrip spanners, path-reporting distance oracles, and compact routing schemes, as well as their source-wise and prioritized variants. We also provide faster algorithms for these structures: for general $k \ge 4$, all the above objects can be constructed in $\widetilde{O}(\min\{mn, n^{2.5}\})$ expected time, breaking the $mn$ barrier in dense directed graphs.
Shiri Chechik, Gur Lifshitz, Avi Kadria, Liam Roditty
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 $n$-pairs shortest paths ($n$-PSP), multiple-source shortest paths (MSSP), and $ST$-shortest paths, as well as new hopsets. One of our main results is a $(\frac 65 k+O(1))$-stretch ADO with $\tilde O(mn^{1/k})$ preprocessing time and space (where $\tilde O$ hides polylogarithmic factors), and $\tilde O(n^{1/k})$ query time, breaking, for sparse graphs, the $(2k-O(1))$-stretch barrier for ADOs with $\tilde O(n^{1+1/k})$ space and $\tilde O(n^{1/k})$ query time. In unweighted graphs, we also obtain a $(\frac 65 k+O(1),O(k))$-approximate ADO with $\tilde O(n^{1+1/k})$ space and $\tilde O(n^{1/k})$ query time. This also yields a $(\frac 65 k+O(1))$-approximation algorithm for $m$-pairs shortest paths ($m$-PSP) in $\tilde O(mn^{1/k})$ time, answering the question of Chechik, Hoch, and Lifshitz [SODA'25] of whether the $2k-O(1)$ barrier for $n$-PSP in $\tilde O(mn^{1/k})$ time can be broken. For unweighted graphs, we give a new analysis of the existing $\tilde O(mn^{1/k}+n^{1+2/k})$-time $n$-PSP algorithm of [Chechik et al., SODA'25], and show that, without any modification, it is a $(k,k-1)$-approximation, i.e., $d(u,v)\le\hat d(u,v)\le k\cdot d(u,v)+k-1$ for every queried pair. This improves its multiplicative factor from $\frac 43 k+O(1)$ to $k$, and the leading coefficient $k$ is tight for this algorithm. Moreover, for graphs with $m=Ω(n^{1+1/k})$, this answers the question of Dalirrooyfard et al. [FOCS'22] up to the additive $k-1$.