English

Path-Reporting Distance Oracles for Vertex-Labeled Graphs

Data Structures and Algorithms 2026-04-30 v1

Abstract

Let G=(V,E)G=(V,E) be a weighted undirected graph, with nn vertices. A distance oracle is a data structure that can quickly answer distance queries, with some stretch factor. A seminal work of \cite{TZ01}, given an integer k1k\ge 1, provides such an oracle with stretch 2k12k-1, query time O(k)O(k), and size O(kn1+1/k)O(k\cdot n^{1+1/k}). Furthermore, this oracle can also report a path in GG corresponding to the returned distance. In this paper we focus on vertex-labeled graphs, in which each vertex is given a label from a set LL of size \ell. A {\em vertex-label distance oracle} answers queries of the form (v,λ)(v,\lambda), where vVv\in V and λL\lambda\in L, by reporting (an approximation to) the distance from vv to the closest vertex of label λ\lambda. Following \cite{HLWY11}, it was shown in \cite{C12} that for any integer k>1k> 1, there exists a vertex-label distance oracle with stretch 4k54k-5, query time O(k)O(k), and size O(kn1/k)O(k\cdot n\cdot \ell^{1/k}). This state-of-the-art result suffers from two main drawbacks: The stretch is roughly a factor of 2 larger than in \cite{TZ01}, and it is not path-reporting. We address these concerns in this work, and provide the following results: First, we devise a {\em path-reporting} vertex-label distance oracle, at the cost of a slight increase in stretch and size. For any constant 0<ϵ<10<\epsilon<1, our oracle has stretch (4k5)(1+ϵ)(4k-5)\cdot(1+\epsilon), query time O(k)O(k), and size O(n1+o(1)1/k)O(n^{1+o(1)}\cdot \ell^{1/k}). Second, we show how to improve the stretch to the optimal 2k12k-1, at the cost of mildly increasing the query time. Specifically, we devise a vertex-label distance oracle with stretch 2k12k-1, query time O(1/klogn)O(\ell^{1/k}\cdot\log n), and size O(kn1/k)O(k\cdot n\cdot \ell^{1/k}). \end{itemize}

Cite

@article{arxiv.2604.26451,
  title  = {Path-Reporting Distance Oracles for Vertex-Labeled Graphs},
  author = {Ofer Neiman and Alon Spector},
  journal= {arXiv preprint arXiv:2604.26451},
  year   = {2026}
}

Comments

To appear in SWAT 2026

R2 v1 2026-07-01T12:40:50.727Z