Counting Answers to Existential Questions

Conjunctive queries select and are expected to return certain tuples from a relational database. We study the potentially easier problem of counting all selected tuples, rather than enumerating them. In particular, we are interested in the problem's parameterized and data complexity, where the query is considered to be small or fixed, and the database is considered to be large. We identify two structural parameters for conjunctive queries that capture their inherent complexity: The dominating star size and the linked matching number. If the dominating star size of a conjunctive query is large, then we show that counting solution tuples to the query is at least as hard as counting dominating sets, which yields a fine-grained complexity lower bound under the Strong Exponential Time Hypothesis as well as a #W[2]-hardness result. Moreover, if the linked matching number of a conjunctive query is large, then we show that the structure of the query is so rich that arbitrary queries up to a certain size can be encoded into it; this essentially establishes #A[2]-completeness. Using ideas stemming from Lovasz, we lift complexity results from the class of conjunctive queries to arbitrary existential or universal formulas that might contain inequalities and negations on constraints over the free variables. As a consequence, we obtain a complexity classification that generalizes previous results of Chen, Durand, and Mengel (ToCS 2015; ICDT 2015; PODS 2016) for conjunctive queries and of Curticapean and Marx (FOCS 2014) for the subgraph counting problem. Our proof also relies on graph minors, and we show a strengthening of the Excluded-Grid-Theorem which might be of independent interest: If the linked matching number is large, then not only can we find a large grid somewhere in the graph, but we can find a large grid whose diagonal has disjoint paths leading into an assumed node-well-linked set.

[1]  Radu Curticapean,et al.  The simple, little and slow things count: on parameterized counting complexity , 2015, Bull. EATCS.

[2]  Phokion G. Kolaitis,et al.  Constraint Satisfaction, Bounded Treewidth, and Finite-Variable Logics , 2002, CP.

[3]  Dániel Marx,et al.  Homomorphisms are a good basis for counting small subgraphs , 2017, STOC.

[4]  Stefan Mengel Conjunctive queries, arithmetic circuits and counting complexity , 2013 .

[5]  Marc Roth,et al.  Counting Restricted Homomorphisms via Möbius Inversion over Matroid Lattices , 2017, ESA.

[6]  Dániel Marx,et al.  Complexity of Counting Subgraphs: Only the Boundedness of the Vertex-Cover Number Counts , 2014, 2014 IEEE 55th Annual Symposium on Foundations of Computer Science.

[7]  Anthony C. Klug On conjunctive queries containing inequalities , 1988, JACM.

[8]  L. Lovász Operations with structures , 1967 .

[9]  Anand Rajaraman,et al.  Conjunctive query containment revisited , 2000, Theor. Comput. Sci..

[10]  Leslie Ann Goldberg,et al.  The Complexity of Counting Surjective Homomorphisms and Compactions , 2017, SODA.

[11]  Reinhard Pichler,et al.  Tractable Counting of the Answers to Conjunctive Queries , 2013, AMW.

[12]  Hubie Chen,et al.  A Trichotomy in the Complexity of Counting Answers to Conjunctive Queries , 2014, ICDT.

[13]  Seinosuke Toda,et al.  PP is as Hard as the Polynomial-Time Hierarchy , 1991, SIAM J. Comput..

[14]  Mihai Patrascu,et al.  On the possibility of faster SAT algorithms , 2010, SODA '10.

[15]  Russell Impagliazzo,et al.  Complexity of k-SAT , 1999, Proceedings. Fourteenth Annual IEEE Conference on Computational Complexity (Formerly: Structure in Complexity Theory Conference) (Cat.No.99CB36317).

[16]  Jörg Flum,et al.  Fixed-Parameter Tractability, Definability, and Model-Checking , 1999, SIAM J. Comput..

[17]  Anand Rajaraman,et al.  Conjunctive query containment revisited , 1997, Theor. Comput. Sci..

[18]  Peter Jonsson,et al.  The complexity of counting homomorphisms seen from the other side , 2004, Theor. Comput. Sci..

[19]  Svatopluk Poljak,et al.  On the complexity of the subgraph problem , 1985 .

[20]  Ashok K. Chandra,et al.  Optimal implementation of conjunctive queries in relational data bases , 1977, STOC '77.

[21]  Jörg Flum,et al.  Parameterized Complexity Theory (Texts in Theoretical Computer Science. An EATCS Series) , 2006 .

[22]  Hubie Chen Homomorphisms are indeed a good basis for counting: Three fixed-template dichotomy theorems, for the price of one , 2017, ArXiv.

[23]  Carsten Thomassen,et al.  Highly Connected Sets and the Excluded Grid Theorem , 1999, J. Comb. Theory, Ser. B.

[24]  Andrzej Lingas,et al.  Counting and Detecting Small Subgraphs via Equations , 2013, SIAM J. Discret. Math..

[25]  Russell Impagliazzo,et al.  Completeness for First-order Properties on Sparse Structures with Algorithmic Applications , 2017, SODA.

[26]  G. Rota On the Foundations of Combinatorial Theory , 2009 .

[27]  Hubie Chen,et al.  Counting Answers to Existential Positive Queries: A Complexity Classification , 2016, PODS.

[28]  Dániel Marx,et al.  Can you beat treewidth? , 2007, 48th Annual IEEE Symposium on Foundations of Computer Science (FOCS'07).

[29]  Ryan Williams,et al.  Finding, minimizing, and counting weighted subgraphs , 2009, STOC '09.

[30]  Julia Chuzhoy,et al.  Excluded Grid Theorem: Improved and Simplified , 2015, STOC.

[31]  Arnaud Durand,et al.  Structural Tractability of Counting of Solutions to Conjunctive Queries , 2013, ICDT '13.

[32]  Fedor V. Fomin,et al.  Faster algorithms for finding and counting subgraphs , 2009, J. Comput. Syst. Sci..

[33]  Paul Wollan,et al.  Rooted grid minors , 2013, J. Comb. Theory, Ser. B.

[34]  Jörg Flum,et al.  The Parameterized Complexity of Counting Problems , 2004, SIAM J. Comput..

[35]  Martin Grohe,et al.  The complexity of homomorphism and constraint satisfaction problems seen from the other side , 2003, 44th Annual IEEE Symposium on Foundations of Computer Science, 2003. Proceedings..

[36]  Thomas Zaslavsky,et al.  Combinatorial Geometries: The Möbius Function and the Characteristic Polynomial , 1987 .

[37]  Thomas Schwentick,et al.  When is the evaluation of conjunctive queries tractable? , 2001, STOC '01.

[38]  Holger Dell Note on "The Complexity of Counting Surjective Homomorphisms and Compactions" , 2017, ArXiv.

[39]  Ryan Williams,et al.  Faster decision of first-order graph properties , 2014, CSL-LICS.