TL;DR
This paper investigates the computational complexity of checking for "navigational homomorphisms" between regular graph patterns (RGPs), which represent complex graph queries. They show that this problem, crucial for understanding query containment, can be solved in EXPTIME, offering a more efficient alternative to general query containment (EXPSPACE-complete). For specific, simpler query types (unary alphabets, directed paths), they achieve even better results, with some cases being polynomial-time solvable.
What Problem Does This Paper Address?
Graph databases store information as labeled directed graphs. To retrieve data, users employ query languages. Conjunctive Regular Path Queries (CRPQs) are a powerful type of query that uses regular expressions to define paths within the graph. A key challenge in managing graph databases is understanding query containment: when does one query's result set always imply another's? This paper focuses on a specific, strong form of containment called "homomorphism-based containment," which is modeled by checking for navigational homomorphisms between two RGPs (the queries themselves). While general CRPQ containment is known to be computationally expensive (EXPSPACE-complete), this paper explores whether this specific homomorphism-based containment can be solved more efficiently. They aim to precisely characterize the complexity of this problem, both in its general form and for restricted, practically relevant query types.
Methods
The paper tackles the complexity of RGPHOM (Regular Graph Pattern Homomorphism) and its variants.
- General RGPHOM: They establish an EXPTIME upper bound for deciding if one RGP admits a navigational homomorphism to another. This is achieved by bounding the length of walks that need to be considered in the target RGP, leveraging a lemma that relates language inclusion to truncated language inclusion.
- PSPACE-hardness: They demonstrate that RGPHOM is PSPACE-hard by reducing the problem of REGULAR LANGUAGE INCLUSION (which is PSPACE-complete) to RGPHOM. This reduction is surprisingly simple, highlighting that the inherent difficulty lies in the underlying language problems.
- Non-uniform RGPHOM: They show that even when the target RGP is fixed (a common scenario in query optimization), the problem remains PSPACE-hard.
- Unary Alphabet ({a, a+}) Case: For RGPs with a unary alphabet (like those used in XPath or SPARQL), they show that RGPHOM is in NP. They further break this down:
- Undirected RGPs: They establish a dichotomy for undirected RGPs with {a, a+} labels, showing that RGPHOM(Q) is polynomial-time solvable if Q has at most one edge, and NP-complete otherwise.
- Directed Path RGPs: They prove that for directed path RGPs with {a, a+} labels, RGPHOM(Q) is polynomial-time solvable. This is achieved by reducing the problem to parallel job scheduling with relative deadlines and by showing that the target graph structure admits a majority polymorphism.
Datasets
Not discussed in the paper. The paper focuses on theoretical complexity and algorithmic analysis rather than empirical evaluation on specific datasets.
Key Insights and Ideas
- Homomorphism-based containment is more tractable: The core insight is that checking for navigational homomorphisms between RGPs, while a strong form of containment, is computationally easier (EXPTIME) than general CRPQ containment (EXPSPACE). This suggests that using homomorphism-based checks can be a practical approach for query optimization.
- Regular Language Inclusion as a reduction bottleneck: The PSPACE-hardness of RGPHOM stems directly from the PSPACE-completeness of REGULAR LANGUAGE INCLUSION. This indicates that the complexity is deeply tied to fundamental language-theoretic problems.
- The power of structural properties for restricted cases: For specific, simplified query structures (unary alphabet, directed paths), the problem becomes significantly easier. The paper leverages structural properties of these simplified RGPs (like being a directed path or having specific edge label constraints) to derive polynomial-time algorithms.
- Majority polymorphisms for polynomial solvability: The connection between the existence of a majority polymorphism and polynomial-time solvability of homomorphism problems (Theorem 17) is a powerful tool used to establish polynomial-time results for certain RGP classes.
Key Results
- General RGPHOM: Decidable in EXPTIME.
- RGPHOM(Q) for a fixed RGP Q: PSPACE-hard.
- RGPHOM for unary alphabet ({a, a+}) RGPs: In NP.
- RGPHOM(Q) for undirected, connected, n-core RGPs with {a, a+} labels: Polynomial-time if Q has at most one edge; NP-complete otherwise.
- RGPHOM(Q) for directed path RGPs with {a, a+} labels: Polynomial-time solvable.
Limitations and Future Work
- Closing the PSPACE gap: While RGPHOM is shown to be in EXPTIME, its PSPACE-hardness is also established. A key open question is to determine if RGPHOM is indeed PSPACE-complete or if a tighter upper bound exists.
- Generalizing polynomial cases: The paper identifies polynomial-time solvability for directed path RGPs with {a, a+} labels. Future work could explore whether this polynomial solvability extends to broader classes of directed tree-like RGPs or other structured query types.
- Practical implications of n-cores: The paper mentions that RGPHOM(Q) has the same complexity as RGPHOM(CQ), where CQ is an n-core of Q. However, deciding if an RGP is an n-core is coNP-hard. Investigating more efficient ways to find or approximate n-cores could be beneficial.
- Broader applications of homomorphism-based containment: While the paper demonstrates the efficiency of homomorphism-based containment for RGPs, further research could explore its applicability and effectiveness in real-world graph database systems and query optimization strategies.
Summary updated