English

Distinct Shortest Walk Enumeration for RPQs

Data Structures and Algorithms 2024-03-08 v2 Databases Formal Languages and Automata Theory

Abstract

We consider the Distinct Shortest Walks problem. Given two vertices ss and tt of a graph database D\mathcal{D} and a regular path query, enumerate all walks of minimal length from ss to tt that carry a label that conforms to the query. Usual theoretical solutions turn out to be inefficient when applied to graph models that are closer to real-life systems, in particular because edges may carry multiple labels. Indeed, known algorithms may repeat the same answer exponentially many times. We propose an efficient algorithm for multi-labelled graph databases. The preprocessing runs in OD×AO{|\mathcal{D}|\times|\mathcal{A}|} and the delay between two consecutive outputs is in O(λ×A)O(\lambda\times|\mathcal{A}|), where A\mathcal{A} is a nondeterministic automaton representing the query and λ\lambda is the minimal length. The algorithm can handle ε\varepsilon-transitions in A\mathcal{A} or queries given as regular expressions at no additional cost.

Keywords

Cite

@article{arxiv.2312.05505,
  title  = {Distinct Shortest Walk Enumeration for RPQs},
  author = {Claire David and Nadime Francis and Victor Marsault},
  journal= {arXiv preprint arXiv:2312.05505},
  year   = {2024}
}

Comments

14 pages

R2 v1 2026-06-28T13:45:47.188Z