Document Open Access Logo

Containment of UC2RPQ: The Hard and Easy Cases

Author Diego Figueira

Thumbnail PDF


  • Filesize: 1.82 MB
  • 18 pages

Document Identifiers

Author Details

Diego Figueira
  • Univ. Bordeaux, CNRS, Bordeaux INP, LaBRI, UMR5800, F-33400 Talence, France


Thanks to Guillaume Lagarde, Matthias Niewerth and anonymous reviewers for helpful comments.

Cite AsGet BibTex

Diego Figueira. Containment of UC2RPQ: The Hard and Easy Cases. In 23rd International Conference on Database Theory (ICDT 2020). Leibniz International Proceedings in Informatics (LIPIcs), Volume 155, pp. 9:1-9:18, Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2020)


We study the containment problem for UC2RPQ, that is, two-way Regular Path Queries, closed under conjunction, projection and union. We show a dichotomy property between PSpace-c and ExpSpace-c based on a property on the underlying graph of queries. We show that for any class C of graphs, the containment problem for queries whose underlying graph is in C is in PSpace if and only if C has bounded bridgewidth. Bridgewidth is a graph measure we introduce to this end, defined as the maximum size of a minimal edge separator of a graph.

Subject Classification

ACM Subject Classification
  • Information systems → Graph-based database models
  • Information systems → Resource Description Framework (RDF)
  • Mathematics of computing → Graph theory
  • Theory of computation → Formal languages and automata theory
  • Regular Path Queries (RPQ)
  • 2RPQ
  • CRPQ
  • C2RPQ
  • UC2RPQ
  • graph databases
  • containment
  • inclusion
  • equivalence
  • dichotomy
  • graph measure
  • bridge-width (bridgewidth)
  • minimal edge separator
  • minimal cut-set
  • max-cut
  • tree-width (treewidth)


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Max cut problem between two connected subgraphs. Stack Exchange. Version: 2018-07-26 21:13. URL:
  2. Renzo Angles, Marcelo Arenas, Pablo Barceló, Aidan Hogan, Juan L. Reutter, and Domagoj Vrgoč. Foundations of Modern Query Languages for Graph Databases. ACM Computing Surveys, 50(5):68:1-68:40, 2017. URL:
  3. Stefan Arnborg, Derek G Corneil, and Andrzej Proskurowski. Complexity of finding embeddings in a k-tree. SIAM Journal on Algebraic Discrete Methods, 8(2):277-284, 1987. Google Scholar
  4. Pablo Barceló. Querying graph databases. In ACM Symposium on Principles of Database Systems (PODS), pages 175-188, 2013. URL:
  5. Pablo Barceló, Diego Figueira, and Miguel Romero. Boundedness of Conjunctive Regular Path Queries. In International Colloquium on Automata, Languages and Programming (ICALP), volume 132 of Leibniz International Proceedings in Informatics (LIPIcs), pages 104:1-104:15. Leibniz-Zentrum für Informatik, 2019. URL:
  6. Pablo Barceló, Miguel Romero, and Moshe Y. Vardi. Semantic Acyclicity on Graph Databases. SIAM J. Comput., 45(4):1339-1376, 2016. URL:
  7. Diego Calvanese, Giuseppe De Giacomo, Maurizio Lenzerini, and Moshe Y. Vardi. Containment of Conjunctive Regular Path Queries with Inverse. In Principles of Knowledge Representation and Reasoning (KR), pages 176-185, 2000. Google Scholar
  8. Diego Calvanese, Giuseppe De Giacomo, Maurizio Lenzerini, and Moshe Y. Vardi. View-Based Query Answering and Query Containment over Semistructured Data. In International Symposium on Database Programming Languages (DBPL), volume 2397 of Lecture Notes in Computer Science, pages 40-61. Springer, 2001. URL:
  9. Diego Calvanese, Giuseppe De Giacomo, Maurizio Lenzerini, and Moshe Y. Vardi. Rewriting of Regular Expressions and Regular Path Queries. Journal of Computer and System Sciences (JCSS), 64(3):443-465, 2002. URL:
  10. Bogdan S. Chlebus. Domino-Tiling Games. Journal of Computer and System Sciences (JCSS), 32(3):374-392, 1986. URL:
  11. Daniela Florescu, Alon Levy, and Dan Suciu. Query Containment for Conjunctive Queries with Regular Expressions. In ACM Symposium on Principles of Database Systems (PODS), pages 139-148. ACM Press, 1998. URL:
  12. Martin Grohe. The complexity of homomorphism and constraint satisfaction problems seen from the other side. Journal of the ACM, 54(1):1:1-1:24, 2007. URL:
  13. Martin Grohe, Thomas Schwentick, and Luc Segoufin. When is the evaluation of conjunctive queries tractable? In Symposium on Theory of Computing (STOC), pages 657-666. ACM Press, 2001. URL:
  14. Juan L. Reutter, Miguel Romero, and Moshe Y. Vardi. Regular Queries on Graph Databases. Theoretical Computer Science, 61(1):31-83, 2017. URL:
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail