Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

Counting Answers to Unions of Conjunctive Queries: Natural Tractability Criteria and Meta-Complexity

Published: 14 May 2024 Publication History

Abstract

We study the problem of counting answers to unions of conjunctive queries (UCQs) under structural restrictions on the input query. Concretely, given a class C of UCQs, the problem #UCQ (C) provides as input a UCQ Ψ ∈ C and a database D and the problem is to compute the number of answers of Ψ in D.
Chen and Mengel [PODS'16] have shown that for any recursively enumerable class C, the problem #UCQ (C) is either fixed-parameter tractable or hard for one of the parameterised complexity classes W[1] or #W[1]. However, their tractability criterion is unwieldy in the sense that, given any concrete class C of UCQs, it is not easy to determine how hard it is to count answers to queries in C. Moreover, given a single specific UCQ Ψ, it is not easy to determine how hard it is to count answers to Ψ.
In this work, we address the question of finding a natural tractability criterion: The combined conjunctive query of a UCQ Ψ=φ1 ∨ ... ∨ φl is the conjunctive query ^ Ψ = φ_1 ∧ ... ∧ φl. We show that under natural closure properties of C, the problem #UCQ (C) is fixed-parameter tractable if and only if the combined conjunctive queries of UCQs in C, and their contracts, have bounded treewidth. A contract of a conjunctive query is an augmented structure, taking into account how the quantified variables are connected to the free variables --- if all variables are free, then a conjunctive query is equal to its contract; in this special case the criterion for fixed-parameter tractability of #UCQ (C) thus simplifies to the combined queries having bounded treewidth.
Finally, we give evidence that a closure property on C is necessary for obtaining a natural tractability criterion: We show that even for a single UCQ Ψ, the meta problem of deciding whether #UCQ (Ψ) can be solved in time O(|D|d) is NP-hard for any fixed d ≥ 1. Moreover, we prove that a known exponential-time algorithm for solving the meta problem is optimal under assumptions from fine-grained complexity theory. As a corollary of our reduction, we also establish that approximating the Weisfeiler-Leman-Dimension of a UCQ is NP-hard.

References

[1]
Amir Abboud and Virginia Vassilevska Williams. 2014. Popular Conjectures Imply Strong Lower Bounds for Dynamic Problems. In 55th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2014, Philadelphia, PA, USA, October 18--21, 2014. IEEE Computer Society, 434--443. https://doi.org/10.1109/FOCS.2014.53
[2]
Serge Abiteboul, Richard Hull, and Victor Vianu. 1995. Foundations of Databases. Addison-Wesley. http://webdam.inria.fr/Alice/
[3]
Marcelo Arenas, Luis Alberto Croquevielle, Rajesh Jayaram, and Cristian Riveros. 2021. When is approximate counting for conjunctive queries tractable?. In STOC '21: 53rd Annual ACM SIGACT Symposium on Theory of Computing, Virtual Event, Italy, June 21--25, 2021, Samir Khuller and Virginia Vassilevska Williams (Eds.). ACM, 1015--1027. https://doi.org/10.1145/3406325.3451014
[4]
Vikraman Arvind. 2016. The Weisfeiler-Lehman Procedure. Bull. EATCS, Vol. 120 (2016). http://eatcs.org/beatcs/index.php/beatcs/article/view/442
[5]
Vikraman Arvind, Frank Fuhlbrü ck, Johannes Köbler, and Oleg Verbitsky. 2022. On the Weisfeiler-Leman dimension of fractional packing. Inf. Comput., Vol. 288 (2022), 104803. https://doi.org/10.1016/j.ic.2021.104803
[6]
Guillaume Bagan. 2009. Algorithmes et complexité des problè mes d'énumération pour l'é valuation de requêtes logiques. (Algorithms and complexity of enumeration problems for the evaluation of logical queries). Ph.,D. Dissertation. University of Caen Normandy, France. https://tel.archives-ouvertes.fr/tel-00424232
[7]
Guillaume Bagan, Arnaud Durand, and Etienne Grandjean. 2007. On Acyclic Conjunctive Queries and Constant Delay Enumeration. In Computer Science Logic, 21st International Workshop, CSL 2007, 16th Annual Conference of the EACSL, Lausanne, Switzerland, September 11--15, 2007, Proceedings (Lecture Notes in Computer Science, Vol. 4646), Jacques Duparc and Thomas A. Henzinger (Eds.). Springer, 208--222. https://doi.org/10.1007/978--3--540--74915--8_18
[8]
Pablo Barceló, Mikhail Galkin, Christopher Morris, and Miguel A. Romero Orth. 2022. Weisfeiler and Leman Go Relational. In Learning on Graphs Conference, LoG 2022, 9--12 December 2022, Virtual Event (Proceedings of Machine Learning Research, Vol. 198), Bastian Rieck and Razvan Pascanu (Eds.). PMLR, 46. https://proceedings.mlr.press/v198/barcelo22a.html
[9]
Pablo Barceló, Miguel Romero, and Moshe Y. Vardi. 2016. Semantic Acyclicity on Graph Databases. SIAM J. Comput., Vol. 45, 4 (2016), 1339--1376. https://doi.org/10.1137/15M1034714
[10]
Suman K. Bera, Lior Gishboliner, Yevgeny Levanzov, C. Seshadhri, and Asaf Shapira. 2022. Counting Subgraphs in Degenerate Graphs. J. ACM, Vol. 69, 3 (2022), 23:1--23:21. https://doi.org/10.1145/3520240
[11]
Christoph Berkholz, Fabian Gerhardt, and Nicole Schweikardt. 2020. Constant delay enumeration for conjunctive queries: a tutorial. ACM SIGLOG News, Vol. 7, 1 (2020), 4--33. https://doi.org/10.1145/3385634.3385636
[12]
Christoph Berkholz, Jens Keppeler, and Nicole Schweikardt. 2017. Answering Conjunctive Queries under Updates. In Proceedings of the 36th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS 2017, Chicago, IL, USA, May 14--19, 2017, Emanuel Sallinger, Jan Van den Bussche, and Floris Geerts (Eds.). ACM, 303--318. https://doi.org/10.1145/3034786.3034789
[13]
Christoph Berkholz, Jens Keppeler, and Nicole Schweikardt. 2018. Answering UCQs under Updates and in the Presence of Integrity Constraints. 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, 8:1--8:19. https://doi.org/10.4230/LIPIcs.ICDT.2018.8
[14]
Christoph Berkholz and Nicole Schweikardt. 2019. Constant Delay Enumeration with FPT-Preprocessing for Conjunctive Queries of Bounded Submodular Width. In 44th International Symposium on Mathematical Foundations of Computer Science, MFCS 2019, August 26--30, 2019, Aachen, Germany (LIPIcs, Vol. 138), Peter Rossmanith, Pinar Heggernes, and Joost-Pieter Katoen (Eds.). Schloss Dagstuhl - Leibniz-Zentrum fü r Informatik, 58:1--58:15. https://doi.org/10.4230/LIPIcs.MFCS.2019.58
[15]
Hans L. Bodlaender. 1996. A Linear-Time Algorithm for Finding Tree-Decompositions of Small Treewidth. SIAM J. Comput., Vol. 25, 6 (1996), 1305--1317. https://doi.org/10.1137/S0097539793251219
[16]
Johann Brault-Baron. 2013. De la pertinence de l'é numération : complexité en logiques propositionnelle et du premier ordre. (The relevance of the list: propositional logic and complexity of the first order). Ph.,D. Dissertation. University of Caen Normandy, France. https://tel.archives-ouvertes.fr/tel-01081392
[17]
Jin-yi Cai, Martin Fü rer, and Neil Immerman. 1992. An optimal lower bound on the number of variables for graph identification. Comb., Vol. 12, 4 (1992), 389--410. https://doi.org/10.1007/BF01305232
[18]
Chris Calabro, Russell Impagliazzo, and Ramamohan Paturi. 2009. The Complexity of Satisfiability of Small Depth Circuits. In Parameterized and Exact Computation, 4th International Workshop, IWPEC 2009, Copenhagen, Denmark, September 10--11, 2009, Revised Selected Papers (Lecture Notes in Computer Science, Vol. 5917), Jianer Chen and Fedor V. Fomin (Eds.). Springer, 75--85. https://doi.org/10.1007/978--3--642--11269-0_6
[19]
Nofar Carmeli, Shai Zeevi, Christoph Berkholz, Alessio Conte, Benny Kimelfeld, and Nicole Schweikardt. 2022. Answering (Unions of) Conjunctive Queries using Random Access and Random-Order Enumeration. ACM Trans. Database Syst., Vol. 47, 3 (2022), 9:1--9:49. https://doi.org/10.1145/3531055
[20]
Ashok K. Chandra and Philip M. Merlin. 1977. Optimal Implementation of Conjunctive Queries in Relational Data Bases. In Proceedings of the 9th Annual ACM Symposium on Theory of Computing, May 4--6, 1977, Boulder, Colorado, USA, John E. Hopcroft, Emily P. Friedman, and Michael A. Harrison (Eds.). ACM, 77--90. https://doi.org/10.1145/800105.803397
[21]
Hubie Chen and Stefan Mengel. 2015. A Trichotomy in the Complexity of Counting Answers to Conjunctive Queries. In 18th International Conference on Database Theory, ICDT 2015, March 23--27, 2015, Brussels, Belgium (LIPIcs, Vol. 31), Marcelo Arenas and Martin Ugarte (Eds.). Schloss Dagstuhl - Leibniz-Zentrum fü r Informatik, 110--126. https://doi.org/10.4230/LIPIcs.ICDT.2015.110
[22]
Hubie Chen and Stefan Mengel. 2016. Counting Answers to Existential Positive Queries: A Complexity Classification. In Proceedings of the 35th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS 2016, San Francisco, CA, USA, June 26 - July 01, 2016, Tova Milo and Wang-Chiew Tan (Eds.). ACM, 315--326. https://doi.org/10.1145/2902251.2902279
[23]
Yijia Chen, Kord Eickmeyer, and Jörg Flum. 2012. The Exponential Time Hypothesis and the Parameterized Clique Problem. In Parameterized and Exact Computation - 7th International Symposium, IPEC 2012, Ljubljana, Slovenia, September 12--14, 2012. Proceedings (Lecture Notes in Computer Science, Vol. 7535), Dimitrios M. Thilikos and Gerhard J. Woeginger (Eds.). Springer, 13--24. https://doi.org/10.1007/978--3--642--33293--7_4
[24]
Radu Curticapean, Holger Dell, and Dániel Marx. 2017. Homomorphisms are a good basis for counting small subgraphs. In Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2017, Montreal, QC, Canada, June 19--23, 2017, Hamed Hatami, Pierre McKenzie, and Valerie King (Eds.). ACM, 210--223. https://doi.org/10.1145/3055399.3055502
[25]
Victor Dalmau and Peter Jonsson. 2004. The complexity of counting homomorphisms seen from the other side. Theor. Comput. Sci., Vol. 329, 1--3 (2004), 315--323. https://doi.org/10.1016/j.tcs.2004.08.008
[26]
Holger Dell, Martin Grohe, and Gaurav Rattan. 2018. Lovász Meets Weisfeiler and Leman. In 45th International Colloquium on Automata, Languages, and Programming, ICALP 2018, July 9--13, 2018, Prague, Czech Republic (LIPIcs, Vol. 107), Ioannis Chatzigiannakis, Christos Kaklamanis, Dániel Marx, and Donald Sannella (Eds.). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 40:1--40:14. https://doi.org/10.4230/LIPIcs.ICALP.2018.40
[27]
Holger Dell, Marc Roth, and Philip Wellnitz. 2019. Counting Answers to Existential Questions. In 46th International Colloquium on Automata, Languages, and Programming, ICALP 2019, July 9--12, 2019, Patras, Greece (LIPIcs, Vol. 132), Christel Baier, Ioannis Chatzigiannakis, Paola Flocchini, and Stefano Leonardi (Eds.). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 113:1--113:15. https://doi.org/10.4230/LIPIcs.ICALP.2019.113
[28]
Arnaud Durand and Stefan Mengel. 2013. Structural tractability of counting of solutions to conjunctive queries. In Joint 2013 EDBT/ICDT Conferences, ICDT '13 Proceedings, Genoa, Italy, March 18--22, 2013, Wang-Chiew Tan, Giovanna Guerrini, Barbara Catania, and Anastasios Gounaris (Eds.). ACM, 81--92. https://doi.org/10.1145/2448496.2448508
[29]
Uriel Feige, Mohammad Taghi Hajiaghayi, and James R. Lee. 2008. Improved Approximation Algorithms for Minimum Weight Vertex Separators. SIAM J. Comput., Vol. 38, 2 (2008), 629--657. https://doi.org/10.1137/05064299X
[30]
Jacob Focke, Leslie Ann Goldberg, Marc Roth, and Stanislav Zivný. 2022. Approximately Counting Answers to Conjunctive Queries with Disequalities and Negations. In PODS '22: International Conference on Management of Data, Philadelphia, PA, USA, June 12 - 17, 2022, Leonid Libkin and Pablo Barceló (Eds.). ACM, 315--324. https://doi.org/10.1145/3517804.3526231
[31]
Jacob Focke, Leslie Ann Goldberg, Marc Roth, and Stanislav Zivný. 2023. Counting Answers to Unions of Conjunctive Queries: Natural Tractability Criteria and Meta-Complexity. CoRR, Vol. abs/2311.10634 (2023). https://doi.org/10.48550/ARXIV.2311.10634 showeprint[arXiv]2311.10634
[32]
Martin Fürer. 2017. On the Combinatorial Power of the Weisfeiler-Lehman Algorithm. In Algorithms and Complexity - 10th International Conference, CIAC 2017, Athens, Greece, May 24--26, 2017, Proceedings (Lecture Notes in Computer Science, Vol. 10236), Dimitris Fotakis, Aris Pagourtzis, and Vangelis Th. Paschos (Eds.). 260--271. https://doi.org/10.1007/978--3--319--57586--5_22
[33]
Georg Gottlob, Gianluigi Greco, and Francesco Scarcello. 2014. Treewidth and Hypertree Width. In Tractability: Practical Approaches to Hard Problems, Lucas Bordeaux, Youssef Hamadi, and Pushmeet Kohli (Eds.). Cambridge University Press, 3--38. https://doi.org/10.1017/CBO9781139177801.002
[34]
Georg Gottlob, Nicola Leone, and Francesco Scarcello. 2002. Hypertree decomposition and tractable queries. J. Comput. System Sci., Vol. 64, 3 (2002), 579--627. https://doi.org/10.1006/jcss.2001.1809
[35]
Gianluigi Greco and Francesco Scarcello. 2014. Counting solutions to conjunctive queries: structural and hybrid tractability. In Proceedings of the 33rd ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, PODS'14, Snowbird, UT, USA, June 22--27, 2014, Richard Hull and Martin Grohe (Eds.). ACM, 132--143. https://doi.org/10.1145/2594538.2594559
[36]
Martin Grohe. 2007. The complexity of homomorphism and constraint satisfaction problems seen from the other side. J. ACM, Vol. 54, 1 (2007), 1:1--1:24. https://doi.org/10.1145/1206035.1206036
[37]
Martin Grohe and Dá niel Marx. 2014. Constraint Solving via Fractional Edge Covers. ACM Transactions on Algorithms, Vol. 11, 1 (2014), 4:1--4:20. https://doi.org/10.1145/2636918
[38]
Martin Grohe, Thomas Schwentick, and Luc Segoufin. 2001. When is the evaluation of conjunctive queries tractable?. In Proceedings on 33rd Annual ACM Symposium on Theory of Computing, July 6--8, 2001, Heraklion, Crete, Greece, Jeffrey Scott Vitter, Paul G. Spirakis, and Mihalis Yannakakis (Eds.). ACM, 657--666. https://doi.org/10.1145/380752.380867
[39]
Russell Impagliazzo and Ramamohan Paturi. 2001. On the Complexity of k-SAT. J. Comput. Syst. Sci., Vol. 62, 2 (2001), 367--375. https://doi.org/10.1006/jcss.2000.1727
[40]
Richard M. Karp and Michael Luby. 1983. Monte-Carlo Algorithms for Enumeration and Reliability Problems. In 24th Annual Symposium on Foundations of Computer Science, Tucson, Arizona, USA, 7--9 November 1983. IEEE Computer Society, 56--64. https://doi.org/10.1109/SFCS.1983.35
[41]
Sandra Kiefer, Ilia Ponomarenko, and Pascal Schweitzer. 2019. The Weisfeiler-Leman Dimension of Planar Graphs Is at Most 3. J. ACM, Vol. 66, 6 (2019), 44:1--44:31. https://doi.org/10.1145/3333003
[42]
Phokion G. Kolaitis and Moshe Y. Vardi. 1995. On the Expressive Power of Datalog: Tools and a Case Study. J. Comput. Syst. Sci., Vol. 51, 1 (1995), 110--134. https://doi.org/10.1006/jcss.1995.1055
[43]
Phokion G. Kolaitis and Moshe Y. Vardi. 2000. Conjunctive-Query Containment and Constraint Satisfaction. J. Comput. Syst. Sci., Vol. 61, 2 (2000), 302--332. https://doi.org/10.1006/jcss.2000.1713
[44]
Matthias Lanzinger and Pablo Barceló. 2023. On the Power of the Weisfeiler-Leman Test for Graph Motif Parameters. CoRR, Vol. abs/2309.17053 (2023). https://doi.org/10.48550/arXiv.2309.17053 showeprint[arXiv]2309.17053
[45]
Dániel Marx. 2010. Approximating fractional hypertree width. ACM Trans. Algorithms, Vol. 6, 2 (2010), 29:1--29:17. https://doi.org/10.1145/1721837.1721845
[46]
Dániel Marx. 2013. Tractable hypergraph properties for constraint satisfaction and conjunctive queries. J. ACM, Vol. 60, 6 (2013). https://doi.org/10.1145/2535926 Article No. 42.
[47]
Stefan Mengel. 2021. A short note on the counting complexity of conjunctive queries. CoRR, Vol. abs/2112.01108 (2021). showeprint[arXiv]2112.01108 https://arxiv.org/abs/2112.01108
[48]
Carl A. Miller. 2013. Evasiveness of Graph Properties and Topological Fixed-Point Theorems. Found. Trends Theor. Comput. Sci., Vol. 7, 4 (2013), 337--415. https://doi.org/10.1561/0400000055
[49]
Christopher Morris, Martin Ritzert, Matthias Fey, William L. Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. 2019. Weisfeiler and Leman Go Neural: Higher-Order Graph Neural Networks. In The Thirty-Third AAAI Conference on Artificial Intelligence, AAAI 2019, The Thirty-First Innovative Applications of Artificial Intelligence Conference, IAAI 2019, The Ninth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2019, Honolulu, Hawaii, USA, January 27 - February 1, 2019. AAAI Press, 4602--4609. https://doi.org/10.1609/aaai.v33i01.33014602
[50]
Daniel Neuen. 2023. Homomorphism-Distinguishing Closedness for Graphs of Bounded Tree-Width. CoRR, Vol. abs/2304.07011 (2023). https://doi.org/10.48550/arXiv.2304.07011 showeprint[arXiv]2304.07011
[51]
Reinhard Pichler and Sebastian Skritek. 2013. Tractable counting of the answers to conjunctive queries. J. Comput. Syst. Sci., Vol. 79, 6 (2013), 984--1001. https://doi.org/10.1016/j.jcss.2013.01.012
[52]
Marc Roth and Johannes Schmitt. 2020. Counting Induced Subgraphs: A Topological Approach to #W[1]-hardness. Algorithmica, Vol. 82, 8 (2020), 2267--2291. https://doi.org/10.1007/s00453-020-00676--9
[53]
Bjarke Hammersholt Roune and Eduardo Sáenz-de-Cabezón. 2013. Complexity and algorithms for Euler characteristic of simplicial complexes. J. Symb. Comput., Vol. 50 (2013), 170--196. https://doi.org/10.1016/j.jsc.2012.07.003
[54]
Moshe Y. Vardi. 2000. Constraint Satisfaction and Database Theory: a Tutorial. In Proceedings of the Nineteenth ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, May 15--17, 2000, Dallas, Texas, USA, Victor Vianu and Georg Gottlob (Eds.). ACM, 76--85. https://doi.org/10.1145/335168.335209
[55]
Mihalis Yannakakis. 1981. Algorithms for Acyclic Database Schemes. In Very Large Data Bases, 7th International Conference, September 9--11, 1981, Cannes, France, Proceedings. IEEE Computer Society, 82--94.

Cited By

View all

Index Terms

  1. Counting Answers to Unions of Conjunctive Queries: Natural Tractability Criteria and Meta-Complexity

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image Proceedings of the ACM on Management of Data
      Proceedings of the ACM on Management of Data  Volume 2, Issue 2
      PODS
      May 2024
      852 pages
      EISSN:2836-6573
      DOI:10.1145/3665155
      Issue’s Table of Contents
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 14 May 2024
      Published in PACMMOD Volume 2, Issue 2

      Permissions

      Request permissions for this article.

      Author Tags

      1. conjunctive queries
      2. counting problems
      3. simplicial complexes
      4. unions of conjunctive queries
      5. weisfeiler-leman algorithm

      Qualifiers

      • Research-article

      Funding Sources

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)46
      • Downloads (Last 6 weeks)11
      Reflects downloads up to 07 Mar 2025

      Other Metrics

      Citations

      Cited By

      View all

      View Options

      Login options

      Full Access

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Figures

      Tables

      Media

      Share

      Share

      Share this Publication link

      Share on social media