Output-Sensitive Evaluation of Regular Path Queries

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Khamis, Mahmoud Abo, Kara, Ahmet, Olteanu, Dan, Suciu, Dan
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917970791366656
author Khamis, Mahmoud Abo
Kara, Ahmet
Olteanu, Dan
Suciu, Dan
author_facet Khamis, Mahmoud Abo
Kara, Ahmet
Olteanu, Dan
Suciu, Dan
contents We study the classical evaluation problem for regular path queries: Given an edge-labeled graph and a regular path query, compute the set of pairs of vertices that are connected by paths that match the query. The Product Graph (PG) is the established evaluation approach for regular path queries. PG first constructs the product automaton of the data graph and the query and then uses breadth-first search to find the accepting states reachable from each initial state in the product automaton. Its data complexity is O(|V|.|E|), where V and E are the sets of vertices and respectively edges in the data graph. This complexity cannot be improved by combinatorial algorithms. In this paper, we introduce OSPG, an output-sensitive refinement of PG, whose data complexity is O(|E|^{3/2} + \min(OUT.\sqrt{|E|}, |V|.|E|)), where OUT is the number of distinct vertex pairs in the query output. OSPG's complexity is at most that of PG and can be asymptotically smaller for small output and sparse input. The improvement of OSPG over PG is due to the unnecessary time wasted by PG in the breadth-first search phase, in case a few output pairs are eventually discovered. For queries without Kleene star, the complexity of OSPG can be further improved to O(|E| + |E|.\sqrt{OUT}).
format Preprint
id arxiv_https___arxiv_org_abs_2412_07729
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Output-Sensitive Evaluation of Regular Path Queries
Khamis, Mahmoud Abo
Kara, Ahmet
Olteanu, Dan
Suciu, Dan
Databases
We study the classical evaluation problem for regular path queries: Given an edge-labeled graph and a regular path query, compute the set of pairs of vertices that are connected by paths that match the query. The Product Graph (PG) is the established evaluation approach for regular path queries. PG first constructs the product automaton of the data graph and the query and then uses breadth-first search to find the accepting states reachable from each initial state in the product automaton. Its data complexity is O(|V|.|E|), where V and E are the sets of vertices and respectively edges in the data graph. This complexity cannot be improved by combinatorial algorithms. In this paper, we introduce OSPG, an output-sensitive refinement of PG, whose data complexity is O(|E|^{3/2} + \min(OUT.\sqrt{|E|}, |V|.|E|)), where OUT is the number of distinct vertex pairs in the query output. OSPG's complexity is at most that of PG and can be asymptotically smaller for small output and sparse input. The improvement of OSPG over PG is due to the unnecessary time wasted by PG in the breadth-first search phase, in case a few output pairs are eventually discovered. For queries without Kleene star, the complexity of OSPG can be further improved to O(|E| + |E|.\sqrt{OUT}).
title Output-Sensitive Evaluation of Regular Path Queries
topic Databases
url https://arxiv.org/abs/2412.07729