The Complexity of Weighted Counting for Acyclic Conjunctive Queries
This paper is a study of weighted counting of the solutions of acyclic conjunctive queries ($\ACQ$). The unweighted quantifier free version of this problem is known to be tractable (for combined complexity), but it is also known that introducing even a single quantified variable makes it $\sP$-hard. We first show that weighted counting for quantifier-free $\ACQ$ is still tractable and that even minimalistic extensions of the problem lead to hard cases. We then introduce a new parameter for quantified queries that permits to isolate large island of tractability. We show that, up to a standard assumption from parameterized complexity, this parameter fully characterizes tractable subclasses for counting weighted solutions of $\ACQ$ queries. Thus we completely determine the tractability frontier for weighted counting for $\ACQ$.
💡 Research Summary
This paper provides a comprehensive study of weighted counting for acyclic conjunctive queries (ACQ). The authors first revisit the well‑known fact that quantifier‑free ACQ can be evaluated efficiently because its hypergraph admits a join tree, which yields a tree‑structured decomposition of variables and atoms. Leveraging this decomposition, they construct an arithmetic circuit that is multiplicatively disjoint: each multiplication gate combines independent subcircuits, and addition gates aggregate results. By assigning the given weight function to input gates, the circuit computes the polynomial Q(Φ) whose evaluation equals the sum of weights of all solutions. The construction uses only a polynomial number of gates, establishing that weighted counting for quantifier‑free ACQ is solvable in polynomial time (Theorem 3).
Next, the paper shows that even minimal extensions of this setting—specifically, taking the conjunction or disjunction of two quantifier‑free ACQ—already lead to #P‑hardness, even over a Boolean domain and with fixed arity (Proposition 5). Thus, while the decision problem remains tractable, counting becomes as hard as any #P problem once we allow simple Boolean combinations of queries.
The situation changes dramatically when existential quantifiers are introduced. Prior work demonstrated that a single ∃ quantifier makes counting #P‑hard. To identify a tractable island within this hard landscape, the authors introduce a new hypergraph parameter called the quantified star size. Intuitively, one extracts “stars” formed by a central quantified variable together with all free variables that appear together in some atom; the size k of the largest such star measures how dispersed the free variables are among quantified ones.
The main algorithmic contribution is that if the quantified star size is bounded by a constant k, the weighted counting problem can be solved in time n^{O(k)} (Theorem 16). The algorithm proceeds by dynamic programming over the join tree: for each star, it enumerates all possible assignments to its central quantified variable, stores the resulting partial sums in a table, and then merges tables along the tree using the independence guaranteed by the star decomposition. Crucially, the authors also prove that the quantified star size can be computed in polynomial time (Theorem 18).
From a parameterized complexity viewpoint, the authors show that the problem is #W
Comments & Academic Discussion
Loading comments...
Leave a Comment