Factorised Representations of Join Queries:
Tight Bounds and a New Dichotomy
Abstract
A common theme in factorised databases and knowledge compilation is the representation of solution sets in a useful yet succinct data structure. In this paper, we study the representation of the result of join queries (or, equivalently, the set of homomorphisms between two relational structures). We focus on the very general format of -circuits – also known as d-representations or DNNF circuits – and aim to find the limits of this approach.
In prior work, it has been shown that there always exists a -circuit of size representing the query result, where is the size of the database and the submodular width of the query. If the arity of all relations is bounded by a constant, then is linear in the treewidth of the query. In this setting, the authors of this paper proved a lower bound of on the circuit size (ICALP 2023), where depends on the excluded grid theorem.
Our first main contribution is to improve this lower bound to , which is tight up to a constant factor in the exponent. Our second contribution is a lower bound on the circuit size for join queries over relations of unbounded arity. Both lower bounds are unconditional lower bounds on the circuit size for well-chosen database instances. Their proofs use a combination of structural (hyper)graph theory with communication complexity in a simple yet novel way. While the second lower bound is asymptotically equivalent to Marx’s conditional bound on the decision complexity (JACM 2013), our bound in the bounded arity setting is tight, while the best conditional bound on the decision complexity is . Note that removing this logarithmic factor in the decision setting is a major open problem.
Keywords and phrases:
join queries, homomorphisms, factorised databases, succinct representation, knowledge compilation, lower boundsFunding:
Harry Vinall-Smeeth: Funded by the European Union (ERC, SymSim, 101054974). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council. Neither the European Union nor the granting authority can be held responsible for them.Copyright and License:
2012 ACM Subject Classification:
Theory of computation Database theoryFunding:
This work was funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) project number 414325841.Editors:
Balder ten Cate and Maurice FunkSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
A central topic in factorised databases is the succinct representation of query results in a data structure that enables efficient access, ranging from counting, sampling or enumerating the result tuples to complex analytical tasks. We study the question: how succinctly can the result of a join query be represented? Of course, the answer depends on the representation format under consideration. For the flat representation (listing all result tuples), the answer is given by the AGM-bound [5]: in the worst case a join query produces tuples, where is the fractional edge cover number of the query and the size of the database. However, using suitable data structures, much more efficient representations are possible.
In this paper, we consider -circuits (originally called d-representations), which are the most general representation format studied so far and lead to the most succinct representations. In a nutshell, the idea is to decompose the result relation using union and Cartesian product, where representations of intermediate relations may also be re-used. The representation can be viewed as a circuit consisting of - and -gates, where each gate “computes” a relation and the output gate produces the query result. These -circuits are closely related to DNNF circuits from the field of knowledge compilation, which primarily deals with succinct representations of Boolean functions. The interaction between database theory and knowledge compilation has already been quite fruitful and we invite the reader to consult the recent exposition of Amarilli and Capelli [2] for an overview. Our main results emerge from this connection as we use structural properties of join queries as well as methods from knowledge compilation to obtain bounds on the representation size.
Example 1.
Evaluating on a database with
consists of tuples and the query result consists of tuples, as follows.
can be succinctly represented by the following -circuit with 9 internal gates and 26 inputs.111For simplicity the gates have fan-in larger than 2 in this example, see Remark 6. The three -gates correspond to the three blocks from the table.
It will be convenient to view join query evaluation as a homomorphism problem, where the goal is to compute/represent the set of homomorphisms between a left-hand-side structure , corresponding to a join query, and a right-hand-side structure , modelling a relational database. Moreover, we are interested in the classical data complexity setting, where is considered to be fixed and we measure the complexity in terms of the size of . The investigation of this setting was initiated by Olteanu and Závodný [42], who showed that admits -circuits of size , where is the fractional hypertree width of . It turns out that the obtained circuits have the additional properties of being structured and deterministic,222We use established terminology from knowledge compilation here, the original name is deterministic d-representations respecting a d-tree; these are a special case of deterministic, structured -circuits. which in particular allows us to exactly count the number of result tuples. It also follows from [37, 10] that for arbitrary small , there always exist general -circuits of size that represent all homomorphisms, where is the submodular width of . These representations can in particular be used for constant delay enumeration [10] and approximate counting [39].
The authors of this paper recently made progress on lower bounds [12], by showing that if the arity of all relations is bounded by some global constant, then there is an such that for every and there are structures of size such that any -circuit representing has size , where is the treewidth of . Note that in this bounded-arity-setting (one may also just think of graphs) we have , whereas in general one may have .333More precisely, they disagree only by a factor of on -ary structures. In general, structures can have constant () and unbounded () [36].
Theorem 2.
Let be an integer. Then there is an such that for every structure of arity at most there exist arbitrarily large structures such that any -circuit for has size at least .
Our second main result provides the first lower bound when the arity is unrestricted. Here we show that the submodular width bound is almost optimal.
Theorem 3.
There is an such that for every structure there exist arbitrarily large structures such that any -circuit for has size at least .
Techniques.
We deploy a similar “recipe” for proving both of our main results. We begin with a known characterisation of what it means for a structure to have high -width, for . In both cases, the characterisation is of the form “there is a subset of the universe of which is highly connected”. What highly connected means depends on the notion of width but the idea is that this subset is hard to disconnect, for instance by removing vertices or edges. Next we have to define some bad instance: that is some structure such that there is no small -circuit for . We do this by using randomness. This is relatively straightforward for Theorem 2; we first describe this proof on a high level.
For this we use the characterisation of treewidth in terms of a highly connected set from [43, 44]. This characterisation is also used by Marx to prove a conditional lower bound in the decision setting [35]. He showed that every graph with high treewidth has high “embedding power” and can therefore efficiently simulate a -SAT instance. Thus, under an assumption about how quickly -SAT can be solved, Marx obtains conditional lower bounds on the decision problem which are tight up to a logarithmic factor in the exponent. As we do not need to use embeddings we obtain lower bounds in our setting which are tight up to a constant in the exponent.
Since the arity is bounded, it turns out that the main step reduces to the special case where is a graph. Here we can set to be a random graph where each edge is included independently with probability a half. There are two key ideas. First, the set is big; this is essential otherwise we can get a small representation with a trivial circuit which lists every homomorphism. Second, contains (with high probability) no big bicliques. Intuitively, this makes it hard for a -circuit to significantly “compress” .
We deployed a similar idea in [12] to prove a lower bound where the left-hand structure is a complete graph. The reason we can in general improve the dependence on the treewidth compared with [12] is that we use a different method to lower bound the size of circuits; we deploy a framework based on tools from communication complexity that has been successfully deployed in knowledge compilation, see e.g. [6, 17, 14, 24, 47], since its introduction in [15]. Using this framework we do not directly reason about circuits – as is done in [12] – but instead about sets of combinatorial rectangles (see Section 4). This allows us to directly reason about each left-hand-side instance ; in contrast in our previous work we only directly reason about the case where is a -clique and then perform a series of reductions which crucially rely on the Excluded Grid Theorem of Robertson and Seymour [45]. We show that if we partition the vertices of a high treewidth graph , such that the highly connected set is evenly split between the two sides of the partition, then there must be a large number of edges crossing the partition. This is the key to us proving our lower bound.
The proof of Theorem 3 follows a similar pattern but we have to be more careful about defining our “bad instances”, since we are now working with higher arity structures. In particular, we have to control the size of each relation in since if they get too big compared to it will destroy the lower bound. To do this we exploit the existence of a highly connected set in and use this explicitly in our construction of . Here we use the same characterisation of highly connectedness used in [37] to reason about the decision setting.
Further related work.
Knowledge compilation originally emerged as a sub-field of artificial intelligence concerned with the efficient representation of Boolean functions [23]. Within recent years, concepts from this area have been applied more widely, particularly within database theory (again see the survey [2]) and the related area of constraint satisfaction [12, 9, 34, 38, 3]. An advantage of this approach is that if we can represent our query answer as a (particular type of) -circuit, then we can leverage known results to perform e.g. enumeration [42, 1], sampling [46], direct access [18] or (approximate) (weighted) counting [32, 4, 39] efficiently.444Note that while some of these results are only shown for circuits computing sets of Boolean functions, as is observed in the survey [2], it is straightforward to adapt them to our more general setting. These circuits (and variants) have proved useful for many other aspects of database theory: for instance for MSO queries [1], incremental view maintenance [7, 40], probabilistic databases [31] and representing query provenance [41].
Recent work [33, 25, 26, 13] studies the algebraic circuit size for sum-product polynomials over some semiring. While algebraic circuits are generally incomparable to -circuits, it turns out that multilinear circuits over the Boolean semiring considered in [25, 26] can be translated to -circuits with only a polynomial blow-up, but not vice versa. In this sense, our lower bounds hold in a strictly more general model and also imply lower bounds for these algebraic circuits, see the full version.
As observed by Feder and Vardi [27] the problem of deciding if there is a homomorphism between two relational structures and is a generalisation of the constraint satisfaction problem. Given the generality of this problem it is unsurprisingly NP-complete. Therefore, research has focused on finding tractable restrictions, where we demand and for classes of structures ; we denote this problem by . If we set to be the class of all structures _ then we have a complete (conditional) understanding of when we have polynomial time tractability for [16, 48].
However, for left-hand-side restrictions, where we set and ask for what we have polynomial time solvability, no dichotomy is known. Still, a lot of work has been done on such restrictions. If has bounded arity we know that is in polynomial time iff there is a constant bounding the treewidth of the homomorphic core of every structure in [28, 35]. Moreover, for the counting variant the criterion is that has bounded treewidth [20]. In the general case, we do have a conditional dichotomy in the parametrised setting: there the correct criterion is that has bounded submodular width [37]. Our main results imply comparable dichotomy results for the problem of representing by a -circuit; see Section 3.1 for more details.
2 Preliminaries
Functions and Sets.
For , we write . Given a set we write to denote the power set of . Whenever writing to denote a -tuple, we write to denote its -th component; i.e., . Moreover, we write to denote the set . For a function and we write to denote the restriction of to , i.e. is defined by for all . We extend this operation to a set of such functions by setting . Given disjoint sets and two functions we define by:
We will often combine two sets of functions pairwise in this way. Formally, for a set of functions with domain and a set of functions with domain we define . We also use to denote Cartesian product in the normal sense; we can overcome this seeming mismatch by viewing a function as a tuple with coordinates in bijection with such that the -th coordinate is .
Graphs and Hypergraphs.
A hypergraph is a pair, consisting of a finite set of vertices and a finite set of edges . If , for every , we say that is a graph. Via this definition we are implicitly assuming that all graphs are undirected and simple, i.e., that they do not contain self-loops. We write for the complete graph on vertices, which we also call the -clique. Given a hypergraph and a subset , an edge cover of is a set such that for all there is some with . A fractional edge cover of is the natural fractional relaxation, i.e. a function , such that for every , we have that . We write . Then – the fractional edge cover number of – is defined to be the minimum of over all fractional edge covers of .
We extend functions to subsets of in the natural way, i.e. by setting . A fractional independent set of is a map , such that for every , ; or equivalently for every . Note that by LP duality the weight of a maximal fractional independent set agrees with the weight of a minimal fractional edge cover. Now let be the set of all functions with that satisfy the following properties:
-
1.
Monotonicity: for all ,
-
2.
Edge dominatedness: for every , and
-
3.
Submodularity: for every .
Observe that for every fractional independent set of we have .
Width Measures.
A tree decomposition of a hypergraph is a pair where is a tree and associates to every node a bag such that:
-
1.
for every the set is a non-empty connected subset of and
-
2.
for every there is some such that .
We write for the set of all tree decompositions of . The width of a tree decomposition is and the treewidth of is the minimum width of all . Note that the in the definition of treewidth is there to ensure that trees have treewidth one.
From an algorithmic point of view, the idea of treewidth is that we can perform various bottom-up computations on the tree decomposition. Since we only consider one bag at a time, if the bags are small this can allow for efficient algorithms on small treewidth hypergraphs for problems which are in general intractable. For this, and other reasons, treewidth has become an incredibly influential concept and has inspired many more sophisticated notions of width, see [30] for a survey.
Two such measures are relevant in this paper: fractional hypertree width and submodular width. The fractional hypertree width of a tree decomposition is defined to be the maximum value of over all . The fractional hypertree width of a hypergraph is the minimum fractional hypertree width over all tree decomposition of , in symbols
So if has low fractional hypertree width then there is a tree decomposition where every bag has small fractional edge cover number.
The definition of submodular width is slightly more involved: if has low submodular width then for every there is a tree decomposition where every bag evaluates to a small number under . To be precise, the submodular width of is defined to be
From the definitions, one can see that . Moreover, Marx proved that [37, Proposition 3.7.].
Structures and Homomorphisms.
A (relational) signature is a set of relation symbols , each equipped with an arity . We assume all signatures are finite. A (finite, relational) -structure consists of a finite set (the universe of ) and relations for every -ary relation symbol . The size of is defined to be and the arity of is the maximum arity of all relations in .
The Gaifman graph of is the graph with vertex set and edges for any distinct that occur together in a tuple of a relation in . We say is connected if its Gaifman graph is connected and we will henceforth assume that all structures are connected. All of our results can be easily extended to disconnected structures. The hypergraph of a -structure is a hypergraph with vertex set such that is an edge iff there is a tuple for some , such that .
For , the -width of a structure is the -width of its hypergraph. For a class of structures , we write , which may be infinite. If is finite we say that has bounded treewidth, otherwise we say it has unbounded treewidth. We define the analogous notions for fractional hypertree and submodular width. It is known that there are classes of structures with bounded fractional hypertree width but unbounded treewidth [29] and a class of structures with bounded submodular width but unbounded fractional hypertree width [36]. If there is some integer such that every structure in has arity at most , we say that has bounded arity. In this case, has bounded treewidth iff has bounded fractional hypertree width iff has bounded submodular width.
Finally, a homomorphism from to is a function that preserves all relations, i.e., for every -ary and it holds that . We write for the set of all homomorphisms from to .
3 Homomorphisms and -Circuits
In this section, we define -circuits and explain how they can be used to represent sets of homomorphisms. We roughly follow the presentation of Amarilli and Capelli [2]. Let be a pair of finite sets. Then a -labelled DAG over is a vertex-labelled directed acyclic graph with a unique sink such that every internal (i.e. non-source) node has fan-in two and is labelled by either or and every source is labelled with an expression of the form , where and . We call the set the variables and the set the domain. We call nodes labelled by -gates and sources input-gates or just inputs.
For a -labelled DAG over and a node of , we say that a variable occurs below if there is an input node labelled with for some , such that there is a directed path from to in . We write for the set of variables occurring below and for the set of all variables occurring in the DAG. With these notions in hand we can now define the main representation format studied in this paper.
Definition 4 (-circuit).
A -circuit over is a -labelled DAG over with such that
-
1.
for every -gate in with children we have , and
-
2.
for every -gate in with children we have .
Such circuits compute a set of mappings from bottom up by taking unions at -gates and Cartesian products at -gates. Conditions (1) and (2), called decomposability [21] and smoothness respectively in the knowledge compilation literature, ensure this process is well-defined. Formally, we define the semantics of -circuit by associating with each gate the set of functions computed by the subcircuit of rooted at . We define this as follows.
Note that in the -gate case, is well-defined by (1). Moreover, by (2) we obtain that every function in has domain . We write where is the unique sink of . This leads to the following.
Definition 5.
Let be structures and be a -circuit over . Then we say that computes if .
As in the above definition, if a -circuit computes then we always assume that and . We define the size of , a -circuit, to be the number of vertices in the underlying graph and denote this by .
A -circuit is deterministic if the subcircuits rooted at the children of every -gate compute disjoint sets of functions [22]. Formally, we require that for every -gate , with children , we have that . Given a deterministic -circuit one can compute in linear time by going bottom up in the circuit, adding at every -gate and multiplying at every -gate.
Remark 6.
Our stipulation that -circuits are fan-in two is mainly a matter of taste since these circuits can simulate arbitrary fan-in circuits with only a quadratic size blow up. We make this choice since it is more convenient for proving lower bounds (see Section 4) but Theorems 2 and 3 also hold – via this quadratic simulation – for unbounded fan-in -circuits. Similarly smoothness – condition (2) in our definition of -circuits – is only enforced for convenience; one can get a sensible representation format without this condition, see e.g. [2]. Moreover, one can turn an “unsmooth” -circuit into an equivalent smooth one in quadratic time [23].
3.1 Upper Bounds On Representation Size
We now formally define the problem studied in this paper. Given a class of structures the problem - is, given and a second structure as input, to produce a -circuit computing . In the rest of this section we lay out the state of the art for this problem starting with the following result by Olteanu and Závodný.
Theorem 7 ([42]).
If has bounded fractional hypertree width then - is polynomial time solvable. More precisely, given structures and with fractional hypertree width , we can construct a deterministic -circuit computing of size in time .
Since the above algorithm outputs a deterministic -circuit this allows us to compute in polynomial time given that has bounded fractional hypertree width. Moreover, the output circuit also admits efficient algorithms for enumeration [42, 1], sampling [46] and direct access [18].
In the bounded arity setting, classes of bounded fractional hypertree width (= classes of bounded treewidth) are the only classes where - is polynomial time solvable. This follows from a lower bound proved in our previous work.
Theorem 8 ([12]).
Let be an integer. Then there is an such that for every structure of arity at most there exist arbitrarily large structures such that any -circuit for has size at least .
Our Theorem 2 improves the exponent to . This shows that – on classes of bounded arity structures – the algorithm from Olteanu and Závodný is optimal, in that we cannot improve the exponent by more than a constant factor.
Remark 9.
The constant in Theorem 8, satisfies . This is based on the tightest bounds we currently have for the Excluded Grid Theorem [45, 19]. Improved bound for the Excluded Grid Theorem would imply a higher value of . However, even if the current best lower bound [45] on the Excluded Grid Theorem turned out to be tight this would only imply that . Thus to obtain the tight lower bounds of Theorem 2 we need to develop different techniques to circumvent the Excluded Grid Theorem.
When we do not impose a bound on the arity the situation is much less understood; we do not even have a good understanding of when is polynomial time solvable. We have a better grasp if we allow FPT running times, i.e. one that may depend arbitrarily on but only polynomially on . In this setting, - is tractable for some classes of structures with unbounded fractional hypertree width.
Theorem 10 ([37, 10]).
If has bounded submodular width then - is FPT time solvable. More precisely, for all structures and we can construct a -circuit computing of size in time , where are computable functions and can be arbitrary small.
Note that [37, 10] do not mention -circuits; they are instead concerned with enumeration and decision algorithms respectively. But it is easy to adapt their algorithm to output the required circuit, see Appendix A in the full version of [11] for more details.
Our Theorem 3 implies that if has unbounded submodular width then there is no FPT time algorithm for -. However, there is still a vs gap in the exponents. Another thing to note is that since the -circuits from Theorem 10 are not deterministic, the resulting representations of are not as useful algorithmically. Despite this, they can still be used to achieve constant delay enumeration with FPT preprocessing [10] and approximate counting in FPT time [39].
4 Lower Bounds for -Circuits via Rectangle Covers
In this section, we introduce a by now standard framework – pioneered in [15] – for proving lower bounds on -circuits and their subclasses: analysing rectangle covers. This enables us to reduce reasoning about complicated objects (-circuits) to simple ones (combinatorial rectangles). For this we need the following definition.
Definition 11.
Let be a finite set, a partition of , and a set of functions with domain . Then is a -rectangle iff .
Example 12.
Let , and . Further let , where and . Then is not a -rectangle. To see this note that contains the map . On the other hand, the set of functions is a -rectangle.
Note that trivially every set of functions with domain is a -rectangle. To get a non-trivial notion we introduce the notion of a balanced partition; that is a partition of such that . We then say a set is a balanced rectangle, if it is a -rectangle for some balanced partition . We say that a set of balanced rectangles is a balanced rectangle cover for if . The size of the balanced rectangle cover is defined to be , i.e. the number of rectangles in the cover. The following lemma shows that if there is a small -circuit computing , then there is a small balanced rectangle cover for .
Lemma 13 ([15, 9]).
Let be structures and let be a -circuit of size computing . Then there is a balanced rectangle cover of of size .
Therefore, to prove lower bounds on -circuits it suffices to prove lower bounds on the size of balanced rectangle covers. This result was proven for Boolean functions in [15, Theorem 6] and extended to general sets of functions in [8, Lemma 26].
In fact, we need a slight generalisation of Lemma 13 that allows us to balance rectangles with respect to some weighting function defined on subsets of the universe of . To be precise, we say that a partition of is -balanced if . We define the notions of an -balanced rectangle and an -balanced cover in the obvious way. To ensure the proof goes through we need an which is sufficiently small on singletons and which is subadditive on disjoint subsets. That is on disjoint sets , it holds that . See the full version for a proof.
Lemma 14.
Let be structures, be a -circuit computing and be a function which is subadditive on disjoint subsets and satisfying for all . Then there is a -balanced rectangle cover of of size .
Therefore, to prove lower bounds we will define for each a structure such that is large but the size of each -balanced rectangle is small, for some appropriate function . To upper bound the size of rectangles we use the following simple observation.
Observation 15.
Let be a set of functions with domain . Then
5 Tight Lower Bounds for the Bounded Arity Case
In this section, we prove Theorem 2. We first show the result for graphs and then lift it to relational structures of bounded arity. To be precise, the main part of this section is devoted to the proof of the following theorem.
Theorem 16.
Let be a graph. Then there exist arbitrarily large graphs with vertices and at least edges such that any -circuit computing has size for arbitrarily small .
To prove this result we use that every graph with high treewidth contains a set with no small balanced separator.
Definition 17 (Balanced Separator).
Let be a graph and be a non-empty set of vertices. Then we say that is a balanced separator with respect to , if for every connected component of . Further, a balanced separator with respect to is a balanced -separator with respect to if .
Lemma 18 ([43, 44]).
Let and let be a graph with . Then there is some with having no balanced -separator.
This lemma is also used in [35] to prove conditional lower bounds via fairly elaborate reductions. We are able to deploy Lemma 18 more directly and follow a similar proof strategy to [12]. A key difference is that we reason about rectangle covers rather than directly about the circuit. Our bad instances are the graphs given to us by the following lemma.
Lemma 19 ([12, Lemma 8]).
For every , there exists some such that for every sufficiently large integer there is a graph with vertices, such that
-
1.
has at least edges,
-
2.
contains no complete bipartite subgraph for , and
-
3.
the number of -cliques in is at least .
So fix some graph with , and let be as in Lemma 19. Our aim is to show that any -circuit computing has size . The strategy is to show that any balanced rectangle must be small. We do this by using the existence of a highly connected set given to us by Lemma 18. To be precise, we choose to be a set of size having no balanced -separator.
In fact, we need to use a slight variant of the above strategy. For if has underlying partition with , then it seems hard to use the properties of in a lower bound proof. To get around this problem we use Lemma 14, which recall is a weighted version of Lemma 13. Using this result we only have to consider rectangles which are balanced with respect to . Formally, we say a partition of is -balanced if . In turn, a rectangle is -balanced if its underlying partition is -balanced. By Lemma 14, to prove Theorem 16 it suffices to show that any -balanced rectangle is small. The key is that there is a large matching between the two sides of any -balanced partition. To formally state this we need the following notion: given disjoint subsets an -matching (in ) is a set of disjoint edges each of which has one endpoint in and the other in .
Lemma 20.
Let , be a graph and be a set of vertices of with no balanced -separator. Suppose is a -balanced partition of . Then there is an -matching in of size .
Proof.
Since is -balanced we may assume w.l.o.g. that
Further suppose, for a contradiction, that there exists a set of size such that removing from disconnects from . Then pick arbitrarily a set of elements of and add these to to form a set . Then . We claim that is a balanced separator with respect to .
To see this, let be a connected component of . Then either or , by the assumption on . If then . On the other hand if then
Since is an integer it follows that . Therefore, is indeed a balanced -separator, a contradiction. So there is no such set .
To construct we first choose any edge between and and delete the two endpoints. We then choose an edge between and in this new graph and repeat until and become disconnected. By the above this leads to an -matching of size at least . By exploiting this matching it is now not too hard to show that every -balanced rectangle is small; the key is that one endpoint of every edge in the matching must have small image.
Lemma 21.
Let be a -vertex graph and be a set of vertices of size with no balanced -separator. Further, let be the graph given by Lemma 19, for some sufficiently big and let be a -balanced rectangle. Then
Proof.
Let be the underlying partition of . By Lemma 20, there is an -matching of size . Let with . Further define,
Then for every and , there is an edge in between and . To see this, let with and . Hence , since is an -rectangle. Therefore, since , we have that . It follows that either or , since contains no subgraph by Lemma 19(2). Moreover, by definition and .
Since the above holds for every , there are at least vertices such that . The result follows by Observation 15. To infer Theorem 16, first observe that by Lemma 19(3), . Here we use the fact that any mapping whose image is a clique is a homomorphism. Therefore, by Lemmas 14 and 21 the result follows; see the full version for details.
We next lift this to relational structures. We could do this similarly to the above. However, it is convenient to instead use the following reduction result from [12].
Lemma 22 ([12, Lemmas 14-16]).
Let and let be a -structure with arity at most . Let be the Gaifman graph of and suppose that there exists a graph such that any -circuit computing has size at least . Then there is a -structure with and a function such that any -circuit computing has size at least .
Proof of Theorem 2.
Let be the Gaifman graph of and let be an integer. Then since the treewidth of is the same as the treewidth of we may apply Theorem 16, to obtain a graph with vertices and at least many edges such that any -circuit computing has size . Therefore, by Lemma 22, there is a -structure with such that any -circuit for has size , since is a constant and by choosing (and hence ) to be sufficiently big. Note that some form of dependence on the arity is necessary since there are classes of structures of unbounded treewidth such that solving - is in polynomial time, e.g. classes of unbounded treewidth but bounded fractional hypertree width. Such classes must have unbounded arity; we next turn to this setting.
6 Submodular Width Lower Bound
In this section we prove Theorem 3. Our strategy is analogous to the one used in Section 5: we use the fact that high submodular width implies the existence of a “highly connected set”. However, the exact notion of highly connectedness is more complicated and we need to define our bad instances more carefully. As such we first make some preparations.
6.1 Preliminaries to the Proof
Fix a -structure and let be the hypergraph of . We use similar notation to [37]. A path in is a sequence of vertices forming a path in the Gaifman graph of . The endpoints of the path are the first and last vertex in this sequence. For we say a path is an -path if it starts in and ends in . Let denote the set of paths in . A flow of is an assignment such that for every ,
If , then we say that appears in or is a path of . The value of is . For a flow is an -flow if only -paths appear in . If are flows then their sum is the mapping which assigns weight to each path . If this mapping happens to also be a flow then we say that the are compatible.
For the characterisation of submodular width we will deploy the following notion is crucial. Let be subsets of . Then a uniform concurrent flow of value on is a collection of compatible flows , with such that is an flow of value exactly . If is connected in then by choosing one path connecting each pair and assigning this path weight we obtain a uniform concurrent flow with value . The next theorem says that if has high submodular width then there is a “large” set which can be partitioned into cliques admitting a uniform concurrent flow with value beating the trivial lower bound. This characterisation is obtained and used by Marx in [37] and follows from Theorem 5.1 and Lemmas 6.5 and 6.6 in that paper.
Theorem 23 ([37]).
Let be a relational structure with and hypergraph . Then there exists a set which can be partitioned into where each for some and , such that there is a uniform concurrent flow of value on .
Marx uses these flows to show that hypergraphs of high submodular width have high “embedding power”. We argue differently and more directly.
6.2 Lower Bound
6.2.1 Simplifying the Structures
In this section we show that in order to prove Theorem 3 it suffices to prove lower bounds for left-hand-side structures of a simple form. This is straightforward so we just describe the simplification here. See the full version for a proof of correctness.
We first need some definitions. Let be a signature and be -structures. We say that is coordinate respecting (relative to ) if for every and every distinct it holds that . In this case we define
Note that is empty for all . Since is normally clear from the context we often write for .
Next let be a -structure such that every relation contains exactly one tuple. Let be a total order on and be some -tuple with coordinates in . Moreover, suppose has distinct coordinates. Then we define to be the unique -tuple with whose coordinates are ordered by . Then if is the unique tuple in and if is an -tuple we define to be a fresh -ary relation symbol and define . Now we define the -structure to have universe and such that where is the unique tuple in . Moreover, we say that is order respecting if for some total order .
Let be a -structure which is coordinate respecting relative to . Then induces a partial order on as follows. For , iff there are distinct with , and . We say that is order respecting relative to if for every and every , we have that for all .
To prove Theorem 3 it suffices to prove the following result, see the full version for details.
Theorem 24.
Let be an order respecting structure where every relation contains exactly one tuple. Then there exist arbitrarily large structures which are coordinate and order respecting relative to and such that any -circuit computing has size .
In our proof of Theorem 24, we often want to go between sets and tuples. Of course, for every tuple there is a naturally corresponding set . But in the other direction given a set there are many possible corresponding tuples. This is why it is nice to work with respecting an order on . Now for any , we define to be the unique tuple respecting the order whose coordinates are the elements of . We can similarly deploy this notation for any subset of which is “colourful”, in the sense that no two of its elements appear in the same set.
6.2.2 Defining the Bad Instances
Towards proving Theorem 24, let be a signature and let be an order respecting -structure such that every relation in contains exactly one tuple. Let be the hypergraph of . Further suppose so that, by Theorem 23, there exists some which can be partitioned into for some , where each is a clique such that there is a uniform concurrent flow of value on . The aim of this subsection is to define appropriate bad instances . Analogously to in the treewidth case we will use random instances. However, we need to carefully control how each vertex contributes to the number of homomorphisms from . A crucial idea is to use the flow to do this. Essentially we use to define a fractional independent set which then allows us to define an instance with relations bounded by some constant . This is similar in spirit to the upper bound of the “AGM bound” [5, Lemma 4] but we also sprinkle in some randomness to ensure hardness.
Concretely, let be a sufficiently big integer, be the hypergraph of and for , let be the set of paths in that contain the vertex . Define a map by . Then for each we define disjoint sets of elements such that . The idea is that the size of is proportional to the weight of paths in passing through . We define the random structure induced by with relations bounded by as follows. For each relation , let be the unique tuple in . Then is a random subset of , where each tuple is included independently with probability a half. Note that,
Moreover, is an edge of by definition. Since is a flow we obtain that
Here we assume w.l.o.g. that each path appearing in is minimal and therefore intersects each edge at most twice. Using this (non-standard) model of a random structure we can obtain an analogue to Lemma 19. There we showed that our bad instances did not contain any large complete bipartite subgraphs. The natural suggestion would be to look at the Gaifman graph of and show that it (with high probability) has no large complete bipartite subgraphs. However, the Gaifman graph of is very dense so this does not work. Instead the following definition gives us the analogous “badness” property in the relational setting.
Definition 25.
Let be a positive integer, a -structure and with for some an -tuple of vertices of . Then we say that is -scattered if for every partition of , the following holds. For every and , such that
either or .
The following lemma shows that the bad instances we need exist; it is proved by a simple probabilistic argument, see the full version for details.
Lemma 26.
There exists a constant such that for every sufficiently large integer there exists a -structure which is coordinate and order respecting relative to . Moreover, has universe , size and satisfies the following properties:
-
1.
, where and
-
2.
for every is -scattered.
6.2.3 Analysis
To argue about these instances we – similarly to in the treewidth case – reason about combinatorial rectangles with partitions balanced relative to the highly connected nature of . To do this we use Lemma 14, for some appropriately chosen . The natural choice seems to be to set . However, for technical reasons we instead use a closely related function which is defined by
The idea is twofold. First, we only take vertices of into account for our balancing since this is the part of we know is “highly connected”. And second, we weight each vertex according to the sum of the weights of paths in for which is an endpoint. Trivially, for every . We next observe that every has equal weight under .
Observation 27.
For every , . Moreover, .
So let be an -balanced partition. This means that globally the weight of under is (up to a constant factor) evenly split between and . However, this is not necessarily the case for each . It could, for instance, happen that every is either a subset of or a subset of . We first analyse the case where there are many values of such that the weight of under is roughly evenly split between and . To formalise this we say that is -balanced for if
It turns out that if a lot of the are balanced then we can argue very similarly to in the proof of Theorem 2, see the full version for details.
Lemma 28.
Let be an -balanced partition of and let . Suppose that is -balanced for at least values of . Then there is a constant , such that every rectangle with underlying partition has size at most .
To finish the proof we have to deal with the case where almost every is not -balanced relative to . The key is to argue that then there are many paths in which cross from into (or vice-versa). This is the core of the argument as it is where the flow is deployed. Note that in the extreme case where every is either a subset of or a subset of the argument is simple. For suppose and , then in particular every path with non-zero weight under must at some point cross from into . Moreover, since for every and since the partition is -balanced we know that the number of contained in differs only by a constant factor from the number of contained in . Therefore, the total weight of the paths crossing from into is ; the result then follows by a similar calculation to in Lemma 28. In the more general case, where can intersect both and , a similar (if slightly more involved) argument works. We give the details in the full version.
Lemma 29.
Let be sufficiently small and be an -balanced partition of , such that the number of -balanced is less than . Then there is a constant such that every with underlying partition has size .
Proof of Theorem 24.
7 Conclusions
Our main results are both proved using a framework which combines tools from communication complexity with structural (hyper)graph theory. Theorem 2 – an unconditional lower bound on - for bounded arity – shows that this framework can yield tight lower bounds. Moreover, our methods yield a much simpler proof than that of our previous (inferior) lower bound [12]. Additionally, Theorem 3 – an exact characterisation of when - is FPT-time solvable – shows that our methods are robust enough to tackle more challenging (higher arity) settings.
This opens up a number of future directions. Firstly, there is the obvious task of closing the gap between the lower bounds of Theorem 3 and the upper bounds of Theorem 10. Secondly, can we use our methods to shed light on the polynomial time solvability of -? We know this is possible if has bounded fractional hypertree width and impossible if has bounded submodular width: can we give an exact characterisation? Thirdly, it would be interesting to study this problem for other representation formats.
References
- [1] Antoine Amarilli, Pierre Bourhis, Louis Jachiet, and Stefan Mengel. A circuit-based approach to efficient enumeration. In Ioannis Chatzigiannakis, Piotr Indyk, Fabian Kuhn, and Anca Muscholl, editors, 44th International Colloquium on Automata, Languages, and Programming, ICALP 2017, July 10-14, 2017, Warsaw, Poland, volume 80 of LIPIcs, pages 111:1–111:15. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2017. doi:10.4230/LIPIcs.ICALP.2017.111.
- [2] Antoine Amarilli and Florent Capelli. Tractable circuits in database theory. SIGMOD Rec., 53(2):6–20, 2024. doi:10.1145/3685980.3685982.
- [3] Jérôme Amilhastre, Hélène Fargier, Alexandre Niveau, and Cédric Pralet. Compiling csps: A complexity map of (non-deterministic) multivalued decision diagrams. Int. J. Artif. Intell. Tools, 23(4), 2014. doi:10.1142/S021821301460015X.
- [4] Marcelo Arenas, Luis Alberto Croquevielle, Rajesh Jayaram, and Cristian Riveros. When is approximate counting for conjunctive queries tractable? In Samir Khuller and Virginia Vassilevska Williams, editors, STOC ’21: 53rd Annual ACM SIGACT Symposium on Theory of Computing, Virtual Event, Italy, June 21-25, 2021, pages 1015–1027. ACM, 2021. doi:10.1145/3406325.3451014.
- [5] Albert Atserias, Martin Grohe, and Dániel Marx. Size bounds and query plans for relational joins. In 49th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2008, October 25-28, 2008, Philadelphia, PA, USA, pages 739–748. IEEE Computer Society, 2008. doi:10.1109/FOCS.2008.43.
- [6] Paul Beame and Vincent Liew. New limits for knowledge compilation and applications to exact model counting. In Marina Meila and Tom Heskes, editors, Proceedings of the Thirty-First Conference on Uncertainty in Artificial Intelligence, UAI 2015, July 12-16, 2015, Amsterdam, The Netherlands, pages 131–140. AUAI Press, 2015. URL: http://auai.org/uai2015/proceedings/papers/111.pdf.
- [7] Christoph Berkholz, Jens Keppeler, and Nicole Schweikardt. Answering conjunctive queries under updates. In Emanuel Sallinger, Jan Van den Bussche, and Floris Geerts, editors, Proceedings of the 36th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS 2017, Chicago, IL, USA, May 14-19, 2017, pages 303–318. ACM, 2017. doi:10.1145/3034786.3034789.
- [8] Christoph Berkholz, Stefan Mengel, and Hermann Wilhelm. A characterization of efficiently compilable constraint languages. arXiv preprint arXiv:2311.10040, 2023. Full version of [9]. doi:10.48550/arXiv.2311.10040.
- [9] Christoph Berkholz, Stefan Mengel, and Hermann Wilhelm. A characterization of efficiently compilable constraint languages. In Olaf Beyersdorff, Mamadou Moustapha Kanté, Orna Kupferman, and Daniel Lokshtanov, editors, 41st International Symposium on Theoretical Aspects of Computer Science, STACS 2024, March 12-14, 2024, Clermont-Ferrand, France, volume 289 of LIPIcs, pages 11:1–11:19. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPIcs.STACS.2024.11.
- [10] Christoph Berkholz and Nicole Schweikardt. Constant delay enumeration with fpt-preprocessing for conjunctive queries of bounded submodular width. In Peter Rossmanith, Pinar Heggernes, and Joost-Pieter Katoen, editors, 44th International Symposium on Mathematical Foundations of Computer Science, MFCS 2019, August 26-30, 2019, Aachen, Germany, volume 138 of LIPIcs, pages 58:1–58:15. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2019. doi:10.4230/LIPIcs.MFCS.2019.58.
- [11] Christoph Berkholz and Harry Vinall-Smeeth. A dichotomy for succinct representations of homomorphisms. arXiv preprint arXiv:2209.14662, 2022. Full version of [12]. doi:10.48550/arXiv.2209.14662.
- [12] Christoph Berkholz and Harry Vinall-Smeeth. A dichotomy for succinct representations of homomorphisms. In Kousha Etessami, Uriel Feige, and Gabriele Puppis, editors, 50th International Colloquium on Automata, Languages, and Programming, ICALP 2023, July 10-14, 2023, Paderborn, Germany, volume 261 of LIPIcs, pages 113:1–113:19. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2023. doi:10.4230/LIPIcs.ICALP.2023.113.
- [13] C. S. Bhargav, Shiteng Chen, Radu Curticapean, and Prateek Dwivedi. Monotone bounded-depth complexity of homomorphism polynomials. In Pawel Gawrychowski, Filip Mazowiecki, and Michal Skrzypczak, editors, 50th International Symposium on Mathematical Foundations of Computer Science, MFCS 2025, August 25-29, 2025, Warsaw, Poland, volume 345 of LIPIcs, pages 19:1–19:18. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2025. doi:10.4230/LIPIcs.MFCS.2025.19.
- [14] Beate Bollig and Martin Farenholtz. On the relation between structured d-dnnfs and sdds. Theory Comput. Syst., 65(2):274–295, 2021. doi:10.1007/S00224-020-10003-Y.
- [15] Simone Bova, Florent Capelli, Stefan Mengel, and Friedrich Slivovsky. Knowledge compilation meets communication complexity. In Subbarao Kambhampati, editor, Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence, IJCAI 2016, New York, NY, USA, 9-15 July 2016, pages 1008–1014. IJCAI/AAAI Press, 2016. URL: http://www.ijcai.org/Abstract/16/147.
- [16] Andrei A. Bulatov. A dichotomy theorem for nonuniform csps. In Chris Umans, editor, 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, Berkeley, CA, USA, October 15-17, 2017, pages 319–330. IEEE Computer Society, 2017. doi:10.1109/FOCS.2017.37.
- [17] Florent Capelli. Understanding the complexity of #sat using knowledge compilation. In 32nd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2017, Reykjavik, Iceland, June 20-23, 2017, pages 1–10. IEEE Computer Society, 2017. doi:10.1109/LICS.2017.8005121.
- [18] Florent Capelli and Oliver Irwin. Direct access for conjunctive queries with negations. In Graham Cormode and Michael Shekelyan, editors, 27th International Conference on Database Theory, ICDT 2024, March 25-28, 2024, Paestum, Italy, volume 290 of LIPIcs, pages 13:1–13:20. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPIcs.ICDT.2024.13.
- [19] Julia Chuzhoy and Zihan Tan. Towards tight(er) bounds for the excluded grid theorem. Journal of Combinatorial Theory, Series B, 146:219–265, 2021. doi:10.1016/j.jctb.2020.09.010.
- [20] Víctor Dalmau and Peter Jonsson. The complexity of counting homomorphisms seen from the other side. Theor. Comput. Sci., 329(1-3):315–323, 2004. doi:10.1016/J.TCS.2004.08.008.
- [21] Adnan Darwiche. Decomposable negation normal form. J. ACM, 48(4):608–647, 2001. doi:10.1145/502090.502091.
- [22] Adnan Darwiche. On the Tractable Counting of Theory Models and its Application to Truth Maintenance and Belief Revision. J. Appl. Non Class. Logics, 11(1-2):11–34, 2001. doi:10.3166/JANCL.11.11-34.
- [23] Adnan Darwiche and Pierre Marquis. A Knowledge Compilation Map. J. Artif. Intell. Res., 17:229–264, 2002. doi:10.1613/JAIR.989.
- [24] Alexis de Colnet and Stefan Mengel. Characterizing tseitin-formulas with short regular resolution refutations. J. Artif. Intell. Res., 76:265–286, 2023. doi:10.1613/JAIR.1.13521.
- [25] Austen Z. Fan, Paraschos Koutris, and Hangdong Zhao. Tight bounds of circuits for sum-product queries. Proc. ACM Manag. Data, 2(2):87, 2024. doi:10.1145/3651588.
- [26] Austen Z. Fan, Paraschos Koutris, and Hangdong Zhao. Circuit bounds for conjunctive queries with self-joins. Proc. ACM Manag. Data, 3(2):92:1–92:24, 2025. doi:10.1145/3725229.
- [27] Tomás Feder and Moshe Y. Vardi. Monotone monadic SNP and constraint satisfaction. In S. Rao Kosaraju, David S. Johnson, and Alok Aggarwal, editors, Proceedings of the Twenty-Fifth Annual ACM Symposium on Theory of Computing, May 16-18, 1993, San Diego, CA, USA, pages 612–622. ACM, 1993. doi:10.1145/167088.167245.
- [28] Martin Grohe. The complexity of homomorphism and constraint satisfaction problems seen from the other side. J. ACM, 54(1):1:1–1:24, 2007. doi:10.1145/1206035.1206036.
- [29] Martin Grohe and Dániel Marx. Constraint solving via fractional edge covers. ACM Trans. Algorithms, 11(1):4:1–4:20, 2014. doi:10.1145/2636918.
- [30] Petr Hlinený, Sang-il Oum, Detlef Seese, and Georg Gottlob. Width parameters beyond tree-width and their applications. Comput. J., 51(3):326–362, 2008. doi:10.1093/COMJNL/BXM052.
- [31] Abhay Kumar Jha and Dan Suciu. Knowledge compilation meets database theory: compiling queries to decision diagrams. In Tova Milo, editor, Database Theory - ICDT 2011, 14th International Conference, Uppsala, Sweden, March 21-24, 2011, Proceedings, pages 162–173. ACM, 2011 . doi:10.1145/1938551.1938574.
- [32] Angelika Kimmig, Guy Van den Broeck, and Luc De Raedt. Algebraic model counting. J. Appl. Log., 22:46–62, 2017. doi:10.1016/J.JAL.2016.11.031.
- [33] Balagopal Komarath, Anurag Pandey, and Chengot Sankaramenon Rahul. Monotone arithmetic complexity of graph homomorphism polynomials. In Mikolaj Bojanczyk, Emanuela Merelli, and David P. Woodruff, editors, 49th International Colloquium on Automata, Languages, and Programming, ICALP 2022, July 4-8, 2022, Paris, France, volume 229 of LIPIcs, pages 83:1–83:20. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2022. doi:10.4230/LIPIcs.ICALP.2022.83.
- [34] Frédéric Koriche, Jean-Marie Lagniez, Pierre Marquis, and Samuel Thomas. Compiling constraint networks into multivalued decomposable decision graphs. In Qiang Yang and Michael J. Wooldridge, editors, Proceedings of the Twenty-Fourth International Joint Conference on Artificial Intelligence, IJCAI 2015, Buenos Aires, Argentina, July 25-31, 2015, pages 332–338. AAAI Press, 2015. URL: http://ijcai.org/Abstract/15/053.
- [35] Dániel Marx. Can you beat treewidth? Theory Comput., 6(1):85–112, 2010. doi:10.4086/TOC.2010.V006A005.
- [36] Dániel Marx. Tractable structures for constraint satisfaction with truth tables. Theory Comput. Syst., 48(3):444–464, 2011. doi:10.1007/S00224-009-9248-9.
- [37] Dániel Marx. Tractable hypergraph properties for constraint satisfaction and conjunctive queries. J. ACM, 60(6):42:1–42:51, 2013. doi:10.1145/2535926.
- [38] Robert Mateescu and Rina Dechter. Compiling constraint networks into AND/OR multi-valued decision diagrams (aomdds). In Frédéric Benhamou, editor, Principles and Practice of Constraint Programming - CP 2006, 12th International Conference, CP 2006, Nantes, France, September 25-29, 2006, Proceedings, volume 4204 of Lecture Notes in Computer Science, pages 329–343. Springer, 2006. doi:10.1007/11889205_25.
- [39] Kuldeep S Meel and Alexis de Colnet. # CFG and# DNNF admit FPRAS. arXiv preprint arXiv:2406.18224, 2024. Accepted at SODA 2026.
- [40] Dan Olteanu. Recent increments in incremental view maintenance. In Floris Geerts and Wim Martens, editors, Companion of the 43rd Symposium on Principles of Database Systems, PODS 2024, Santiago, Chile, June 9-15, 2024, pages 8–17. ACM, 2024. doi:10.1145/3635138.3654763.
- [41] Dan Olteanu and Jakub Zavodny. Factorised representations of query results: size bounds and readability. In Alin Deutsch, editor, 15th International Conference on Database Theory, ICDT ’12, Berlin, Germany, March 26-29, 2012, pages 285–298. ACM, 2012. doi:10.1145/2274576.2274607.
- [42] Dan Olteanu and Jakub Závodný. Size bounds for factorised representations of query results. ACM Trans. Database Syst., 40(1):2:1–2:44, 2015. doi:10.1145/2656335.
- [43] Bruce Reed. Tree width and tangles: a new connectivity measure and some applications. Surveys in combinatorics, 241:87–162, 1997.
- [44] Neil Robertson and Paul D Seymour. Graph minors. xiii. the disjoint paths problem. Journal of combinatorial theory, Series B, 63(1):65–110, 1995. doi:10.1006/JCTB.1995.1006.
- [45] Neil Robertson and Paul D. Seymour. Graph minors. XVI. excluding a non-planar graph. J. Comb. Theory B, 89(1):43–76, 2003. doi:10.1016/S0095-8956(03)00042-X.
- [46] Shubham Sharma, Rahul Gupta, Subhajit Roy, and Kuldeep S. Meel. Knowledge compilation meets uniform sampling. In Gilles Barthe, Geoff Sutcliffe, and Margus Veanes, editors, LPAR-22. 22nd International Conference on Logic for Programming, Artificial Intelligence and Reasoning, Awassa, Ethiopia, 16-21 November 2018, volume 57 of EPiC Series in Computing, pages 620–636. EasyChair, 2018. doi:10.29007/H4P9.
- [47] Harry Vinall-Smeeth. Structured d-DNNF is not closed under negation. In Proceedings of the Thirty-Third International Joint Conference on Artificial Intelligence, IJCAI 2024, Jeju, South Korea, August 3-9, 2024, pages 3593–3601. ijcai.org, 2024. URL: https://www.ijcai.org/proceedings/2024/398.
- [48] Dmitriy Zhuk. A proof of the CSP dichotomy conjecture. J. ACM, 67(5):30:1–30:78, 2020. doi:10.1145/3402029.
