Distinct Shortest Walk Enumeration for RPQs
Abstract: We consider the Distinct Shortest Walks problem. Given two vertices $s$ and $t$ of a graph database $\mathcal{D}$ and a regular path query, enumerate all walks of minimal length from $s$ to $t$ 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 $O{|\mathcal{D}|\times|\mathcal{A}|}$ and the delay between two consecutive outputs is in $O(\lambda\times|\mathcal{A}|)$, where $\mathcal{A}$ is a nondeterministic automaton representing the query and $\lambda$ is the minimal length. The algorithm can handle $\varepsilon$-transitions in $\mathcal{A}$ or queries given as regular expressions at no additional cost.
- Margareta Ackerman and Jeffrey Shallit. 2009. Efficient enumeration of words in regular languages. Theoretical Computer Science 410, 37 (2009), 3461–3470. https://doi.org/10.1016/j.tcs.2009.03.018 Implementation and Application of Automata (CIAA 2007).
- Antoine Amarilli and Mikaël Monet. 2023. Enumerating Regular Languages with Bounded Delay. In 40th International Symposium on Theoretical Aspects of Computer Science (STACS’23) (LIPIcs, Vol. 254). Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl, Germany, 8:1–8:18. https://doi.org/10.4230/LIPIcs.STACS.2023.8
- G-CORE: A Core for Future Graph Query Languages. In SIGMOD. ACM, 1421–1432.
- Foundations of Modern Query Languages for Graph Databases. ACM Comput. Surv. 50, 5 (2017).
- Arturs Backurs and Piotr Indyk. 2016. Which Regular Expression Patterns Are Hard to Match?. In 2016 IEEE 57th Annual Symposium on Foundations of Computer Science (FOCS). 457–466. https://doi.org/10.1109/FOCS.2016.56
- Philip Bille and Mikkel Thorup. 2009. Faster Regular Expression Matching. Lecture Notes in Computer Science, Vol. 5555. Springer, Berlin, Heidelberg, 171–182. https://doi.org/10.1007/978-3-642-02927-1_16
- Anna Brügemann-Klein. 1993. Regular expressions into finite automata. Theoretical Computer Science 120 (1993), 197–213.
- A Graphical Query Language Supporting Recursion. In SIGMOD’87, Umeshwar Dayal and Irving L. Traiger (Eds.). ACM, 323–330. https://doi.org/10.1145/38713.38749
- TigerGraph: A Native MPP Graph Database. http://arxiv.org/abs/1901.08248 Preprint arXiv:1901.08248.
- On the Complexity of String Matching for Graphs. ACM Trans. Algorithms 19, 3, Article 21 (apr 2023), 25Â pages. https://doi.org/10.1145/3588334
- Evaluating Regular Path Queries in GQL and SQL/PGQ: How Far Can The Classical Algorithms Take Us? (2023). https://doi.org/10.48550/arXiv.2306.02194 Preprint.
- International Organization for Standardization. 2024. GQL. Standard under development ISO/IEC DIS 39075. https://www.iso.org/standard/76120.html To appear.
- GPC: A Pattern Calculus for Property Graphs. In PODS’23. https://arxiv.org/abs/2210.16580 To appear.
- Nadime Francis and Victor Marsault. 2023. Enumerating regular languages in radix order : Revisiting the Ackerman-Shallit algorithm. ArXiv:2310.13309.
- M.L. Fredman and R.E. Tarjan. 1984. Fibonacci Heaps And Their Uses In Improved Network Optimization Algorithms. (1984), 338–346. https://doi.org/10.1109/SFCS.1984.715934
- Property Graph Query Language. 2021. PGQL 2.0 Specification. https://pgql-lang.org/spec/2.0/
- Representing Paths in Graph Database Pattern Matching. In VLDB’23, Vol. 16. 14 pages. https://doi.org/10.14778/3587136.3587151
- Wim Martens and Tina Trautner. 2018. Evaluation and Enumeration Problems for Regular Path Queries. In 21st International Conference on Database Theory, ICDT 2018, March 26-29, 2018, Vienna, Austria (LIPIcs, Vol. 98), Benny Kimelfeld and Yael Amsterdamer (Eds.). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 19:1–19:21. https://doi.org/10.4230/LIPIcs.ICDT.2018.19
- Gene Myers. 1992. A Four Russians algorithm for regular expression pattern matching. J. ACM 39, 2 (April 1992), 432–448. https://doi.org/10.1145/128749.128755
- Tina Popp. 2022. Evaluation and Enumeration of Regular Simple Path and Trail Queries. Ph. D. Dissertation. Bayreuth. https://epub.uni-bayreuth.de/6606/
- Yann Strozecki. 2021. Enumeration Complexity: Incremental Time, Delay and Space. Université de Versailles – Saint-Quentin-en-Yvelines. Habilitation thesis.
- Ken Thompson. 1968. Programming Techniques: Regular Expression Search Algorithm. Commun. ACM 11, 6 (jun 1968), 419–422. https://doi.org/10.1145/363347.363387
- TigerGraph. 2023. GSQL Language Reference (version 3.9). https://docs.tigergraph.com/gsql-ref/3.9/intro/
Paper Prompts
Sign up for free to create and run prompts on this paper using GPT-5.
Top Community Prompts
Collections
Sign up for free to add this paper to one or more collections.