Abstract 1 Introduction 2 Preliminaries 3 𝒌-Independent Set in Non-Uniform Hypergraphs 4 Binary Constraint Families and The Effects Of Sparsity References

When Does Sparsity Help for k-Independent Set in Hypergraphs and Other Boolean CSPs?

Timo Fritsch ORCID Karlsruhe Institute of Technology, Germany    Marvin Künnemann ORCID Karlsruhe Institute of Technology, Germany    Mirza Redzic ORCID Karlsruhe Institute of Technology, Germany    Julian Stieß ORCID Karlsruhe Institute of Technology, Germany
Abstract

Consider the fundamental task of finding independent sets of (constant) size k in a given n-node hypergraph. How much is the time complexity affected by the sparsity of the input, i.e., the number of hyperedges m? Turán’s theorem implies that the problem is trivial if m=O(n2ϵ) for some ϵ>0. Above that threshold (i.e., if m=Θ(nγ) for some γ2), we give a perhaps surprising algorithm with running time O(min{nω3k+mk/3,nk}) (for k divisible by 3), which is essentially conditionally optimal for all γ2, assuming the k-clique and 3-uniform hyperclique hypotheses (here, ω2.372 denotes the matrix multiplication exponent). In fact, we obtain a more detailed time complexity that is sensitive to the arity distribution of the hyperedges.

To study such phenomena in more generality, we study the time complexity of finding solutions of (constant) size k in sparse instances of Boolean constraint satisfaction problems, where n and m denote the number of variables and constraints, respectively. Our results include, among others:

  • an essentially full classification of the influence of sparsity for Boolean constraint families of binary arity. Of particular technical interest is a conditionally tight algorithm for the family consisting of the binary NAND and the binary Implication constraints, with a running time of Θ(mωk/6±c).

  • the identification of a large class of constraint families that exhibits a sharp phase transition: there is a threshold γ such that the problem is trivial for m=O(nγϵ), but requires essentially brute-force running time Θ(nk±c) for m=Ω(nγ), assuming the 3-uniform hyperclique hypothesis.

In general, we observe a rich landscape of time complexities. Notably, in many cases the combination of constraints display higher time complexity than either constraint alone.

Keywords and phrases:
Multivariate algorithmics, fine-grained complexity theory, classification theorems, algorithmic hypergraph theory
Category:
Track A: Algorithms, Complexity and Games
Funding:
Marvin Künnemann: Research partially supported by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – 462679611.
Mirza Redzic: Research partially supported by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – 462679611.
Julian Stieß: Research partially supported by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – 462679611.
Copyright and License:
[Uncaptioned image] © Timo Fritsch, Marvin Künnemann, Mirza Redzic, and Julian Stieß; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Graph algorithms analysis
; Theory of computation Problems, reductions and completeness
Related Version:
Full Version: https://arxiv.org/abs/2605.10778
Editors:
Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele Puppis

1 Introduction

How does sparsity of the input influence a problem’s time complexity? From an algorithmic perspective, such questions have been well studied particularly for graph-theoretic problems, as many real-world graphs are rather far from dense. Indeed, for a problem solvable in time nc±o(1) on n-node graphs, a natural target to shoot for is an mc/2±o(1)-time algorithm, where m denotes the number of edges in the graph. Such an algorithm recovers the time bound of nc±o(1) in the dense case m=Θ(n2), while significantly improving the running time if m=O(n2ϵ) – we shall refer to such a situation as a natural interpolation. For many graph problems, natural interpolation is indeed achievable. Much less is known on the hardness side. Nevertheless, a growing body of work establishes conditional lower bounds ruling out natural interpolation for several fundamental problems. Notable examples include: approximate Diameter and Radius [26, 4], All-Edges Triangle Detection [25, 30], APSP and related problems [21], k-Dominating Set for k3 [15] and more; see also [5].

The goal of this work is to investigate the rich interplay of the input sparsity and the resulting time complexity. Particularly, we focus on cases in which instead of achieving a natural interpolation, the running time exhibits a complex relationship with the sparsity – possibly overshooting or undershooting natural interpolation, or both. Predominantly, we investigate problems beyond graphs, specifically, hypergraph problems as well as constraint satisfaction problems. In such problems, n objects (nodes or variables) interact in a combination of relationships (hyperedges of different arity or constraints of different types). If each relation or constraint has arity at most r, then the sparsity m (i.e., the total size of these relationships) is bounded by O(nr). In these cases, for an nc±o(1)-time solvable problem, we denote the natural interpolation as a running time of the form mc/r±o(1). We shall see several cases in which this running time is partially achievable, using conditionally optimal algorithms that carefully consider the combination of relationships.

1.1 Result I: Conditionally Optimal 𝒌-Independent Set in Sparse Hypergraphs

As our first focus, we consider the k-Independent Set problem (k-IS) in hypergraphs: Given a (hyper)graph G=(V,E), determine if there is a set SV of size k that contains no (hyper)edge of G, i.e., eS for all eE. Already in graphs, k-IS is central to algorithmic graph theory: by complementing the graph, we obtain the classic k-clique problem, perhaps the best known W[1]-complete problem.111Note however, that complementing a sparse graph generally yields a dense graph, so that the influence of sparsity differs between k-clique and k-IS. Generalizing to hypergraphs, we obtain a significantly more expressive problem. Indeed, for 3-uniform hypergraphs, it is equivalent (up to sparsity) to the 3-uniform hyperclique problem. This problem is generally considered to be more difficult than k-clique; the corresponding 3-uniform hyperclique hypothesis has seen a surge of applications recently, see [21, 2, 7, 20, 8, 13, 23, 16, 17], among others (see below for further discussion). As a further case in point, note that the fairly recent hypergraph container method (see, e.g., [6]) gives a combinatorial tool for independent sets in well-behaved hypergraphs, which has found various applications, including in algorithm design [32].

We ask: Let k2 and γ0 be constants. What is the time complexity of k-Independent Set in n-node hypergraphs with m=Θ(nγ) hyperedges?

Let us first consider the case of graphs rather than hypergraphs. Here, 0γ2, and without taking sparsity into account, k-IS is well known to be solvable in time O(n(ω/3)k) [24]222Whenever k is divisible by 3; in other cases, the running time is only slightly higher.; the k-clique hypothesis postulates that this running time is essentially optimal. However, taking sparsity into account, the problem becomes trivial when γ<2, i.e., m=O(n2ϵ): This already follows from Turán’s Theorem, which implies that any n-node graph with at most (1k1o(1))n22 edges contains an independent set of size k.

The case for h-uniform hypergraphs with r3 can be resolved analogously: Without taking sparsity into account, no substantial improvement over brute-force running time O(nk) is known (see [3] for subpolynomial-factor improvements), and the 3-uniform hyperclique hypothesis postulates that this is best possible. While generalizing Turán’s theorem to hypergraphs is challenging (see, e.g., [18]), a simple greedy argument establishes that k-IS in h-uniform hypergraphs with γ<h (i.e., the hypergraph contains mO(nhϵ) hyperedges) is again trivial. Thus, for any arity 2hk1, the k-IS problem in h-uniform hypergraphs is non-trivial only for the hardest, dense case of γ=h.333The case of h=k is trivial for all γ<k and trivially solvable in linear time in the input if γ=k.

We thus turn to the general case of hypergraphs with possibly mixed-arity hyperedges. We may assume without loss of generality that γk, since we may simply ignore any edge of arity at least k+1. The problem is trivial only for γ<2. How does the problem’s complexity behave in between? E.g., how quickly can we solve k-IS when we have, say, Θ(n2) edges (of binary arity) and Θ(n2.5) hyperedges of arity 3?

In this case, we determine a conditionally optimal running time of O(n(5/6)k±c), which is intermediate between O(n(ω/3)k±c) and O(nk±c). More generally, we obtain the following result.

Theorem 1.

Assuming the Clique and the 3-uniform Hyperclique Hypothesis, the optimal running time for k-Independent Set in n-node hypergraphs with m hyperedges, each of arity at least 2, is

min{nω3k+mk/3,nk},

up to a factor of the form O(nc) for some c independent of k.

For an illustration, we refer to Figure 2(a) – note that for ωγ3, and only there, natural interpolation is obtained. In fact, we give a much more detailed statement that takes the arity distribution into account, see Section 1.3.

Technically, our result relies on a very careful combination of ideas, which overcomes the challenge of incorporating different ways to handle edges of different arity. The main technical obstacle here is that the well known k-clique algorithm in graphs due to Nešetřil and Poljak [24] is not well compatible with including any hyperedge of arity at least 3. However, exploiting that it can be used to count all k-cliques as well, we seek to count all k-cliques on the (binary-arity) edges, and subtract from this count the number of solutions including any of the m hyperedges of larger arity. To solve this task, we present a careful argument based on inclusion-exclusion and sparse witness listing in Section 1.3.444We remark that the idea of using inclusion-exclusion in combination with fast clique/triangle counting has been used in prior work, e.g., to obtain a O(m2ω/(ω+1))-time algorithm for counting 3-ISes [29, Footnote 2]. In our work, we exploit these ingredients further to overcome a different challenge, i.e., handling the presence of mixed-arity edges.

We now turn towards a vastly more general setting, specifically, the class of Boolean constraint satisfaction problems, which includes the k-IS problem in hypergraphs as just one of many interesting examples.

1.2 Result II: On the Influence of Sparsity for Boolean CSPs

Boolean constraint satisfaction has long served as a challenge for understanding the precise limits of our algorithmic and complexity-theoretic methods. The extensive list of such works includes classifications of tractability in terms of P vs NP-complete [27, 33, 10], counting complexity [9], parameterized complexity [22, 11], approximability [19] and many more. We wish to explore how sparsity affects the fine-grained time complexity investigated in [20].

Formally, we define, for any finite constraint family and γ>0, the algorithmic problem Cspkγ(): given a set of m=Θ(nγ) constraints, each formed by applying some function f:{0,1}r{0,1} on a set of r pairwise distinct Boolean variables chosen from x1,,xn, determine whether there exists an assignment that sets precisely k variables to true and satisfies all constraints. For a singleton family ={f}, we also write Cspkγ(f). Throughout the paper, we consider k as a constant independent of n.

Note that this class contains k-IS in h-uniform hypergraphs with m=Θ(nγ) hyperedges as Cspkγ(NANDh), where NANDh(y1,,yh)=y1yh¯. It also contains k-IS in mixed-arity hypergraphs as Cspkγ({NAND2,,NANDk}).

We ask: What determines the influence of sparsity for detecting size-k solutions of Boolean CSPs?

Generally speaking, we obtain a full555Full with regard to the effects of sparsity, as the classification is not tight for Cspkγ(IMPL), for which the precise complexity is unclear in the dense case already. classification for constraint families consisting exclusively of functions of binary arity. For higher-arity constraint functions, we give a large subclass of CSPs exhibiting a precise cutoff point: for sparser instances, the problem is trivial, for denser instances, it is essentially as hard as the dense case.

Classification for Binary Constraint Families

Without taking sparsity into account, previous works [22, 20] establish the following regimes within the Boolean constraint families: (1) problems fine-grained equivalent to Cspk(NAND), (2) problems fine-grained equivalent to Cspk(IMPL) where IMPL(x,y)=xy, and (3) FPT problems.

For the two central hard CSPs, it is not too difficult to establish the following baselines (see Section 4):

  1. 1.

    Cspkγ(NAND), i.e., k-IS in graphs, is trivial if γ<2 and has complexity O(nωk/3±c) if γ=2, assuming the clique hypothesis.

  2. 2.

    Cspkγ(IMPL) is trivial if γ<1 and has time complexity ng(k) uniformly for all 1γ2, where Ω(k3)g(k)O(k), assuming the clique hypothesis.

We find that surprisingly, the combined constraint family {IMPL,NAND} has higher time complexity for all 1γ<2 than either IMPL or NAND individually.

Theorem 2.

Assuming that the clique hypothesis holds. The optimal time complexity for Cspkγ({NAND,IMPL}) is Θ(mωk/6±c) for some c independent of k.666By slight use of notation, in the introduction we write Θ(nf(k)±c) to express existence of an algorithm with running time O(nf(k)+c) and a conditional lower bound of Ω(nf(k)c).

Thus, for 1γ<2, while Cspkγ(NAND) is trivial and Cspkγ(IMPL) has a subexponential time complexity ng(k), the combination of both constraints has an exponential time complexity that is a natural interpolation of the k-IS running time.

The above theorem consists of two parts: (1) a conditional lower bound and (2) a matching algorithm. The conditional lower bound is strikingly simple: We can introduce nn0 IMPL-constraints enforcing that any satisfying assignment with k nonzeroes chooses its nonzero variables from a set V0V of size n0. On V0, we embed an arbitrary, possibly dense instance as long as n02=O(m). By choosing n0m, we can reduce from a k-clique instance in an m-vertex graph, yielding a conditional lower bound of mkω/6o(1), as desired.

The corresponding upper bound does not follow as easily. To beat time O(nωk/3) when the input contains only few NAND- and IMPL-constraints, one might hope for a “reversal” of the reduction in the conditional lower bound: is it possible to quickly “peel off” most of the variables so that a small set of O(m) variables survives? Unfortunately, possibly intricate interactions between IMPL- and NAND-constraints prevent simple preprocessing schemes. Instead, we perform a careful combination of arguments: We first preprocess the instance to obtain a structured setting in which crucially each variable implies at most one other variable. We use this structured setting to group the variables, yielding a win-win argument: Either (1) there exists a “large” group with few NAND constraints, and we can detect a solution within this single group greedily, or (2) all groups are “small”. In this case, we carefully reduce to an almost-balanced Triangle Detection instance. For more details, we refer to Section 1.3 and the full proof in Section 4.

Interestingly, we observe that among the binary constraint families, the regime of Cspkγ({NAND,IMPL}) is the only new regime that emerges. Specifically, we arrive at the following classification, illustrated in Figure 1.

(a) Cspkγ(NAND), equivalent to k-Independent Set.
(b) Cspkγ({NAND}) for any binary, non-trivial family .
(c) Cspkγ({IMPL}) for any binary family with NAND.
(d) Cspkγ() for any binary family with NAND,IMPL.
Figure 1: Relationship between runtime and density for our different regimes: Given some density γ and family we obtain upper and conditional lower bounds of the form ng(γ,k). For improved readability, we state the exponent g(γ,k) up to an additive constant independent of k,γ. Under this tolerance, these regimes are tight, except for case (c) where the knowledge gap between nΩ(k3) and nO(k) from the dense case transfers.
Theorem 3 (Sparsity Classification for Binary Constraint Families).

Let be a family consisting exclusively of binary constraint functions. For 0γ<1, Cspkγ() can be solved in 𝒪(n). Furthermore,

  • If ={NAND} for some non-empty family , the optimal time complexity of Cspkγ() for 1γ2 is Θ(mωk/6±c), assuming the clique hypothesis.

  • If ={NAND}, then Cspkγ() is trivial for γ<2. For γ=2, the optimal time complexity is Θ(nωk/3±c), assuming the clique hypothesis.

  • If NAND, but IMPL, then the optimal time complexity of Cspkγ() for 1γ2 is ng(k) with Ω(k3)g(k)O(k), assuming the clique hypothesis.

  • Finally, if IMPL,NAND, then Cspkγ() can be solved in time O(n+m) for all 1γ2.

We prove the first part in Section 4, deferring details on the remaining parts to the full paper due to space constraints.

Towards Higher-Arity Constraint Families: Phase Transition At Triviality Cutoff

Classifying the influence of sparsity for higher-arity constraint families becomes significantly more challenging. Already the question how many constraints are minimally required to define a non-trivial instance is not obvious. We shall however see, that for a large class of constraint families, this quantity is decisive to understand the time complexity, as we observe a phase transition at this triviality cutoff.

Specifically, we say that Cspkγ() is non-trivial if there are infinitely many NO instances in Cspkγ(); conversely, it is trivial, if for all sufficiently large n, any instance of Cspkγ() with n variables is a YES instance. For any constraint family , we define the triviality cutoff γtriv as the smallest γ0 such that Cspkγ() is non-trivial. Thus, every n-variable instance with sufficiently large n and O(nγtrivϵ) constraints from contains a solution, while there exists infinitely many instances with Θ(nγtriv) constraints from that do not contain a solution with k nonzeroes.

We first introduce a parameter umin() that describes this triviality cutoff. Specifically, let umin(f) denote the smallest weight x1 of an assignment x violating f, i.e., umin(f)=min{x1f(x)=0}. Defining umin()minfumin(f), we can establish the triviality cutoff γtriv as umin().

Theorem 4 (Triviality Cutoff).

Let be any finite constraint family. The problem Cspkγ() with γ=umin() is non-trivial. Conversely, if γ<umin(), then there exists n0 such that any instance of Cspkγ() with at least n0 variables admits a satisfying assignment of weight k.

For a large class of constraint families, we obtain a sharp phase transition from trivial instances to requiring brute force running time, assuming the 3-uniform hyperclique hypothesis. For an illustration, see Figure 2.

(a) Cspkγ({NAND2,NAND3}) equivalent to k-Independent Set in 3-hypergraphs.
(b) Cspkγ() for any family with umin()3.
Figure 2: Relationship between runtime and sparsity for Cspkγ() with higher-arity : (a) For ={NAND2,NAND3}, the complexity displays a nuanced relationship (a kinked slope) in the regime 2γ3; note that umin()=2. (b) showcases the sharp phase transition at the triviality cutoff for or families with umin()3.
Theorem 5 (Phase Transition).

Let be a constraint family. If umin()3, then Cspkγ() is trivial for γ<umin(). For γumin(), it requires time nko(1) assuming the umin()-uniform hyperclique hypothesis.

To future work, we leave the challenge of settling the influence of sparsity for constraint families with umin(){0,1,2}. As witnessed by the mixed-arity k-IS family ={NAND2,NAND3} (which has umin()=2), settling such families can become technically quite demanding.

1.3 Detailed Results and Technical Overview

We highlight our main technical contributions, and provide a more detailed overview of our results. We begin by presenting our algorithmic contributions for k-Independent Set problem in 3-hypergraph and developing the core framework that will also be useful in extending to general hypergraphs of higher arity.

Algorithm for 𝒌-Independent Set in Sparse 𝟑-Hypergraphs

Let H be a 3-Hypergraph777That is, each hyperedge contains at most 3 vertices. with n vertices and m hyperedges. Let G be the underlying graph of H, obtained by removing all hyperedges of arity 3 from H. Notice that any k-independent set in H is also a k-independent set in G. We refer to the k-independent sets in G as potential solutions. Formally, let I(G,k) denote the set of all independent sets of size k in G and let Iinvalid(H,k) denote the set of all false solutions, i.e. the set of all potential solutions that contain a hyperedge in H. We begin with a simple observation that H has a k-independent set if and only if |I(G,k)||Iinvalid(H,k)|>0.

Counting the potential solutions, i.e., the value |I(G,k)| can be done via the classical algorithm of Nešetřil and Poljak [24], yielding an O(nkω3) bound (if k is divisible by 3). Hence, the main algorithmic challenge is to efficiently count the invalid solutions, namely those potential solutions that violate at least one hyperedge constraint in H. We now turn our attention to this task. For any subset of hyperedges S, let IS(H,k) denote the set of all potential solutions that contain all vertices spanned by S; that is, for each XIS(H,k), the induced hypergraph H[X] contains all hyperedges in S. Let E3 denote the set of all hyperedges in H that contain at least three vertices. We can now observe that, by definition of Iinvalid, we have

Iinvalid(H,k)=eE3I{e}(H,k),

and for any non-empty set SE3

IS(H,k)=eSI{e}(H,k).

This gives us a natural way to compute the size of Iinvalid via the inclusion-exclusion principle as follows.

|Iinvalid(H,k)|=i=1(k3)S(E3i)(1)i+1|IS(H,k)|.

However, naively enumerating all sets S and computing |IS(H,k)| fails to improve upon trivial O(nk) brute-force algorithm, even in the sparse regime m=O(n). To circumvent this issue, we notice that a lot of the “higher-order” terms in the inclusion-exclusion formula are either irrelevant, or redundant. Specifically, such terms either (1) span more than k vertices (irrelevant), or (2) can be obtained by appropriately guessing a “lower-order” term (redundant). Case in point: consider a set S that contains (k3) many edges. The only way that S spans k vertices is if these vertices induce a clique of size k in H. However, in that case, for any set SS that contains k/3 pairwise non-intersecting hyperedges will span the same vertex set and consequently IS(H,k)=IS(H,k)

This observation will allow us to drastically reduce the number of inclusion–exclusion terms that must be considered, and form the basis of our improved counting algorithm. Intuitively, it brings us to the following win-win scenario: let SE3 of size >k/3. Then either (i) the hyperedges in S are “clustered together” and we can get away by guessing a smaller set SS (S is redundant), or (ii) the hyperedges in S are not “clustered together”, but they span more than k vertices, so we never have to consider S at all (S is irrelevant). However, the issue of “clustered edges” cannot be resolved by simply restricting our outer sum to stop at k/3, as that would generally lead to a lot of double counting. To bypass this problem, the idea is to impose a total ordering on the hyperedges of H. Intuitively, whenever a hyperedge eS intersects another hyperedge eE3 with ee, the algorithm recognizes that all the independent sets containing V(e)V(e) have been accounted for in another iteration S that contains e, so it avoids counting them again. It remains to formalize and implement this idea efficiently, which we address next.

Avoiding double counting.

Fix an arbitrary total order on the hyperedges of H. For any nonempty set of hyperedges S, let IS(H,k) denote the set of all potential solutions X of size k that satisfy the following two conditions.

  1. 1.

    X contains all vertices spanned by the hyperedges in S.

  2. 2.

    For every eS and every hyperedge eE3 with ee, if ee, then X does not contain e.

We claim that replacing IS by IS in the inclusion-exclusion formula preserves correctness. In particular, we show that

Iinvalid(H,k)=eE3I{e}(H,k)

The rough idea is as follows. Consider any XIinvalid(H,k). By definition, the induced subhypergraph H[X] contains at least one hyperedge (and possibly as many as (k3)). Let e be the minimum hyperedge in H[X] with respect to the ordering ; that is, for every edge eE(H[X]){e}, we have ee. By construction, X satisfies both defining conditions of I{e}(H,k), and hence XI{e}(H,k). Particularly, this shows that Iinvalid(H,k)eE3I{e}(H,k). The containment in the other direction follows immediately by noticing that for each SE3, we have IS(H,k)IS and as argued previously, Iinvalid(H,k)=eE3I{e}(H,k). Together, these inclusions imply the claimed equality.

We further observe that any set SE3 containing more than k/3 hyperedges either: (1) spans more than k vertices, or (2) contains two hyperedges e,e such that ee. In the first case, since |V(S)|>k, no independent set of size k can contain S. Also, in the second case either ee, or ee. In either case, any potential solution in IS(H,k) containing both e and e violates the second condition in the definition of IS(H,k). In particular, in both cases the set IS(H,k) is empty. Consequently, all “higher-order” inclusion-exclusion terms corresponding to |S|>k/3 vanish. Combining this with the observations above, we have the following refinement of our inclusion-exclusion formula.

|Iinvalid(H,k)|=i=1k3S(E3i)(1)i+1|IS(H,k)|.

The remaining challenge is that, unlike the original sets IS(H,k), the sets IS(H,k) do not admit an obvious efficient counting algorithm. We are now going to prove that we can indeed compute their sizes efficiently.

Computing |𝑰𝑺(𝑯,𝒌)|.

Fix a set SE3 and consider any hyperedge eE3. Suppose that there exists a hyperedge eS such that (i) ee, and (ii) ee. In this case, any potential solution containing e would violate the second condition in the definition of IS(H,k), and we enforce this restriction via the following reduction.

If |ee|=1, we delete the unique vertex in ee from the hypergraph. If instead |ee|=2, we replace the hyperedge e by an edge connecting the two vertices in ee. Let H be the hypergraph obtained from H by iterating this reduction over all hyperedges eE3. We show that this transformation preserves exactly the desired solutions, namely that IS(H,k)=IS(H,k). Recall that the set IS(H,k) can be computed by running the Nešetřil, Poljak [24] k-clique algorithm on an appropriate subgraph of the underlying graph of H. This yields an efficient procedure for computing |IS(H,k)| and consequently an efficient way to compute |Iinvalid(H,k)|. By implementing this carefully, we can bound the running time for computing this value as follows (assuming k is divisible by 3, otherwise we get a small polynomial overhead).

Tk(n,m) 𝒪(mk3+i=0k31mi(m+n(k3i)ω/3))𝒪(mk3+nkω/3).

For more details on the implementation, as well as the detailed computation on this bound, we refer the reader to Section 3.1.

We complement this algorithmic result with matching conditional lower bounds. Using a technique that we call sparse embedding, that maps a small dense instance of k-Hyperclique Detection in 3-uniform hypergraphs into a sparse instance of k-Independent Set Detection in 3-hypergraphs, we show that for any density m=Θ(nγ), 2γ3, no algorithm can run in time 𝒪(mk/3ε), unless the 3-Uniform Hyperclique Hypothesis fails. Moreover, the lower bound of nkω/3o(1) is inherited directly from hardness of k-Independent Set Detection in graphs. Combining these two lower bounds establishes the conditional optimality of our algorithm across the entire sparsity spectrum. 888When m=Θ(nγ) for some γ<2, every such instance is a trivial yes-instance as a consequence of Turán’s theorem.

Extending the Algorithm to General 𝒉-Hypergraphs

Let H be an h-Hypergraph for some h3, with n vertices and m=i=2hmi hyperedges, where each mi is the number of hyperedges of arity i. The goal is to extend the algorithmic framework of detecting k-Independent Sets in 3-Hypergraphs to this more general setting. We first show that a straightforward extension of the techniques developed for 3-hypergraphs yields an improvement over the brute-force O(nk) running time for general hypergraphs, provided that miO(n3εi) for every arity i (and consequently m=O(n3ε)). More precisely, we prove the following proposition, which generalizes the algorithm for 3-hypergraphs and provides a unified upper bound for k-Independent Set in general h-hypergraphs.

Proposition 6.

Given any h-hypergraph H with n vertices and m edges, for every k divisible by 3, there is an algorithm deciding if H contains a k-independent set in time 𝒪(min{nk,nkω3+mk3}).

On a high level, we are taking the same blueprint as in the 3-hypergraph case: we count the potential solutions and subtract the number of invalid solutions. Recall,

|I(H,k)|=|I(G,k)||Iinvalid(H,k)|,

where G denotes the underlying graph of H. While the value |I(G,k)| can still be computed efficiently, evaluating |Iinvalid(H,k)| becomes more complicated as we increase the arity. As before, we employ the inclusion-exclusion formula, and eliminate the higher order terms in the same way, by using the following formula.

|Iinvalid(H,k)|=i=1k3S(E3i)(1)i+1|IS(H,k)|.

However, the main difficulty lies in computing |IS(H,k)|. Recall that for 3-hypergraphs, this was achieved by imposing an ordering on hyperedges, and applying the two simple reduction rules,thereby reducing the problem to computing a small independent set in an appropriate graph. For hypergraphs of higher arity, however, when two hyperedges e,e intersect, the set ee might contain more than two vertices, so simply adding an edge of arity 2 no longer suffices. A natural generalization of the ”type 2” reduction rule is to replace e by a hyperedge spanning ee. While this preserves correctness of the construction, crucially, it reduces the problem only to detecting an independent set in hypergraphs, and we can no longer apply the matrix-multiplication-based algorithm to improve upon trivial runtime (see [21] for a detailed discussion). Fortunately, we can circumvent this issue by observing that the new hypergraph has strictly smaller arity than H, allowing us to apply induction on the arity, with the 3-hypergraph algorithm as a base case.

In fact, we improve upon this by using a combination of the three techniques (1) partitioning the hyperedges of H into “sparse” and “dense” components (2) applying the inclusion-exclusion procedure described above to the sparse part (3) using sparse witness enumeration to handle the dense parts. With a careful implementation of these techniques, and by addressing several technical obstacles, we can finally prove the following upper bound for the k-Independent Set problem on general hypergraphs.

Theorem 7 (k-Independent Set Algorithm for Higher Arity Hypergraphs).

Given any h-hypergraph H with n vertices and mi=Θ(nγi) edges of arity i (for each i2), there is an algorithm deciding if H contains a k-independent set for any k divisible by 3 in time

𝒪(nkω3+i=3hmin{miki+33,minki}).

Perhaps surprisingly, we show that this upper bound is essentially tight: unless either the k-Clique Hypothesis, or the 3-Uniform Hyperclique Hypothesis fails, no significantly faster algorithm is possible. More specifically, by employing appropriate notions of sparse and dense embeddings, we can prove the following theorem.

Theorem 8 (Arity-Sensitive Lower Bound).

Let ε>0 be arbitrary and n be the number of vertices of any given h-hypergraph. For any 3ih, let mi=Θ(nγi) for any 2γii be the number of hyperedges of arity i of the input hypergraph. Then:

  1. 1.

    (Clique LB) There is no algorithm solving k-Independent Set problem in h-hypergraphs in time 𝒪(nkω3ε), assuming the k-Clique Hypothesis.

  2. 2.

    (3-Uniform Hyperclique LB) For no i such that 2γi3 is there an algorithm solving the problem in time 𝒪(miki+33ε), assuming the 3-Uniform Hyperclique Hypothesis.

  3. 3.

    (r-Uniform Hyperclique LB) For no i such that γi3 is there an algorithm running in 𝒪(minkiε), assuming the (γi)-Uniform Hyperclique Hypothesis.

Beyond Independent Sets: Boolean CSP

To study the effect of sparsity systematically in a more general class of problems, we turn to the class of Boolean Constraint Satisfaction Problems (CSPs). Recall that k-Independent Set in h-hypergraphs can be viewed as a special case of Boolean CSP over the constraint family ={NAND2,,NANDh}. We formally define this class of problems as follows.

Definition 9 (Boolean Constraint Satisfaction Problem (Cspkγ)).

Let be a finite Boolean constraint family (i.e. a set of functions f:{0,1}h{0,1}). Given a set Φ of m Boolean constraints C on variables x1,,xn, each of the form f(xi1,,xih), where f and mΘ(nγ), the problem Cspkγ asks if there exists an assignment a:{x1,,xn}{0,1} satisfying Φ, that sets precisely k variables to 1.

We begin by considering the special case binary constraints families. Perhaps surprisingly, for every such family , and for all values of γ, we obtain a complete classification of the problem Cspkγ(): we design an algorithm running in time Tk(m,n), and show its conditional optimality under the k-Clique Hypothesis. To obtain such a complete classification across the entire sparsity spectrum, we show that instances of Cspkγ() for values γ<1, admit a linear time algorithm: 𝒪(n+m). The classification becomes much more interesting when we consider the regime γ1. In particular we prove the following classification theorem, which is a more formal version of Theorem 3.

Theorem 10 (Classification of Boolean CSPs over Binary Families).

Let be a family of binary Boolean constraints. Then, for any 1γ2 we obtain the following classification:

  1. 1.

    (Linear Regime) If contains neither NAND nor IMPL, then Cspkγ() can be solved in linear time 𝒪(m+n).

  2. 2.

    (Subexponential Regime, [20]) If contains IMPL, but not NAND, then Cspkγ() can be solved in time 𝒪(n4k), furthermore, unless the k-clique hypothesis fails, there is no algorithm solving Cspkγ() in time 𝒪(nωk3/6+cε), for any ε>0 and some c>0 independent of k.

  3. 3.

    (k-IS Regime) If ={NAND}, then for any γ<2, every Cspkγ() instance is trivial. For γ=2, there is an algorithm solving Cspkγ() in time 𝒪(nωk/3) (for any k divisible by 3). Furthermore, any algorithm running in 𝒪(nωk/3ε) would refute the k-Clique Hypothesis.

  4. 4.

    (Clique Regime) If for some nonempty family , can be written as ={NAND}, then we can solve Cspkγ() in time 𝒪(mω(kc)/6+1) (for all sufficiently large k divisible by 3), where c{0,1,2} depends only on . Moreover, any algorithm running in 𝒪(mω(kc)/6ε) would refute the k-Clique Hypothesis.

By a clever branch and bound approach given in [22], we can generally resolve 0-invalid constraint functions, essentially allowing to reduce constraint families in the linear regime to {EQ} which in turn can be reduced to a bounded subset-sum instance. For the Subexponential Regime, a fairly simple argument suffices to show that Cspkγ(IMPL) can be reduced to Cspk1(IMPL), thus it is unlikely to be improved by exploiting sparsity. Note that this regime is not fully resolved in the dense case, this gap therefore transfers to the sparse setting as well. For the k-IS Regime, triviality follows by Turán’s Theorem. The precise details on Regime 1-3 can be found in the full version of the paper.

The Clique Regime turned out to be the most interesting. On the hardness side, we can reduce the dense case to the sparse case using only NAND and one further binary constraint. We reduce the density by blowing up the number of variables accordingly, carefully ensuring that the additional variables are not part of a solution. Here we once again refer to the full version. For the algorithm, we essentially argue that for each family that belongs to the clique regime we can reduce any instance of Cspkγ() efficiently to Cspkγ({NAND,IMPL}), so it suffices to construct an efficient algorithm for this particular family. Our algorithm proceeds in a few steps that when implemented carefully, yield the desired running time.

  1. (1)

    (Reduction to Restricted Instance) We first leverage the directed reachability structure induced by IMPL constraints: intuitively, vertices with many descendants are cheap to guess, since including such a vertex in a solution forces all descendants to be set as well. By systematically branching on these vertices and propagating their implications, we can reduce to a restricted instance, where each vertex has at most a single descendant (besides itself) in the directed graph induced by IMPL constraints.

  2. (2)

    (Grouping and Sparsity Cutoff) For such restricted instances, we introduce a grouping technique to partition the variables according to their local IMPL structure. Each group corresponds to a small implication neighborhood that can be treated as a single unit. We then establish a sparsity cutoff: if any group is sufficiently large and therefore sufficiently sparse with respect to NAND constraints, we immediately find a solution using Turán-like arguments. As a consequence, we can bound the size of each group and the total number of groups, reducing the problem to a core instance.

  3. (3)

    (Removing the 2-Cycles and Reduction to Triangle Detection) For our last step, we want our Implication-induced graph to be acyclic. We prove the remaining 2-cycles can only be contained within a small subset of vertices and thus eliminated efficiently. Then, we show how to distribute the groups in a balanced manner and encode valid group selections as vertices in an auxiliary graph. This construction reduces the problem to Triangle Detection, allowing us to leverage matrix multiplication to achieve the desired running time.

Triviality and Hardness beyond Binary Constraints

In the binary setting we provide an (almost) complete classification of all binary families, condensing the limited landscape into few interesting regimes. We tackle families of unbounded arity by observing a specific parameter that is exploitable both in terms of lower and upper bounds. Precisely, we consider the minimum weight umin(f) required to violate a constraint function f, i.e. let umin(f)min{x1f(x)=0} and umin()minfumin(f).

Equipped with this parameter, we generalize Turan’s theorem [28] to Boolean CSPs of any arity via a constructive algorithm and define a surprisingly simple gadget to proof hardness conditioned on the (huniform) k(hyper)clique hypothesis.

Triviality.

Turan’s theorem states for constant k and large n, there always exists a k-independent set in a simple graph with m𝒪(n2ε) edges. Finding this independent consists of two steps: Since m𝒪(n2ε), there exists a vertex with 𝒪(n1ε) neighbors. Adding this vertex and removing its neighborhood for correctness, we obtain a sparse graph again, allowing us to perform this procedure k times in total.

Despite the simplicity of this approach it is not trivial how this transfers to high arity Boolean CSPs: What is a low degree variable in this context and how do we handle its neighborhood? To answer this, we consider the density of each constraint function individually: We define γf for all f such that mfΘ(nγf) where mf denotes the number of f-constraints. With this we can state the precise triviality cutoff:

Theorem 11 (Special Triviality).

Let be any finite constraint family and Φ an instance of Cspkγ() with γf<umin(f) for all f. Then Φ is trivial and we can find a size-k solution in time 𝒪(n+m).

The algorithm is a generalization of the one described above for k-independent set in sparse graphs. We include a low degree variable into the solution, adjust its neighborhood, and then repeat the process k1 further times. The sparsity requirement implies a variable v that is contained in at most 𝒪(nγf1) many f-constraints for all f with γf1 and contained no g-constraints with γg<1. To adjust the neighborhood we replace each constraint c=f(,v,) with a new constraint c=f(,1,). This maintains both correctness and our desired sparsity property. For the full proof we refer to the arXiv version.

Hardness.

To prove hardness and non-triviality, a rather simple gadget suffices. For some function f of arity h we can can place f-constraints on all size-h subsets of h+k variables. One can then prove this gadget resembles NANDumin(f), as all satisfying assignments set any number of variables that umin(f) to true. Carefully applying this gadget then allows us to both prove non-triviality and also conditional lower bounds based on the k-(hyper)clique hypothesis.

Theorem 12 (Non-Triviality and Clique-Hardness).

Let be any finite constraint family.

  • Cspkγ() is non-trivial for γ=umin()

  • If γumin()=2 then Cspkγ() requires time nkω/3o(1) assuming the k-clique hypothesis.

  • If γumin()3 then Cspkγ() requires time nko(1) assuming the umin()-uniform k-hyperclique hypothesis.

We again refer to full version for the proof and combine the two above theorems to obtain Theorem 4 and Theorem 5.

2 Preliminaries

For any natural number x, we denote with [x] the set of integers {1,,x}. Further, for any set S and any number d{0} we denote with (Sd) the set of all subsets of S of size d. With (Sd) we denote the set of all subsets of S of size d. An h-hypergraph is any hypergraph H=(V,E) such that E(Vh)(V1). An h-uniform hypergraph is any h-hypergraph with E(Vh).

Hardness Assumptions.

The k-clique problem asks, given a graph G=(V,E) on n vertices, to determine whether there exists a k-clique CV of size k such that (C2)E. Dating back to [24], one can detect k-cliques time 𝒪(nωk3) for k divisible by 3. Here, ω<2.372 denotes the matrix multiplication exponent, such that we can multiply two n×n matrices in time 𝒪(nω).

This problem generalizes to r-uniform hypergraphs, asking to find a set of vertices such that every r tuple is contained in a hyperedge – but algebraic approaches such as fast matrix multiplication fail in this setting (for a discussion of this phenomenon, see [21]). As such, no algorithm with substantial improvements over brute-force time nko(1) is known (see [3] for subpolynomial-factor improvements). In fact, any polynomial improvement would result in improved algorithms for problems such as Max-h-SAT [31] that are widely believed to be hard.

In fine-grained complexity theory, the k-clique problem has been widely used to obtain conditional lower bounds, such as e.g. [1, 12, 14]. Over the recent years, the r-uniform k-hyperclique problem has seen increasing popularity as well, yielding applications for a variety of problems [21, 2, 7, 20, 8, 13, 23, 16, 17].

As such we use the following hypothesis concerning k-(hyper)clique detection:

Hypothesis 13 (r-Uniform d-Hyperclique Hypothesis).

Let ϵ>0 and k>d.

  1. 1.

    For d=2 there is no 𝒪(n(ωk/3)ε)-time algorithm detecting a k-clique in a graph (also referred to as k-clique hypothesis).

  2. 2.

    For d3, there is no 𝒪(nkε)-time algorithm detecting a k-clique in a d-uniform hypergraph.

3 𝒌-Independent Set in Non-Uniform Hypergraphs

This is our main technical section. It is dedicated to constructing algorithms and lower bounds for detecting a k-independent set in (non-uniform) h-hypergraphs.999I.e., each hyperedge has arity at most h. Note that throughout this section we treat edges as subsets of vertices and use standard set-theory notation (e.g. ee, ee, VeEe). We begin by considering the simplest family of h-hypergraphs, namely the 3-hypergraphs.

3.1 𝒌-Independent Set in 𝟑-Hypergraphs

In this section, we prove the following two main theorems.

Theorem 14 (Algorithm for k-Independent Set Problem in 3-Hypergraphs).

Given any 3-hypergraph H with n vertices and m edges, there is an algorithm deciding whether H contains a k-independent set in time 𝒪(nkω3+mk3) for all k divisible by 3.

Moreover, we show that this running time is essentially optimal, unless at least one of the two established hypotheses fails.

Theorem 15 (Conditional Lower Bounds for k-Independent Set Problem in 3-Hypergraphs).

There is no algorithm solving k-Independent Set problem in 3-hypergraphs in time:

  1. 1.

    𝒪(nkω3ε), unless the k-Clique Hypothesis fails.

  2. 2.

    𝒪(mk3ε), unless the 3-Uniform Hyperclique Hypothesis fails. Moreover, this holds even when restricting m=Θ(nγ), for any 2γ3.101010Recall that Turan’s theorem implies that if γ<2, any instance is a trivial yes-instance. Hence, this theorem gives us a full landscape of the complexity of the problem in terms of both number of vertices and number of (hyper)edges.

We dedicate the first part of this section to constructing our algorithm and proving Theorem 14. Our approach consists of first counting the potential solutions, which are in principle all independent sets on the underlying (2-uniform) graph of H (intuitively, in the first step we ignore arity-3 hyperedges), and then using inclusion-exclusion to count all false potential solutions, by which we understand those independent sets of the underlying graph of H which contain an arity-3 hyperedge in H. While this approach yields a correct solution, a naive implementation is unfortunately too slow. Intuitively, if many arity 3-edges are clustered together, we would spend too much time counting the higher-order terms in the inclusion-exclusion formula. The last step of our algorithm takes care of this by making sure that we never double-count the solutions from such clustered hyperedges, assuring that we only need to compute the higher order terms of the “nicely structured” hyperedges, yielding the desired running time. We start with the following simple observation.

Observation 16.

Let H be a 3-hypergraph and G be the underlying graph of H (obtained by removing all arity-3 hyperedges). Let I(G,k) be the set of all k-independent sets in G, and let Iinvalid(H,k) be the set of all independent sets in G that contain a hyperedge in H. Then H contains an independent set of size k if and only if

|I(G,k)||Iinvalid(H,k)|>0.

Recall that the classical clique counting approach computes |I(G,k)| in time 𝒪(nkω/3). It remains to argue that we can also compute |Iinvalid(H,k)| efficiently. The following lemma gives us a way to compute |Iinvalid(H,k)| via the standard inclusion-exclusion-based approach. In particular, for a subset of hyperedges S, we can count how many independent sets in G contain S and then make sure we avoid double-counting. For any subset of hyperedges S, let IS(H,k) denote the set of all independent sets of size k in G that contain all vertices spanned by S.

Lemma 17 (Invalid Solutions via the Inclusion-Exclusion Principle).

Let H be a 3-hypergraph and let E3 denote the set of all arity-3 hyperedges in H. Then the following equality holds.

|Iinvalid(H,k)|= i=1(k3)S(E3i)(1)i+1|IS(H,k)|.
Proof.

The statement follows directly from the inclusion-exclusion principle, by observing that Iinvalid(H,k)=eE3I{e}(H,k), and that for any non-empty set S we have IS(H,k)=eSI{e}(H,k).

It is easy to see that naively enumerating all sets IS and computing the term |IS(H,k)| is infeasible. However, we can observe that a lot of these sets can be seen as redundant by a more clever implementation. For instance, the only way that a set S that contains (k3) edges is a part of an independent set of size k in G is that the k vertices that it spans form a hyperclique in the underlying 3-uniform hypergraph of H. However, in that case, we can observe that there is a subset S of S that is of a much smaller size, in particular contains only k3 hyperedges, that spans the same vertex set as S. Intuitively, if a particular solution contains many clustered hyperedges, by a naive implementation of our inclusion-exclusion approach, we will enumerate many edge sets S that span the same set of vertices, hinting at the fact that we are doing a lot of redundant work. In particular, this means that we only need to look at the sets S that contain up to k3 many edges, as long as we can guarantee that the independent sets spanned by these clustered hyperedges are never double counted. We dedicate the rest of this section to formally introducing the notion of the clustered edges and showing how to avoid this redundant work.

Handling intersecting edges

Let us first introduce some useful notation and terminology. We will introduce all of the concepts in a more general setting, namely for h-hypergraphs for h3, in order to be able to reuse it in the following sections, but note that in this section we will only focus on the special case of h=3. Denote by Ei the set of all hyperedges of arity i, and analogously, denote by Ei the set of all hyperedges of arity at least i. Let ϕ:E(H)[m] be any fixed bijection. We use ϕ to obtain a total ordering of the hyperedges of H. That is, we write ee if ϕ(e)<ϕ(e). Let e,e be edges that intersect (share common vertices) and assume that ee. Intuitively, our goal is to efficiently remove all independent sets X that contain e from IS(H,k) for any S that contains e to avoid the double counting of the sets spanned by the overlapping edges. We now formally prove that this does not destroy any valid solutions. For any set of hyperedges S, let IS(H,k) be the set of all independent sets X of the underlying graph G of size k satisfying the following two conditions.

  1. 1.

    X contains all the vertices spanned by the hyperedges in S.

  2. 2.

    (Handling the overlapping hyperedges) For any edge eS and any edge eE3, such that ee, if ee, then X does not contain e.

We now prove that we can safely replace the sets IS in our inclusion-exclusion formula by the sets IS.

Lemma 18.

Let H be an h-hypergraph and let E3 denote the set of all arity-3 hyperedges in H. Then the following equality holds.

Iinvalid(H,k)=eE3I{e}(H,k).
Proof.

We prove this by demonstrating set containment in both sides. Notice that one side is straightforward, as for each e we have I{e}I{e}, and hence:

eE3I{e}(H,k)eE3I{e}(H,k)=Iinvalid(H,k),

where the last equality follows directly from definition of the set Iinvalid(H,k). To show the other containment, let X be any set in Iinvalid(H,k). It suffices to show that there exists some e such that X is contained in I{e}. By definition, the subhypergraph H[X] contains at least one hyperedge. Let e be the first hyperedge contained in H[X] with respect to the ordering , i.e. for any hyperedge e contained in X, we have ee. Then clearly X is contained in I{e}.

The idea of replacing I by I in our inclusion-exclusion formula is to avoid double counting the clustered independent sets, hence we should expect that many higher order terms will vanish. Indeed, we now prove that this is indeed the case.

Lemma 19.

Let H be an h-hypergraph and let E3 denote the set of all arity-3 hyperedges in H. Let SE3 be any set of at least k3+1 hyperedges. Then IS(H,k)=.

Proof.

First notice that if for every pair of hyperedges e,eS it holds that ee=, then S spans at least 3(k3+1)>k many vertices, and vacuously cannot be contained in any independent set of size k in the underlying graph, hence IS(H,k)IS(H,k)=. Now assume that S contains two edges e,e that share at least one common vertex. Then each independent set in IS(H,k) violates Condition 2 (since either ee, or vice versa, in either case any independent set that contains both e,e violates Condition 2) in the definition of IS(H,k) and hence is not contained in IS(H,k), implying that IS is empty.

We can now formally rewrite our inclusion-exclusion formula in terms of sets IS.

Corollary 20.

Let H be an h-hypergraph and let E3 denote the set of all arity-3 hyperedges in H. Then the following equality holds.

|Iinvalid(H,k)|= i=1k3S(E3i)(1)i+1|IS(H,k)|.

We now proceed to argue that we can construct the sets IS efficiently.

Constructing the sets 𝑰𝑺

Given two hyperedges e,e such that ee, we distinguish between two types of intersections between them. We say that the intersection of two hyperedges e,e is type i if (1) ee, and (2) |ee|=i. The idea to construct the sets IS is to recursively guess an arity-3 edge e and then for all edges e in E3(H) such that the intersection e,e is type i, we span the vertex set (ee) by a hyperedge of arity i in all the descending branches. This ensures that we never consider the independent sets that violate Condition 2 in the definition of the set IS. More formally, we consider the following algorithm.

Algorithm 1 Subroutine that resolves intersecting hyperedges via replacement or removal. Given a hypergraph H and a subset of edges S, returns a new hypergraph H such that IS(H,k)=IS(H,k).
Lemma 21.

Let H be a 3-hypergraph and let SE3(H). Let H be the hypergraph returned by the resolve-intersections(H,S) function in Algorithm 1. Then IS(H,k)=IS(H,k).

Proof sketch.

Let XIS(H,k). We show that X satisfies Condition 2 in the definition of IS(H,k). Consider any edge eE3(H) such that for some eS, we have ee and ee. If |ee|=1, then the procedure removes the unique vertex in ee from H, so e cannot be contained in X. If |ee|=2, the procedure inserts an arity-2 edge between the two vertices of ee, and thus no independent set in the underlying graph of H can contain e. The remaining cases are impossible: |ee|=0 implies e=e, while |ee|3 implies ee=. Hence XIS(H,k).

Conversely, let XIS(H,k). Suppose that XIS(H,k). Since X is independent in the underlying graph of H, this can only happen if H[X] contains some edge e such that ee and ee for some eS. But then X violates Condition 2, contradicting XIS(H,k).

We can now use Algorithm 1 as a subroutine in our main algorithm. Recall that in a hypergraph H, a matching M of size i is a set of i pairwise non-intersecting hyperedges. Also, for simplicity, assume that k is divisible by 3, and we will handle the remaining cases later in the analysis.

Algorithm 2 Algorithm for counting size-k sets that are independent with respect to arity-2 edges but contain at least one arity-3 hyperedge.

It remains to prove the correctness of this algorithm and analyse the running time.

Lemma 22.

Given a 3-Hypergraph H with n vertices and m hyperedges, Algorithm 2 returns the value |Iinvalid(H,k)| correctly in time 𝒪(nkω3+mk3).

Proof.

Correctness follows directly from Lemma 21 and Corollary 20. We now prove the upper bound on the running time. Recall that there are at most 𝒪(mi) matchings of size i, and that each such matching S by definition spans precisely 3i many vertices in 3-hypergraphs. In particular, the set IS(H,k) consists of 3i many “guessed” matching vertices and k3i many vertices outside S. If 3i<k, we can find the remaining k3i many vertices by running the standard matrix-multiplication algorithm on the underlying graph GNG[S]. Constructing H (and consequently the underlying graph G) takes at most 𝒪(m) time. Note that if 3i=k, we only need to check that S forms an independent set in the underlying graph G, which we can do in 𝒪(1) time (Line 8). This allows us to bound the total running time as follows.

Tk(n,m) =𝒪(mk3+i=0k31mi(m+n(k3i)ω/3))=𝒪(mk3+i=0k31mi+1+min(k3i)ω/3)
=𝒪(mk3+i=0k31min(k3i)ω/3)=𝒪(i=0k3min(k3i)ω/3)=𝒪(mk3+nkω/3).

This Lemma, together with Observation 16 concludes the proof of Theorem 14. We prove the conditional optimality (Theorem 15) of this algorithm in the full version of the paper.

4 Binary Constraint Families and The Effects Of Sparsity

Due to space constraints, we dedicate this section to proving the upper bound for solving constraint families of the form {NAND2} in time 𝒪(nγ(ksmin())ω/6+1), i.e. the positive part of Regime 4 of Theorem 10. Here smin(f) denotes the minimum number of ones required to satisfy a constraint function f. Formally we let smin(f)min{x1f(x)=1} and smin()minfsmin(f).

Theorem 23.

Let be a non-empty binary constraint family. Then we can solve Cspkγ(˙{NAND2}) in time 𝒪(mω(ksmin()6+1).

Preliminaries.

Let us recall and introduce some Csp specific notations and results. For a singleton constraint family ={f}, we also write Cspkγ(f). Denote by vars(Φ) the variables of an instance Φ of Cspkγ(), then we define its primal graph G(V,E) where V={xixivars(Φ)} and E={(xi1,,xih)f(x1,,xih)Φ}. Furthermore, we call a satisfying assignment a for Cspkγ a solution if it is of weight exactly k. For a Boolean constraint function f, we use f(𝐱) with 𝐱=(x1,,xh) as a shorthand for f(x1,,xh).

A constraint function f is 0-valid/invalid if it is satisfied/violated by the all 0-assignment. Moreover, we say a constraint family is 0-valid if this holds for all its constraints and 0-invalid if it contains at least one 0-invalid constraint.

We generally assume our constraint families to be finite not containing trivial constraint functions, as they can be easily resolved. In the following, we will refer to Boolean constraint functions as known from propositional logic, i.e. F(x)=¬x, NAND2(x,y)=¬(xy), IMPL(x,y)=xy, EQ(x,y)=xy and so on.

We will only give the algorithm for the family of {NAND2,IMPL}, as we can reduce all other binary constraint families to this case. For full details on the remaining cases, refer to the full version of the paper.

Theorem 24.

There is an algorithm solving Cspkγ({NAND2,IMPL}) in time 𝒪(mkω/6+1).

In the following, we will consider the primal graph G of the given instance, distinguishing between NAND2 and IMPL edges in G. With regard to the IMPL-edges, we define for a vertex v its descendants D(v)={uuV,s.t. u is reachable from v} and ancestors A(v)={uuV,s.t. v is reachable from u}. In particular, we have that vD(v) and vA(v). We also extend this notation to sets of vertices s.t. D(V)=vVD(v). We compute for every vertex D(v) and A(v). During the computation, if we find two vertices u,wD(v) such that there exists a NAND2-edge on u,w, we can safely remove v and all its ancestors from the graph. Further, we can remove any vertex v such that D(v)k.

After this preprocessing step, we observe the following: due to the nature of IMPL constraints, vertices that have many descendants are cheap to guess: Consider the vertices V3={|D(v)|3vV}. Setting some vV3 to 1 yields at least 2 more variables uD(v), which we need to set to 1. Find the complete proof in the full version of the paper.

Hence, let us only consider the hard case where for all vV it holds that |D(v)|2. We call instances that satisfy this condition restricted.

Theorem 25 (Restricted Cspkγ({NAND2,IMPL}).

Let Φ be an instance of Cspkγ({NAND2,IMPL}) such that no two variables share both an IMPL- and NAND2-constraint and |D(v)|2 for all vvars(Φ). Then there is an algorithm solving Φ in time 𝒪(mkω/6+1).

Proof.

We devise this algorithm in 3 steps. First, we exploit the restriction on IMPL-constraints to partition the variables into groups. Each group induces a solution within itself, if it is sufficiently large and sparse w.r.t. NAND2-edges. Otherwise, we can assume that such a group must be dense which allows us to bound its size. Then,by grouping vertices cleverly (depending on IMPL-edges), we reduce to triangle detection.

The following observation regarding NAND2 sparsity of large vertex sets is crucial for our algorithm:

Claim 26.

Let VV with |V|m1+ϵ for all ϵ>0, then there exists an independent set {v1,,vk} w.r.t. NAND2-edges.

Proof.

Assume V were dense, i.e. the count of edges is

𝒪(|V|2)=𝒪((m1+ϵ)2)=𝒪(m1+ϵ)=𝒪(n(γ+γϵ))

where γϵ>0, which is a contradiction as the graph has only 𝒪(nγ) edges in total. Thus we can find a k-independent set in V in linear time. In particular, this bounds the size of any VV where IMPL edges allow us to (almost) freely choose vertices from V by |V|m1+ϵ. Otherwise we can find a k-independent set directly in time 𝒪(n+m).

We note that we can efficiently remove all 2-cycle w.r.t. IMPL edges, as their number can be bounded using Claim 26.

Reducing to Triangle Detection.

We partition V into sets

  • VL={v|A(v)|=1 and |D(v)|=2},

  • VR={v|A(v)|2} and

  • V0={v|D(v)|=|A(v)|=1}.

For any vertex uVL to be part of a solution, there exists some vVR that is necessarily contained as well. In this regard, we call the set of ancestors A(v) of vVR and v itself its group. Conversely, if we know that some vVR is part of a solution, then including any subset of its group is consistent with the IMPL constraints. Vertices in V0 are isolated w.r.t. IMPL-edges.

Using Claim 26, we can bound the size of a group. If a group is too large, there is solution fully contained therein. We have the following properties for groups:

  1. P1

    |VR|f(k)m, thus there are at most 𝒪(m) many groups.

  2. P2

    Each group has size at most |A(v)|f(k)m

To see this, observe that there are no IMPL-edges between vertices in VL, and no IMPL-edges contained in VR, as the restricted instance promises that |D(V)|2 for all vV. Lastly, we also consider V0 as a group as well, where we can bound its size |V0|f(k)m by Claim 26.

We exploit these properties by guessing how many groups (at most 𝒪(m)) a solution is composed of. Further, we guess how many vertices ki of each group (containing at most 𝒪(m) vertices) are part of the solution, thus it suffices to consider at most 𝒪(mki) subsets per group. To this end, the algorithm guesses a partition of k into groups of sizes k=k1++k with k1k, to eventually reduce to an instance of triangle detection. First, consider the case of at most two groups.

𝟐.

We guess at most two groups in time 𝒪(m2)=𝒪(m). It remains to find a (k2)-independent set among the f(k)m many vertices in the groups A(v1)A(v2). We distribute these 𝒪(m) vertices into three parts, where each part corresponds to a choice of k23k3 many vertices and reduce to a 3-partite triangle instance of size 𝒪(mk3). Two vertices in the triangle instance are adjacent, if the corresponding sets of vertices in the original instance form an independent set. The total time of guessing the groups, constructing and solving the triangle instance is bounded by 𝒪(mkω/6+1).

𝟑.

We first prove the following claim, stating that we can distribute the groups corresponding to k1,,k2 in three bins in such a way that the imbalance of any pair of bins is at most k1; then we can use the remaining two groups to fix the imbalance:

Claim 27.

Let k1k. Then there exists a distribution of k1,,k2 into three bins S1,S2,S3 such that for all pairs p,q[3] it holds that

||(kiSpki)||(kjSqkj)||k1.

We omit the proof due to spaces reasons, but this can be verified by a simple greedy argument.

Let s1,s2,s3 be the sums of values from the bins S1,S2,S3 respectively. We construct the triangle instance according to the claim. This yields an instance of triangle detection X1,X2,X3 where each set Xi corresponds to all valid choices of si vertices that adhere to our group assignment choice. Again, two vertices are adjacent if their vertex choices form a valid independent set.

To fix a potentially large imbalance, we use the remaining k1+k vertices to balance these partitions. We guess the remaining two groups in 𝒪(m) (i.e. assume that the corresponding vertices in VR are part of the solution) time and distribute the vertices of their group, where exactly k1+k2 many of those vertices have to be part of a solution. The new triangle instance will have each node correspond to a subset of (Vsi+ri) vertices of the original instance, where the si vertices are obtained by taking the union of groups 1,,2 as in the claim, and the ri vertices come from the remaining two groups, distributed to minimize the imbalance. Indeed, we can reduce the imbalance between buckets to maxi,j[3]|si+risjrj|1. See that the imbalance after distributing k1,,k2 is at most k2. Thus, we distribute the contribution k11 and k1 of our guessed groups to the imbalanced buckets. As we have at least 2(k2) many vertices available and the imbalance is at most k2, we can distribute the contributions up to an imbalance of 1. We obtain buckets of size at most skk23k3 and the triangle instance is of size 𝒪(mk3). The total time thus is bounded 𝒪(mkω/6+1). Performing this for every partition of k, we arrive at a total runtime of 𝒪(mkω/6+1)

References

  • [1] Amir Abboud, Arturs Backurs, and Virginia Vassilevska Williams. If the current clique algorithms are optimal, so is valiant’s parser. SIAM J. Comput., 47(6):2527–2555, 2018. doi:10.1137/16M1061771.
  • [2] Amir Abboud, Karl Bringmann, Holger Dell, and Jesper Nederlof. More consequences of falsifying SETH and the orthogonal vectors conjecture. In Ilias Diakonikolas, David Kempe, and Monika Henzinger, editors, Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2018, Los Angeles, CA, USA, June 25-29, 2018, pages 253–266. ACM, 2018. doi:10.1145/3188745.3188938.
  • [3] Amir Abboud, Nick Fischer, and Yarin Shechter. Faster combinatorial k-clique algorithms. In José A. Soto and Andreas Wiese, editors, LATIN 2024: Theoretical Informatics - 16th Latin American Symposium, Puerto Varas, Chile, March 18-22, 2024, Proceedings, Part I, volume 14578 of Lecture Notes in Computer Science, pages 193–206. Springer, 2024. doi:10.1007/978-3-031-55598-5_13.
  • [4] Amir Abboud, Virginia Vassilevska Williams, and Joshua R. Wang. Approximation and fixed parameter subquadratic algorithms for radius and diameter in sparse graphs. In Robert Krauthgamer, editor, Proceedings of the Twenty-Seventh Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2016, Arlington, VA, USA, January 10-12, 2016, pages 377–391. SIAM, 2016. doi:10.1137/1.9781611974331.CH28.
  • [5] Udit Agarwal and Vijaya Ramachandran. Fine-grained complexity for sparse graphs. In Ilias Diakonikolas, David Kempe, and Monika Henzinger, editors, Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2018, Los Angeles, CA, USA, June 25-29, 2018, pages 239–252. ACM, 2018. doi:10.1145/3188745.3188888.
  • [6] József Balogh, Robert Morris, and Wojciech Samotij. The method of hypergraph containers. In Proceedings of the International Congress of Mathematicians (ICM 2018), pages 3059–3092, 2018. doi:10.1142/9789813272880_0172.
  • [7] Karl Bringmann, Nick Fischer, and Marvin Künnemann. A fine-grained analogue of Schaefer’s theorem in P: dichotomy of existsˆk-forall-quantified first-order graph properties. In Amir Shpilka, editor, 34th Computational Complexity Conference, CCC 2019, New Brunswick, NJ, USA, July 18-20, 2019, volume 137 of LIPIcs, pages 31:1–31:27. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2019. doi:10.4230/LIPIcs.CCC.2019.31.
  • [8] Karl Bringmann and Jasper Slusallek. Current algorithms for detecting subgraphs of bounded treewidth are probably optimal. In Nikhil Bansal, Emanuela Merelli, and James Worrell, editors, 48th International Colloquium on Automata, Languages, and Programming, ICALP 2021, Glasgow, Scotland (Virtual Conference), July 12-16, 2021, volume 198 of LIPIcs, pages 40:1–40:16. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2021. doi:10.4230/LIPIcs.ICALP.2021.40.
  • [9] Andrei A. Bulatov. The complexity of the counting constraint satisfaction problem. J. ACM, 60(5):34:1–34:41, 2013. doi:10.1145/2528400.
  • [10] 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.
  • [11] Andrei A. Bulatov and Dániel Marx. Constraint satisfaction parameterized by solution size. SIAM J. Comput., 43(2):573–616, 2014. doi:10.1137/120882160.
  • [12] Yi-Jun Chang. Hardness of RNA Folding Problem With Four Symbols. In Roberto Grossi and Moshe Lewenstein, editors, 27th Annual Symposium on Combinatorial Pattern Matching (CPM 2016), volume 54 of Leibniz International Proceedings in Informatics (LIPIcs), pages 13:1–13:12, Dagstuhl, Germany, 2016. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.CPM.2016.13.
  • [13] Mina Dalirrooyfard, Ce Jin, Virginia Vassilevska Williams, and Nicole Wein. Approximation algorithms and hardness for n-pairs shortest paths and all-nodes shortest cycles. In 63rd IEEE Annual Symposium on Foundations of Computer Science, FOCS 2022, Denver, CO, USA, October 31 - November 3, 2022, pages 290–300. IEEE, 2022. doi:10.1109/FOCS54457.2022.00034.
  • [14] Mina Dalirrooyfard and Virginia Vassilevska Williams. Induced cycles and paths are harder than you think. In 63rd IEEE Annual Symposium on Foundations of Computer Science, FOCS 2022, Denver, CO, USA, October 31 - November 3, 2022, pages 531–542. IEEE, 2022. doi:10.1109/FOCS54457.2022.00057.
  • [15] Nick Fischer, Marvin Künnemann, and Mirza Redzic. The effect of sparsity on k-dominating set and related first-order graph properties. In Proceedings of the 2024 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 4704–4727. SIAM, 2024. doi:10.1137/1.9781611977912.168.
  • [16] Nick Fischer, Marvin Künnemann, Mirza Redzic, and Julian Stieß. The role of regularity in (hyper-)clique detection and implications for optimizing boolean csps. In Keren Censor-Hillel, Fabrizio Grandoni, Joël Ouaknine, and Gabriele Puppis, editors, 52nd International Colloquium on Automata, Languages, and Programming, ICALP 2025, Aarhus, Denmark, July 8-11, 2025, volume 334 of LIPIcs, pages 78:1–78:18. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2025. doi:10.4230/LIPIcs.ICALP.2025.78.
  • [17] Cheng-Hao Fu, Andrea Lincoln, and Rene Reyes. Worst-case and average-case hardness of hypercycle and database problems. In Keren Censor-Hillel, Fabrizio Grandoni, Joël Ouaknine, and Gabriele Puppis, editors, 52nd International Colloquium on Automata, Languages, and Programming, ICALP 2025, Aarhus, Denmark, July 8-11, 2025, volume 334 of LIPIcs, pages 81:1–81:20. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2025. doi:10.4230/LIPIcs.ICALP.2025.81.
  • [18] Peter Keevash. Hypergraph turan problems. Surveys in combinatorics, 392:83–140, 2011.
  • [19] Sanjeev Khanna, Madhu Sudan, and David P. Williamson. A complete classification of the approximability of maximization problems derived from boolean constraint satisfaction. In Frank Thomson Leighton and Peter W. Shor, editors, Proceedings of the Twenty-Ninth Annual ACM Symposium on the Theory of Computing, El Paso, Texas, USA, May 4-6, 1997, pages 11–20. ACM, 1997. doi:10.1145/258533.258538.
  • [20] Marvin Künnemann and Dániel Marx. Finding small satisfying assignments faster than brute force: A fine-grained perspective into boolean constraint satisfaction. In Shubhangi Saraf, editor, 35th Computational Complexity Conference, CCC 2020, July 28-31, 2020, Saarbrücken, Germany (Virtual Conference), volume 169 of LIPIcs, pages 27:1–27:28. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2020. doi:10.4230/LIPIcs.CCC.2020.27.
  • [21] Andrea Lincoln, Virginia Vassilevska Williams, and R. Ryan Williams. Tight hardness for shortest cycles and paths in sparse graphs. In Artur Czumaj, editor, Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2018, New Orleans, LA, USA, January 7-10, 2018, pages 1236–1252. SIAM, 2018. doi:10.1137/1.9781611975031.80.
  • [22] Dániel Marx. Parameterized complexity of constraint satisfaction problems. Comput. Complex., 14(2):153–183, 2005. doi:10.1007/s00037-005-0195-9.
  • [23] Surya Mathialagan, Virginia Vassilevska Williams, and Yinzhan Xu. Listing, verifying and counting lowest common ancestors in dags: Algorithms and fine-grained lower bounds. In Mikolaj Bojanczyk, Emanuela Merelli, and David P. Woodruff, editors, 49th International Colloquium on Automata, Languages, and Programming, ICALP 2022, Paris, France, July 4-8, 2022, volume 229 of LIPIcs, pages 94:1–94:20. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2022. doi:10.4230/LIPIcs.ICALP.2022.94.
  • [24] Jaroslav Nešetřil and Svatopluk Poljak. On the complexity of the subgraph problem. Commentationes Mathematicae Universitatis Carolinae, 026(2):415–419, 1985. URL: http://eudml.org/doc/17394.
  • [25] Mihai Pătraşcu. Towards polynomial lower bounds for dynamic problems. In Leonard J. Schulman, editor, Proceedings of the 42nd ACM Symposium on Theory of Computing, STOC 2010, Cambridge, Massachusetts, USA, 5-8 June 2010, pages 603–610. ACM, 2010. doi:10.1145/1806689.1806772.
  • [26] Liam Roditty and Virginia Vassilevska Williams. Fast approximation algorithms for the diameter and radius of sparse graphs. In Dan Boneh, Tim Roughgarden, and Joan Feigenbaum, editors, Symposium on Theory of Computing Conference, STOC’13, Palo Alto, CA, USA, June 1-4, 2013, pages 515–524. ACM, 2013. doi:10.1145/2488608.2488673.
  • [27] Thomas J. Schaefer. The complexity of satisfiability problems. In Richard J. Lipton, Walter A. Burkhard, Walter J. Savitch, Emily P. Friedman, and Alfred V. Aho, editors, Proceedings of the 10th Annual ACM Symposium on Theory of Computing, May 1-3, 1978, San Diego, California, USA, pages 216–226. ACM, 1978. doi:10.1145/800133.804350.
  • [28] P Turán. On an extremal problem in graph theory. mat. fiz. lapok 48 436–452, 1941.
  • [29] Virginia Vassilevska Williams, Joshua R. Wang, Richard Ryan Williams, and Huacheng Yu. Finding four-node subgraphs in triangle time. In Piotr Indyk, editor, Proc. Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms (SODA 2015), pages 1671–1680. SIAM, 2015. doi:10.1137/1.9781611973730.111.
  • [30] Virginia Vassilevska Williams and Yinzhan Xu. Monochromatic triangles, triangle listing and APSP. In Sandy Irani, editor, 61st IEEE Annual Symposium on Foundations of Computer Science, FOCS 2020, Durham, NC, USA, November 16-19, 2020, pages 786–797. IEEE, 2020. doi:10.1109/FOCS46700.2020.00078.
  • [31] R. Ryan Williams. Algorithms and resource requirements for fundamental problems. PhD thesis, Carnegie Mellon University, USA, 2007. AAI3274191.
  • [32] Or Zamir. Algorithmic applications of hypergraph and partition containers. In Barna Saha and Rocco A. Servedio, editors, Proceedings of the 55th Annual ACM Symposium on Theory of Computing, STOC 2023, Orlando, FL, USA, June 20-23, 2023, pages 985–998. ACM, 2023. doi:10.1145/3564246.3585163.
  • [33] Dmitriy Zhuk. A proof of CSP dichotomy conjecture. In Chris Umans, editor, 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, Berkeley, CA, USA, October 15-17, 2017, pages 331–342. IEEE Computer Society, 2017. doi:10.1109/FOCS.2017.38.