Skip to main content
QUICK REVIEW

[Paper Review] A Trichotomy in the Complexity of Counting Answers to Conjunctive Queries

Hubie Chen, Stefan Mengel|arXiv (Cornell University)|Aug 5, 2014
Data Management and AlgorithmsComputer Science15 references7 citations
TL;DR

This paper establishes a trichotomy theorem for the complexity of counting answers to conjunctive queries (CQ), showing that for any set of bounded-arity conjunctive queries, the problem is either tractable, equivalent to the parameterized Clique problem, or as hard as the parameterized #Clique problem. The classification is based on graph-theoretic properties—specifically, the treewidth of the core and the hypergraph of free variables—unifying prior dichotomy results for Boolean and quantifier-free queries.

ABSTRACT

Conjunctive queries are basic and heavily studied database queries; in relational algebra, they are the select-project-join queries. In this article, we study the fundamental problem of counting, given a conjunctive query and a relational database, the number of answers to the query on the database. In particular, we study the complexity of this problem relative to sets of conjunctive queries. We present a trichotomy theorem, which shows essentially that this problem on a set of conjunctive queries is either tractable, equivalent to the parameterized CLIQUE problem, or as hard as the parameterized counting CLIQUE problem; the criteria describing which of these situations occurs is simply stated, in terms of graph-theoretic conditions.

Motivation & Objective

  • To classify the parameterized counting complexity of conjunctive queries (CQ) across all sets of bounded-arity queries.
  • To unify and generalize prior dichotomy results for Boolean and quantifier-free CQs into a single, comprehensive trichotomy.
  • To identify precise graph-theoretic conditions—specifically, bounded treewidth of the query core and of the hypergraph of free variables—that determine tractability or hardness.
  • To extend the case complexity framework to counting problems, enabling transparent analysis in parameterized complexity.
  • To resolve the bounded-arity case of the counting CQ problem, leaving open the unbounded-arity and more expressive query language extensions.

Proposed method

  • Introduce a novel notion of core for conjunctive queries that accounts for free variables, crucial for the classification.
  • Define the hypergraph of a conjunctive query with vertices as free variables and edges as relations, enabling structural analysis.
  • Use treewidth as the central graph-theoretic measure to classify complexity: bounded treewidth of the core implies tractability.
  • Establish a counting slice reduction from #Clique to #CQ when the hypergraph of the query set has unbounded treewidth.
  • Prove interreducibility between #CQ and the parameterized Clique problem when the core has unbounded treewidth but the hypergraph has bounded treewidth.
  • Leverage known results on homomorphism counting and query containment to connect the new framework to existing complexity classes.

Experimental results

Research questions

  • RQ1What is the complete complexity classification of counting answers to conjunctive queries under bounded arity?
  • RQ2How do the treewidth of the query core and the treewidth of the free-variable hypergraph jointly determine the complexity of #CQ?
  • RQ3Can prior dichotomy results for Boolean and quantifier-free conjunctive queries be unified under a single trichotomy?
  • RQ4Is there a natural parameterized complexity framework that captures counting complexity in conjunctive query evaluation?
  • RQ5What are the implications of this classification for more expressive query languages or unbounded-arity settings?

Key findings

  • The counting problem #CQ for any set of bounded-arity conjunctive queries falls into exactly one of three complexity classes: tractable, equivalent to the parameterized Clique problem, or as hard as the parameterized #Clique problem.
  • Tractability occurs if and only if the cores of the queries in the set have bounded treewidth.
  • When cores have unbounded treewidth but the hypergraphs of free variables have bounded treewidth, #CQ is interreducible with the parameterized Clique problem.
  • When both the cores and the hypergraphs have unbounded treewidth, there is a counting slice reduction from #Clique to #CQ, implying hardness equivalent to #Clique.
  • The trichotomy theorem generalizes and subsumes prior dichotomies by Grohe (for Boolean CQs) and Dalmau and Jonsson (for quantifier-free CQs).
  • The framework is robust and extensible, providing a transparent method for analyzing counting complexity in parameterized complexity.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.