Table of Contents
Fetching ...

Semantic Tree-Width and Path-Width of Conjunctive Regular Path Queries

Diego Figueira, Rémi Morvan

TL;DR

The paper tackles the problem of deciding whether a Union of Conjunctive Two-Way Regular Path Queries (UC2RPQs) is semantically equivalent to a query of bounded tree-width or path-width. It introduces maximal under-approximations via refinements and tagged tree decompositions, proving decidability for semantic tree-width and semantic path-width for all k≥1, with tight complexity bounds: 2ExpSpace in general (ExpSpace-hard) and Π2 for the restricted simple regular expressions class; the k=1 case is settled via contracted-tree-width techniques, yielding ExpSpace-completeness. The work also provides an FPT/para-NL perspective for evaluation on bounded-width queries and extends the framework to one-way variants and path-width, offering a robust, unified approach to tractable evaluation and equivalence testing in graph-querying languages. These results have practical implications for query optimization and containment checking in graph databases, enabling efficient approximation and testing of query plans with bounded structural width.

Abstract

We show that the problem of whether a query is equivalent to a query of tree-width $k$ is decidable, for the class of Unions of Conjunctive Regular Path Queries with two-way navigation (UC2RPQs). A previous result by Barceló, Romero, and Vardi [SIAM Journal on Computing, 2016] has shown decidability for the case $k=1$, and here we extend this result showing that decidability in fact holds for any arbitrary $k\geq 1$. The algorithm is in 2ExpSpace, but for the restricted but practically relevant case where all regular expressions of the query are of the form $a^*$ or $(a_1 + \dotsb + a_n)$ we show that the complexity of the problem drops to $Π^P_2$. We also investigate the related problem of approximating a UC2RPQ by queries of small tree-width. We exhibit an algorithm which, for any fixed number $k$, builds the maximal under-approximation of tree-width $k$ of a UC2RPQ. The maximal under-approximation of tree-width $k$ of a query $q$ is a query $q'$ of tree-width $k$ which is contained in $q$ in a maximal and unique way, that is, such that for every query $q''$ of tree-width $k$, if $q''$ is contained in $q$ then $q''$ is also contained in $q'$. Our approach is shown to be robust, in the sense that it allows also to test equivalence with queries of a given path-width, it also covers the previously known result for $k=1$, and it allows to test for equivalence of whether a (one-way) UCRPQ is equivalent to a UCRPQ of a given tree-width (or path-width).

Semantic Tree-Width and Path-Width of Conjunctive Regular Path Queries

TL;DR

The paper tackles the problem of deciding whether a Union of Conjunctive Two-Way Regular Path Queries (UC2RPQs) is semantically equivalent to a query of bounded tree-width or path-width. It introduces maximal under-approximations via refinements and tagged tree decompositions, proving decidability for semantic tree-width and semantic path-width for all k≥1, with tight complexity bounds: 2ExpSpace in general (ExpSpace-hard) and Π2 for the restricted simple regular expressions class; the k=1 case is settled via contracted-tree-width techniques, yielding ExpSpace-completeness. The work also provides an FPT/para-NL perspective for evaluation on bounded-width queries and extends the framework to one-way variants and path-width, offering a robust, unified approach to tractable evaluation and equivalence testing in graph-querying languages. These results have practical implications for query optimization and containment checking in graph databases, enabling efficient approximation and testing of query plans with bounded structural width.

Abstract

We show that the problem of whether a query is equivalent to a query of tree-width is decidable, for the class of Unions of Conjunctive Regular Path Queries with two-way navigation (UC2RPQs). A previous result by Barceló, Romero, and Vardi [SIAM Journal on Computing, 2016] has shown decidability for the case , and here we extend this result showing that decidability in fact holds for any arbitrary . The algorithm is in 2ExpSpace, but for the restricted but practically relevant case where all regular expressions of the query are of the form or we show that the complexity of the problem drops to . We also investigate the related problem of approximating a UC2RPQ by queries of small tree-width. We exhibit an algorithm which, for any fixed number , builds the maximal under-approximation of tree-width of a UC2RPQ. The maximal under-approximation of tree-width of a query is a query of tree-width which is contained in in a maximal and unique way, that is, such that for every query of tree-width , if is contained in then is also contained in . Our approach is shown to be robust, in the sense that it allows also to test equivalence with queries of a given path-width, it also covers the previously known result for , and it allows to test for equivalence of whether a (one-way) UCRPQ is equivalent to a UCRPQ of a given tree-width (or path-width).
Paper Structure (32 sections, 41 theorems, 48 equations, 17 figures, 1 table)

This paper contains 32 sections, 41 theorems, 48 equations, 17 figures, 1 table.

Key Result

Proposition 1.0

For each $k \geqslant 1$, the "evaluation problem" for "UC2RPQs" of "tree-width" at most $k$ can be solved in time $\mathcal{O}(\size{\Gamma} \cdot |G|^{k+1} \cdot \log{|G|})$ on a Turing machine, or $\mathcal{O}(\size{\Gamma} \cdot |G|^{k+1})$ under a RAM model, where $\Gamma$ and $G$ are the inpu

Figures (17)

  • Figure 1: A "graph database" with eight nodes and eight edges on a two-letter alphabet.
  • Figure 2: Two different representations of the same "tree decomposition" $(T, \bagmap)$ of a multigraph $G$ with six vertices. The underlying tree is a path with four nodes and each "bag" contains 3 vertices---hence the "decomposition@tree decomposition" has "width" 2.
  • Figure 3: Clickable taxonomy of syntactic classes studied in this paper.
  • Figure 4: Clickable taxonomy of semantic classes studied in this paper, where $k \geqslant 2$.
  • Figure 5: "Refinements" and "homomorphisms" of "C2RPQs".
  • ...and 12 more figures

Theorems & Definitions (96)

  • Proposition 1.0: Proof in \ref{['apdx-sec:prop:crpq-bound-tree-width-upper-bound']}
  • theorem 1
  • Corollary 1.0: Existence of the "maximal under-approximation"
  • Corollary 1.0: FPT evaluation for bounded "semantic tree-width"
  • Theorem 1.1
  • Theorem 1.1
  • Theorem 1.1
  • Theorem 1.1
  • Theorem 1.1
  • proof
  • ...and 86 more