1 Introduction

The study of the computational complexity of counting problems was initiated by Valiant’s seminal work about the complexity of computing the permanent [24]. In contrast to a decision problem which requires to verify the existence of a solution, a counting problem asks to compute the number of solutions. Counting complexity theory is particularly interesting for problems whose decision versions are solvable efficiently but whose counting versions are intractable. One such example is the problem of finding/counting perfect matchings, whose decision version is solvable in polynomial time [10] and whose counting version is at least as hard as every problem in the Polynomial Hierarchy \({{\mathsf {P}}}{{\mathsf {H}}}\) with respect to polynomial-time Turing reductions [23, 24]. In this work, we consider the following problem which was first introduced by Jerrum and Meeks [13]: Fix a graph property \(\varPhi \), given a graph G and a positive integer k, compute the number of all induced subgraphs of G with k vertices that satisfy \(\varPhi \). We denote this problem by \(\#\textsc {IndSub}(\varPhi )\) and remark that, strictly speaking, \(\#\textsc {IndSub}(\varPhi )\) is the unlabeled version of the problem \(p\text {-}\#\textsc {InducedSubgraphWithProperty}(\varPhi )\) as defined in [15, Section 1.3.1]. In particular, our properties only depend on the isomorphism type of a graph and not on any labeling of the vertices.

We study the parameterized complexity of \(\#\textsc {IndSub}(\varPhi )\) depending on the property \(\varPhi \). The underlying framework, known as parameterized counting complexity theory, was introduced independently by Flum and Grohe [11] and McCartin [18], and constitutes a hybrid of (classical) computational counting and parameterized complexity theory. Here, the method of parameterization allows us to perform a multivariate analysis of the complexity of \(\#\textsc {IndSub}(\varPhi )\): Instead of the distinction between polynomial-time solvable and \({{\mathsf {N}}}{{\mathsf {P}}}\)-hard cases, we search for properties \(\varPhi \) for which the problem is solvable in time \(f(k)\cdot n^{O(1)}\), where n is the number of vertices of the graph and f can be any computable function. If this is the case, the problem is called fixed-parameter tractable. Unfortunately, the only known cases of \(\varPhi \) for which \(\#\textsc {IndSub}(\varPhi )\) is fixed-parameter tractable are trivial in the sense that there are only finitely many k such that \(\varPhi \) is neither true nor false on the set of all graphs with k vertices. On the contrary, it is easy to see that \(\#\textsc {IndSub}(\varPhi )\) is most likely not fixed-parameter tractable if \(\varPhi \) encodes a problem whose decision version is already known to be hard. An example of the latter is the property of being a complete graph. In this case, the problem \(\#\textsc {IndSub}(\varPhi )\) is identical to the problem of counting cliques of size k, for which even the decision version, that is, finding a clique of size k in a graph with n vertices, cannot be done in time \(f(k)\cdot n^{o(k)}\), unless the Exponential Time Hypothesis fails [5, 6].

The first non-trivial hardness result of \(\#\textsc {IndSub}(\varPhi )\) was given by Jerrum and Meeks for \(\varPhi \) the property of being connected [13]. Note that, in this case, the decision version of the problem can be solved efficiently as, on input G and k, one only has to decide whether there exists a connected component of G of size at least k. This result initiated a line of research in which Jerrum and Meeks proved fixed-parameter tractability of \(\#\textsc {IndSub}(\varPhi )\) to be unlikely for the property of having an even (or odd) number of edges [15], for properties that induce low edge densities [14] and for properties that are closed under the addition of edges and whose (edge-)minimal elements have large treewidth [19]. More precisely, all of those results established hardness for the parameterized complexity class \(\#\mathsf {W[1]}\), which can be seen as the parameterized counting equivalent of \({{\mathsf {N}}}{{\mathsf {P}}}\). In a recent breakthrough result [8], Curticapean, Dell and Marx have shown, that for every graph property \(\varPhi \), the problem \(\#\textsc {IndSub}(\varPhi )\) is either fixed-parameter tractable or hard for \(\#\mathsf {W[1]}\), that is, there are no cases of intermediate difficulty. On the downside, they did not provide an explicit criterion for \(\#\mathsf {W[1]}\)-hardness that allows to pin down the complexity of \(\#\textsc {IndSub}(\varPhi )\), given a concrete property \(\varPhi \).

However, combining the framework of [8] with tools from the “topological approach to evasiveness” by Kahn, Saks and Sturtevant [16], two of the authors of the current paper established \(\#\mathsf {W[1]}\)-hardness for a wide range of properties, including, for example, all non-trivial properties that are closed under the removal of edges and false on odd cycles [22]. Taken together, the above results suggest the following conjecture.

Conjecture 1

Let \(\varPhi \) be a computable graph property satisfying that there are infinitely many positive integers k such that \(\varPhi \) is neither true nor false on all graphs with k vertices. Then \(\#\textsc {IndSub}(\varPhi )\) is \(\#\mathsf {W[1]}\)-hard.

Unfortunately, a proof of this conjecture seems to be a long way off. In this work however, building up on [8, 22], we introduce an algebraic approach that allows us to resolve the above conjecture in case of all non-trivial monotone properties on bipartite graphs. In particular, we obtain a matching lower bound under the Exponential Time Hypothesis.

Results and techniques  We call a graph property monotone if it closed under the removal of vertices and edges and edge-monotone if it is closed under the removal of edges only. Furthermore, we write \({{\mathsf {I}}}{{\mathsf {S}}}_k\) for the graph consisting of k isolated vertices and \(K_{t,t}\) for the complete bipartite graph with t vertices on each side. Our main theorems read as follows.

Theorem 1

Let \(\varPhi \) be a computable graph property and let \({\mathcal {K}}\) be the set of all prime powers t such that \(\varPhi ({{\mathsf {I}}}{{\mathsf {S}}}_{2t}) \ne \varPhi (K_{t,t})\). If \({\mathcal {K}}\) is infinite then \(\#\textsc {IndSub}(\varPhi )\) is \(\#\mathsf {W[1]}\) hard. If additionally \({\mathcal {K}}\) is dense then it cannot be solved in time \(f(k)\cdot n^{o(k)}\) for any computable function f unless ETH fails. This holds true even if the input graphs to \(\#\textsc {IndSub}(\varPhi )\) are restricted to be bipartite.

In the previous theorem, a set \({\mathcal {K}}\) is dense if there exists a constant c such that for every \(m\in {\mathbb {N}}\), there exists a \(k \in {\mathcal {K}}\) such that \(m\le k \le cm\). While the hypotheses of Theorem 1 sound technical, the theorem applies in many situations. In particular, it is applicable to properties that are neither (edge-) monotone nor the complement thereof: Let \(\varPhi \) be the property of being Eulerian. The graph \(K_{t,t}\) contains an Eulerian cycle if \(t=2^s\) for \(s\ge 1\). Hence we can apply Theorem 1 with \({\mathcal {K}}=\{2^s~|~s \ge 1\} \), which is infinite and dense.

Corollary 1

Let \(\varPhi \) be the property of being Eulerian. Then \(\#\textsc {IndSub}(\varPhi )\) is \(\#\mathsf {W[1]}\)-hard and cannot be solved in time \(f(k)\cdot n^{o(k)}\) for any computable function f unless the ETH fails. This holds true even if the input graphs to \(\#\textsc {IndSub}(\varPhi )\) are restricted to be bipartite.

In case \(\varPhi \) is monotone, that is, closed under the removal of vertices and edges, a short argument implies that the set \({\mathcal {K}}\) from Theorem 1 is infinite if and only if \(\varPhi \) and \(\lnot \varPhi \) hold on infinitely many bipartite graphs. Thus we can state the criterion for hardness more concisely as follows.

Theorem 2

Let \(\varPhi \) be a computable monotone graph property such that \(\varPhi \) and \(\lnot \varPhi \) hold on infinitely many bipartite graphs. Then \(\#\textsc {IndSub}(\varPhi )\) is \(\#\mathsf {W[1]}\)-hard and cannot be solved in time \(f(k)\cdot n^{o(k)}\) for any computable function f unless the Exponential Time Hypothesis fails. This holds true even if the input graphs to \(\#\textsc {IndSub}(\varPhi )\) are restricted to be bipartite.

Let us illustrate further consequences of the previous theorems with respect to (edge-) monotone properties. First of all, most of the prior hardness results [13,14,15, 19, 22] are shown to hold in the restricted case of bipartite graphs. We provide three examples:

Corollary 2

The problem \(\#\textsc {IndSub}(\varPhi )\), restricted to bipartite input graphs, is \(\#\mathsf {W[1]}\)-hard and cannot be solved in time \(f(k)\cdot |V(G)|^{o(k)}\) for any computable function f unless ETH fails, if \(\varPhi \) is one of the properties of being disconnected, planar or non-hamiltonian.

One example of a monotone property \(\varPhi \) for which the complexity of \(\#\textsc {IndSub}(\varPhi )\) was unknown, even for general graphs, is given by the following corollary of Theorem 2.

Corollary 3

Let F be a fixed bipartite graph with at least one edge and define \(\varPhi (G)=1\) if G does not contain a subgraph isomorphic to F. Then \(\#\textsc {IndSub}(\varPhi )\) is \(\#\mathsf {W[1]}\)-hard and cannot be solved in time \(f(k)\cdot |V(G)|^{o(k)}\) for any computable function f unless ETH fails. This holds true even if the input graphs of \(\#\textsc {IndSub}(\varPhi )\) are restricted to be bipartite.

As the number of induced subgraphs of size k that satisfy \(\varPhi \) equals \(\left( {\begin{array}{c}|V(G)|\\ k\end{array}}\right) \) minus the number of induced subgraphs of size k that satisfy \(\lnot \varPhi \), all of the previous result remain true for the complementary properties \(\lnot \varPhi \).

In proving the previous theorems we build up on the approach in [8, 22], where it was shown that, given a graph property \(\varPhi \) and a positive integer k, the number of induced subgraphs of size k in a graph G that satisfy \(\varPhi \) can equivalently be expressed as the following sum over all (isomorphism types of) graphs H:

$$\begin{aligned} \sum _H a_{\varPhi }(H) \cdot \#{\mathsf {Hom}(H \rightarrow G)} \,, \end{aligned}$$
(1)

where \(a_\varPhi \) is a function from graphs to integers with finite support and, furthermore, \(\#{\mathsf {Hom}(H \rightarrow G)}\) is the number of graph homomorphisms from H to G. It is known that computing a linear combination of homomorphism numbers, as in the above expression, is precisely as hard as computing its hardest term with a non-zero coefficient ( [8], also implicitly proved in [4]). We refer to this property as complexity monotonicity. In [22] two of the authors of the current paper used a topological approach to analyze the coefficient \(a_{\varPhi }(K_k)\) of the complete graph on k vertices. If this coefficient is non-zero then complexity monotonicity implies that computing the number of induced subgraphs of size k in a graph G that satisfy \(\varPhi \) is at least as hard as computing the number \(\#{\mathsf {Hom}(K_k \rightarrow G)}\). This, in turn, is equivalent to computing the number of cliques of size k in G, the canonical \(\#\mathsf {W[1]}\)-complete problem [11]. While this approach led to hardness proofs for a wide range of properties \(\varPhi \), it seems that resolving Conjecture 1, even restricted to monotone properties, requires a significant number of new ideas. Without going too much into the detailsFootnote 1 of [22], our analysis of \(a_{\varPhi }(K_k)\) is complicated by the fact that the number of edges of the complete graph on \(k\ge 4\) vertices is not a prime power. In this work, we hence focus on the coefficient of \(a_{\varPhi }(H)\) for graphs H that have a prime power number of edges and for which computing \(\#{\mathsf {Hom}(H \rightarrow G)}\) is hard. One example of such graphs is the biclique \(K_{t,t}\) for some prime power t. Here a biclique \(K_{t,t}\), also called a complete bipartite graph, has t vertices on each side and contains every edge from a vertex on the left side to a vertex to the right side. Hence the number of edges is \(t^2\) which is a prime power if t is.

In analyzing the coefficient \(a_{\varPhi }(K_{t,t})\) of the complete bipartite graph, we invoke the results of Rivest and Vuillemin [21] who considered transitive boolean functions over a domain of prime power cardinality to resolve the asymptotic version of what is known as Karp’s evasiveness conjecture (we recommend Miller’s survey [20] for an excellent overview).

Given a property \(\varPhi \) and a graph H, the alternating enumerator of \(\varPhi \) and H is defined to be

$$\begin{aligned} {\hat{\chi }}(\varPhi ,H) := \sum _{S \subseteq E(H)} \varPhi (H[S])\cdot (-1)^{\#S}\,, \end{aligned}$$

where H[S] is the graph with vertices V(H) and edges S. Roughly speaking, it will turn out that the value of \(a_{\varPhi }(H)\) is closely related to \({\hat{\chi }}(\varPhi ,H)\). We furthermore point out that, in case \(\varPhi \) is closed under the removal of edges, the alternating enumerator \({\hat{\chi }}(\varPhi ,H)\) equals what is called the reduced Euler characteristic of the simplicial complex on E(H) associated to \(\varPhi \) [20, 22]. In Sect. 3 we study the alternating enumerator in case of edge-transitive graphs, that is, graphs whose automorphism groups act transitively on the set of edges. We give a self-contained proof of the following fact, which implicitly follows from [21].

Lemma 1

Let \(\varPhi \) be a graph property and let H be an edge-transitive graph with \(p^\ell \) edges such that p is a prime and \(\varPhi (H[\emptyset ]) \ne \varPhi (H)\). Then it holds that \({\hat{\chi }}(\varPhi ,H) = (\pm 1) \mod p \,.\)

Observe that Lemma 1 provides a strong motivation for the study of edge-transitive graphs with a prime power number of edges: Following the aforementioned strategy, we will be able to show that counting the number of induced subgraphs of size k in a graph G that satisfy \(\varPhi \) is at least as hard as counting homomorphisms from any edge-transitive graph H with k vertices and a prime-power number of edges that satisfies \(\varPhi (H[\emptyset ]) \ne \varPhi (H)\). Ultimately, we will then obtain intractability of \(\#\textsc {IndSub}(\varPhi )\) by relying on the complexity classification for counting homomorphisms due to Dalmau and Jonsson [9].

In the second part of Sect. 3, we will thus fully classify those graphs as subgraphs of bipartite graphs or vertex-transitive subgraphs of wreath graphs; consult Sect. 3 for the formal definitions. The proof of the following theorem, which might be of independent interest, relies on a non-trivial application of Sylow’s theorems.

Theorem 3

Let G be a connected edge-transitive graph with \(p^t\) edges for some prime p and positive integer t. Then either G is bipartite or G is vertex-transitive and can be obtained from the wreath graph \(W_{p^k}\) for \(k \ge 1\) by removing edges (or both).

With the analysis of \({\hat{\chi }}\) and edge-transitive graphs completed, we turn to the reduction from counting homomorphisms in Sect. 4. More precisely, given a class \({\mathcal {H}}\) of edge-transitive graphs with a prime power number of edges and a graph property \(\varPhi \) such that for every \(H\in {\mathcal {H}}\) we have that \(\varPhi (H[\emptyset ]) \ne \varPhi (H)\), we construct a parameterized Turing reduction from \(\#\textsc {Hom}({\mathcal {H}})\) to \(\#\textsc {IndSub}(\varPhi )\). Here, the problem \(\#\textsc {Hom}({\mathcal {H}})\) is defined as follows: Given as input a graph \(H\in {\mathcal {H}}\) and a graph G, compute the number of homomorphisms from H to G. For technical reasons, we cannot immediately transform the number of induced subgraphs that satisfy \(\varPhi \) to a linear combination of homomorphism numbers as in Eq. (1). We solve this technical issue by introducing color-prescribed variants of those problems in an intermediate step. In this context we consider H-colored graphs. Recall that a graph G is H-colored if it comes with a homomorphism c from G to H. A homomorphism from H to G is then called color-prescribed if it maps every vertex v of H to a vertex u of G satisfying that \(c(u)=v\). We demonstrate that, given an H-colored graph G and oracle access to \(\#\textsc {IndSub}(\varPhi )\), the following linear combination can be computed in time \(f(|V(H)|)\cdot |V(G)|^{O(1)}\).

$$\begin{aligned} \sum _{S \subseteq E(H)} {\hat{a}}_\varPhi (S) \cdot \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H[S] \rightarrow _{H} G). \end{aligned}$$
(2)

Here \({{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H[S] \rightarrow _{H} G)\) denotes the set of color-prescribed homomorphisms from H[S] to G and \({\hat{a}}_\varPhi \) is a function of finite support only depending in \(\varPhi \). In particular, \({\hat{a}}_\varPhi (E(H))\) and \({\hat{\chi }}(\varPhi ,H)\) are proved to agree up to a factor of \(-1\). Finally, we establish complexity monotonicity for linear combinations of color-prescribed homomorphisms as in Eq. (2), which in combination with Lemma 1 yields the desired reduction.

Combining the previous results, we invoke the reduction on graph properties that are non-trivial on bipartite graphs and prove Theorems 1 and 2, in Sect. 5. Furthermore, we illustrate in the Sect. 6 that our algebraic approach readily extends to modular counting by proving that both, Theorems 1 and 2 remain true in case counting is done modulo a fixed prime.

2 Preliminaries

Given a positive integer k, we write [k] for the set \(\{1,\dots ,k\}\) and given a set A we write \(\left( {\begin{array}{c}A\\ k\end{array}}\right) \) for the set of all subsets of size k of A. Furthermore, assuming that A is finite, we write \(\#A\) or |A| for its cardinality. Given a function \(g: A\times B \rightarrow C\) and an element \(a\in A\), we write \(g(a,\star )\) for the function which maps \(b \in B\) to g(ab).

2.1 Graph Theory

Graphs in this work are considered simple, undirected and without self-loops. More precisely, a graph G is a pair of a finite set V(G) of vertices and a symmetric and irreflexive relation \(E(G)\subseteq V(G)^2\). If a graph H is obtained from G by deleting a set of edges and a set of vertices of G, including incident edges, then H is called a subgraph of G. Given a subset \({\hat{V}}\) of V(G) we write \(G[{\hat{V}}]\) for the graph with vertices \({\hat{V}}\) and edges \(E \cap {\hat{V}}^2\). The resulting graph is called an induced subgraph of G. An edge-subgraph of a graph H is a graph obtained from H by deleting edges. Given a set \(S\subseteq E(H)\) we write H[S] for the edge-subgraph (V(H), S) of H.

Homomorphisms and embeddings A homomorphism from a graph H to a graph G is a mapping \(h: V(H)\rightarrow V(G)\) that preserves adjacencies. In other words, for every edge \(\{u,v\}\in E(H)\) it holds that \(\{h(u),h(v)\}\in E(G)\). We write \({\mathsf {Hom}(H \rightarrow G)}\) for the set of all homomorphisms from H to G. A homomorphism inducing a bijection of vertices and satisfying \(\{u,v\} \in E(H)\) if and only if \(\{f(u),f(v)\} \in E(G)\) is called an isomorphism and we say that two graphs H and \({\hat{H}}\) are isomorphic if there exists an isomorphism from H to \({\hat{H}}\). We write \({\mathsf {Sub}(H \rightarrow G)}\) and \({\mathsf {IndSub}(H \rightarrow G)}\) for the sets of all subgraphs and induced subgraphs of G, respectively, that are isomorphic to H.

An isomorphism from a graph to itself is called an automorphism. The set of automorphisms of a graph, together with the operation of functional composition constitutes a group, called the automorphism group of a graph. Slightly abusing notation, we will write \(\mathsf {Aut}(H)\) for both the set of automorphisms of a graph H as well as for the automorphism group of H.

An embedding is an injective homomorphism and we write \({\mathsf {Emb}(H \rightarrow G)}\) for the set of embeddings from H to G. If an embedding h from H to G additionally satisfies that \(\{h(u),h(v)\} \in E(G)\) implies \(\{u,v\}\in E(H)\), we call it a strong embedding. We write \({\mathsf {StrEmb}(H \rightarrow G)}\) for the set of strong embeddings from H to G. Observe that the images of embeddings and strong embeddings from H to G are precisely the subgraphs and induced subgraphs of G that are isomorphic to H.

Colored variants Given graphs G and H, we say that G is H-colored if G comes with a homomorphism c from G to H, called an H-coloring. Note that, in particular, every edge-subgraph of H can be H-colored by the identity function on V(H), which is assumed to be the given coloring whenever we consider H-colored edge-subgraphs of H in this paper. Given an edge-subgraph F of H and a homomorphism h from F to a H-colored graph G, we say that h is color-prescribed if for all \(v\in V(F) = V(H)\) it holds that \(c(h(v))= v\). We write \({{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(F \rightarrow _{H} G)\) for the set of all color-prescribed homomorphisms from F to G. \({{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {StrEmb}(F \rightarrow _{H} G)\) is defined similarly for color-prescribed strong embeddings. We point out that a definition of \({{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Emb}\) is obsolete as every color-prescribed homomorphism is injective by definition and hence an embedding. Furthermore, we write \({{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Sub}(F \rightarrow _{H} G)\) and \({{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(F \rightarrow _{H} G)\) for the sets of images of color-prescribed embeddings and strong embeddings from F to G, respectively. Elements of \({{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Sub}(F \rightarrow _{H} G)\) and \({{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(F \rightarrow _{H} G)\) are referred to as color-prescribed subgraphs and induced subgraphs.Footnote 2

Graph properties and the Alternating Enumerator  A graph property is defined to be a function \(\varPhi \) from graphs to \(\{0,1\}\) such that for any pair of isomorphic graphs H and \({\hat{H}}\) we have that \(\varPhi (H)=\varPhi ({\hat{H}})\). Adapting the notation of Rivest and Vuillemin [21], we define the alternating enumerator of a property \(\varPhi \) and a graph H to be the function

$$\begin{aligned} {\hat{\chi }}(\varPhi ,H) := \sum _{S\subseteq E(H)} \varPhi (H[S]) \cdot (-1)^{\#S}\,. \end{aligned}$$

A graph property \(\varPhi \) is called edge-monotone if it is closed under the removal of edges. It is called monotone if it is closed under the removal of edges as well as vertices.Footnote 3 Given a graph property \(\varPhi \), a positive integer k and a graph G, we write \({\mathsf {IndSub}(\varPhi ,k \rightarrow G)}\) for the set of all induced subgraphs of size k of G that satisfy \(\varPhi \). Furthermore, given a graph property \(\varPhi \) and an H-colored graph G, we write \({{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(\varPhi \rightarrow _{H} G)\) for the set of all color-prescribed induced subgraphs of size |V(H)| in G that satisfy \(\varPhi \). Observe that \({{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(\varPhi \rightarrow _{H} G)\) can be expressed as a (disjoint) union over edge-subgraphs of H satisfying \(\varPhi \):

$$\begin{aligned} {{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(\varPhi \rightarrow _{H} G) = \underset{\begin{array}{c} S \in E(H)\\ \varPhi (H[S]) = 1 \end{array}}{{{\dot{\bigcup }}}} {{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(H[S] \rightarrow _{H} G)\,.\end{aligned}$$

2.2 Parameterized Counting Complexity

The field of parameterized counting was introduced independently by McCartin [18] and Flum and Grohe [11] and constitutes a hybrid of classical computational counting and parameterized complexity theory. A parameterized counting problem is a pair of a function \(P:\varSigma ^*\rightarrow {\mathbb {N}}\) and a computable parameterization \(\kappa : \varSigma ^*\rightarrow {\mathbb {N}}\). It is called fixed-parameter tractable (FPT) if there exists a computable function f and a deterministic algorithm that computes P(x) in time \(f(\kappa (x))\cdot |x|^{O(1)}\) for every \(x \in \varSigma ^*\). A parameterized Turing reduction from \((P,\kappa )\) to \(({\hat{P}},{\hat{\kappa }})\) is a deterministic FPT algorithm with respect to \(\kappa \) that is given oracle access to \({\hat{P}}\) and that on input x computes P(x) with the additional restriction that there exists a computable function g such that for any oracle query y it holds that \({\hat{\kappa }}(y) \le g(\kappa (x))\). We write \((P,\kappa ) \le ^{\mathrm {fpt}}_{\mathrm {T}}({\hat{P}},{\hat{\kappa }})\) if a parameterized Turing reduction exists.

Given a graph G and a positive integer k, the parameterized counting problem \(\#\textsc {Clique}\) asks to compute the number of complete subgraphs of size k in G and is parameterized by k, that is \(\kappa (G,k):=k\). It is complete for the class \(\#\mathsf {W[1]}\), which can be seen as a parameterized counting equivalent of \({{\mathsf {N}}}{{\mathsf {P}}}\) [11]. Evidence for the fixed-parameter intractability of \(\#\mathsf {W[1]}\)-hard problems is given by the Exponential Time Hypothesis (ETH), which asserts that 3-\(\textsc {SAT}\) cannot be solvedFootnote 4 in time \(\mathsf {exp}(o(m))\) where m is the number of clauses of the input formula. Assuming ETH, \(\#\textsc {Clique}\) cannot be solved in time \(f(k)\cdot n^{o(k)}\) for any function f [5, 6] and hence \(\#\mathsf {W[1]}\)-hard problems are not fixed-parameter tractable.

Given a recursively enumerable class of graphs \({\mathcal {H}}\), the problem \(\#\textsc {Hom}({\mathcal {H}})\) asks, on input a graph \(H\in {\mathcal {H}}\) and an arbitrary graph G, to compute the number \(\#{\mathsf {Hom}(H \rightarrow G)}\). Its parameterization is given by \(\kappa (H,G) := |V(H)|\). The problems \(\#\textsc {cp-Hom}({\mathcal {H}})\) and \(\#\textsc {cp-IndSub}({\mathcal {H}})\) are defined similarly. Further, we define \(\#\textsc {cp-IndSub}(\varPhi )\) to be the problem of, given a graph G that is H-colored for some graph H, computing \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(\varPhi \rightarrow _{H} G)\) and parameterize it by \(\kappa (G):=|V(H)|\)—note that the H-coloring of G is part of the input and hence \(\kappa \) is well-defined. Finally, the problem \(\#\textsc {IndSub}(\varPhi )\) asks, given a graph G and a positive integer k, to compute \(\#{\mathsf {IndSub}(\varPhi ,k \rightarrow G)}\) and the parameterization is given by \(\kappa (G,k):= k\).

3 Alternating Enumerators and p-edge-Transitive Graphs

In this part of the paper we will provide a rough exposition of the work of Rivest and Vuillemin [21] who studied transitive boolean functions to resolve the asymptotic version of Karp’s evasiveness conjecture. We will then apply their result to graphs H that are both edge-transitive and have \(p^\ell \) many edges for some prime p. This will enable us to conclude that the alternating enumerator of \(\varPhi \) and H is \((\pm 1)\) modulo p whenever \(\varPhi (H[\emptyset ]) \ne \varPhi (H)\). We start by introducing some required notions from algebraic graph theory.

The automorphism group of a graph H induces a group action on the edges of H, given by \(h \{u,v\} := \{h(u),h(v)\}\). A group action is transitive if there exists only one orbit and a graph H is called edge-transitive if the automorphism group action on the edges is transitive, that is, if for every pair of edges \(\{u,v\}\) and \(\{{\hat{u}},{\hat{v}}\}\) there exists an automorphism \(h \in \mathsf {Aut}(H)\) such that \(h \{u,v\} = \{{\hat{u}},{\hat{v}}\}\). If additionally the number of edges of an edge-transitive graph is a prime power \(p^\ell \) we call the graph p-edge-transitive.

Lemma 1

Let \(\varPhi \) be a graph property and let H be an edge-transitive graph with \(p^\ell \) edges such that p is a prime and \(\varPhi (H[\emptyset ]) \ne \varPhi (H)\). Then it holds that \({\hat{\chi }}(\varPhi ,H) = (\pm 1) \mod p \,.\)

Lemma 1 is implicitly proven in [21, Theorem 4.3], but for completeness we will include a short and self-contained proof, demonstrating a first application of the machinery of Sylow subgroups that we will need later.

For the proofs in this section, let us recall some key results from group theory. Given a prime number p, a finite group \(\varGamma '\) is called a p-group if the order \(\# \varGamma '\) is a power of p. The following is a well-known and central result from the theory of finite groups.

Theorem 4

(Sylow theorems) Let \(\varGamma \) be a finite group of order \(\# \varGamma = p^k m\) for a prime p and an integer \(m \ge 1\) coprime to p. Then \(\varGamma \) contains a subgroup \(\varGamma '\) of order \(p^k\). Moreover, every other subgroup \(\varGamma ''\) of \(\varGamma \) of order \(p^k\) is conjugate to \(\varGamma '\), that is there exists \(g \in \varGamma \) with \(\varGamma '' = g \varGamma ' g^{-1}\). In particular, the groups \(\varGamma ', \varGamma ''\) are isomorphic (via the conjugation by g).

Finally, every subgroup \({{\tilde{\varGamma }}} \subseteq \varGamma \) which is a p-group is actually contained in some conjugate \(g \varGamma ' g^{-1}\) of the group \(\varGamma '\).

A subgroup \(\varGamma ' \subseteq \varGamma \) as above is called a p-Sylow subgroup of \(\varGamma \).

The following result is a first important application of the Sylow theorems. It can be found as Exercise (E28) in [1]; we include a proof for completeness.

Lemma 2

Let \(\varGamma \) be a finite group acting transitively on a set T such that \(\# T = p^\ell \) for some \(\ell \ge 0\). Then the induced action of any p-Sylow subgroup \(\varGamma ' \subseteq \varGamma \) on T is still transitive.

Proof

Let \(t_0 \in T\) be any element, then T is the orbit of \(t_0\) under \(\varGamma \). Let \({\text {Stab}}_\varGamma (t_0) = \{g \in \varGamma : g t_0=t_0\}\) be the stabilizer of \(t_0\) under the action of \(\varGamma \). Then by the Orbit-Stabilizer theorem, we have

$$\begin{aligned} \# \varGamma = (\# \varGamma t_0) \cdot (\# {\text {Stab}}_\varGamma (t_0)) = (\# T) \cdot (\# {\text {Stab}}_\varGamma (t_0)). \end{aligned}$$
(3)

As in the Sylow theorems, let km be the unique nonnegative integers such that \(\# \varGamma = p^k m\) with m not divisible by p and let \(\varGamma ' \subseteq \varGamma \) be a p-Sylow subgroup of \(\varGamma \), which is of order \(p^k\). The stabilizer of \(t_0\) under the induced action of the subgroup \(\varGamma ' \subseteq \varGamma \) is given by

$$\begin{aligned} {\text {Stab}}_{\varGamma '}(t_0) = \{g \in \varGamma ' : g t_0 = t_0\} = {\text {Stab}}_\varGamma (t_0) \cap \varGamma '. \end{aligned}$$

Clearly this is a subgroup of the group \(\varGamma '\) and by Lagrange’s theorem, the order of \({\text {Stab}}_{\varGamma '}(t_0)\) divides the order \(p^k\) of \(\varGamma '\). Thus it is itself a power of p, say \(\#{\text {Stab}}_{\varGamma '}(t_0) = p^n\).

On the other hand, \({\text {Stab}}_{\varGamma '}(t_0)\) is also a subgroup of \({\text {Stab}}_\varGamma (t_0)\). Inserting the order of \(\varGamma \) and the size of T in Eq. (3) we obtain

$$\begin{aligned} p^k m = p^\ell \cdot (\# {\text {Stab}}_\varGamma (t_0)), \end{aligned}$$
(4)

and thus \(\# {\text {Stab}}_\varGamma (t_0)\) can at most contain a factor of \(p^{k-\ell }\). Again, by Lagrange’s theorem, the order \(p^n\) of the subgroup \({\text {Stab}}_{\varGamma '}(t_0)\) divides the order of \({\text {Stab}}_\varGamma (t_0)\) and thus \(n \le k-\ell \). Finally, by the Orbit-Stabilizer theorem applied to the action of \(\varGamma '\) on \(t_0\), we have

$$\begin{aligned} p^k = \# \varGamma ' = (\# \varGamma ' t_0) \cdot (\# {\text {Stab}}_{\varGamma '}(t_0)) = (\# \varGamma ' t_0) \cdot p^n. \end{aligned}$$
(5)

Thus, on the one hand we obtain \(\#\varGamma ' t_0 = p^{k-n} \ge p^{k-(k-\ell )} = p^\ell \). On the other hand we obtain \(\varGamma ' t_0 \subseteq T\) and thus \(\# \varGamma ' t_0 \le \# T = p^\ell \). Hence we have the equality \(\# \varGamma ' t_0 = p^\ell = \#T\) and thus \(\varGamma ' t_0 = T\). In other words, the action of \(\varGamma '\) on T is transitive, finishing the proof. \(\square \)

This result allows us to give a short proof of Lemma 1 above.

Proof of Lemma 1

Let \(\varGamma = \mathsf {Aut}(H)\) be the automorphism group of the graph H, then by the assumption that H is edge-transitive, the action of \(\varGamma \) on on the set E(H) of edges of H is transitive. Since \(\#E(H) = p^\ell \) for some \(\ell \ge 0\), we see that by Lemma 2 any p-Sylow subgroup \(\varGamma ' \subseteq \varGamma \) still acts transitively on E(H). Now consider the sum

$$\begin{aligned} {\hat{\chi }}(\varPhi ,H) = \sum _{S\subseteq E(H)} \varPhi (H[S]) \cdot (-1)^{\#S}\,. \end{aligned}$$

The action of \(\varGamma '\) on E(H) induces an action of \(\varGamma '\) on the set of subsets \({\mathcal {P}}(E(H)) := \{S \subseteq E(H)\}\) of E(H). Indeed, for \(S \subset E(H)\) and \(g \in \varGamma '\) we define \(g S = \{ g s : s \in S\}\). For this action, the set \({\mathcal {P}}(E(H))\) can be written as a disjoint union of the orbits \(\varGamma ' S_0\) of a set \({\mathcal {S}}\subseteq {\mathcal {P}}(E(H))\) of representatives \(S_0\). (Recall that for a group action two orbits are either disjoint or equal.) This allows us to write the sum above as

$$\begin{aligned} {\hat{\chi }}(\varPhi ,H) = \sum _{S_0 \in {\mathcal {S}}} \sum _{S \in \varGamma 'S_0} \varPhi (H[S]) \cdot (-1)^{\#S}\,. \end{aligned}$$

Until now we have just reordered the summands above, combining all summands for S in the same \(\varGamma '\) orbit.

Now since all elements \(g \in \varGamma ' \subseteq \mathsf {Aut}(H)\) act by graph automorphisms on H, we have that the graphs \(H[g S_0]\) and \(H[S_0]\) are isomorphic, so in particular \(\varPhi (H[gS_0]) = \varPhi (H[S_0])\). Applying this to the formula for \({\hat{\chi }}(\varPhi ,H)\) above, we get

$$\begin{aligned} {\hat{\chi }}(\varPhi ,H) = \sum _{S_0 \in {\mathcal {S}}} (\# \varGamma 'S_0) \cdot \varPhi (H[S_0]) \cdot (-1)^{\#S_0}\,. \end{aligned}$$
(6)

Now by the Orbit-Stabilizer theorem, the size \(\# \varGamma 'S_0\) of the orbit of \(S_0\) divides the order \(p^k\) of \(\varGamma '\), so \(\# \varGamma 'S_0\) is itself a power of p. Further, unless \(S_0 \subseteq E(H)\) is invariant under \(\varGamma '\), the size of its orbit \(\# \varGamma 'S_0\) is a positive power of p and thus congruent to 0 mod p. However, the only two sets \(S_0 \subseteq E(H)\) invariant under \(\varGamma '\) are \(S_0 = \emptyset \) and \(S_0 = E(H)\): Indeed, assume that \(S_0\) is invariant under \(\varGamma '\) and nonempty. Then \(S_0\) contains an element \(e_0\), and since \(S_0\) is \(\varGamma '\)-invariant, \(S_0\) also contains the entire orbit of \(e_0\) under \(\varGamma '\). But since \(\varGamma '\) acted transitively on E(H), \(S_0\) must equal the whole set E(H).

To summarize, when computing \({\hat{\chi }}(\varPhi ,H)\) modulo p all but two summands in the sum in Eq. (6) are congruent to 0. Hence, we can simplify Eq. (6) to

$$\begin{aligned} {\hat{\chi }}(\varPhi ,H) = \varPhi (H[\emptyset ]) + \varPhi (H[E(H)]) \cdot (-1)^{\#E(H)} = \varPhi (H[\emptyset ]) - \varPhi (H) \mod p\,. \end{aligned}$$

Note that we use the fact that for \(p>2\) we have that \(\#E(H)\) is odd since it is a prime power and for \(p=2\) we have \(-1 = 1\) modulo p. Now, the condition \(\varPhi (H[\emptyset ]) \ne \varPhi (H)\) exactly gives us \(\varPhi (H[\emptyset ]) - \varPhi (H) = \pm 1 \mod p\). \(\square \)

There are two main examples for p-edge-transitive graphs. The first one is the class of the complete, bipartite graphs \(K_{p^\ell ,p^m}\) with \(\ell ,m \ge 0\). The graph \(K_{p^\ell ,p^m}\) has \(p^{\ell +m}\) edges and the automorphism group clearly acts transitively on the edges of that graph. The second example is the class of wreath graphs \(W_{p^k}\) for \(k \ge 1\). The graph \(W_{p^k}\) has \(p^k\) vertices that can be decomposed in disjoint sets \(V_0, \ldots , V_{p-1}\) of order \(p^{k-1}\) each, and edges \(\{v_i, v_{i+1}\}\) for each \(i=0, \ldots , p-1\) and vertices \(v_i \in V_i, v_{i+1} \in V_{i+1}\) (where it is understood that \(V_{p}=V_{0}\)). Thus in total, \(W_{p^k}\) has \(p^{2k-1}\) edges, except for \(p=2\) where it has \(2^{2k-2}\) edges. The graph \(W_{p^k}\) can be seen as the lexicographical product of a p-cycle with a graph consisting of \(p^{k-1}\) disjoint vertices. For \(k=1\) we exactly obtain the p-cycle. To see that \(W_{p^k}\) is edge-transitive, we observe that on the one hand, for fixed i we can apply an arbitrary permutation on \(V_i\) leaving the graph invariant. On the other hand, there exists a “rotational action” sending \(V_j\) to \(V_{j+1}\) for \(j=0, \ldots , p-1\), which also leaves the graph invariant. Using these two types of automorphisms, we can map every edge to every other edge. Consider Fig. 1 for a visualization of the two main examples of p-edge-transitive graphs.

Fig. 1
figure 1

The two main examples for p-edge-transitive graphs: Complete bipartite graphs \(K_{p^\ell ,p^m}\) with \(\ell ,m \ge 0\) (left) and wreath graphs \(W_{p^k}\) for \(k \ge 1\) (right)

A graph G is called vertex-transitive if its automorphism group \(\mathsf {Aut}(G)\) acts transitively on its set of vertices V(G). The following result tells us that in a certain sense \(K_{p^l,p^m}\) and \(W_{p^k}\) are the maximal p-edge-transitive graphs: note that a bipartite graph is a subgraph of a graph of the form \(K_{p^l,p^m}\) for some \(l,m \ge 0\).

Theorem 3

Let G be a connected edge-transitive graph with \(p^t\) edges for some prime p and positive integer t. Then either G is bipartite or G is vertex-transitive and can be obtained from the wreath graph \(W_{p^k}\) for \(k \ge 1\) by removing edges (or both).

For the proof of Theorem 3, we will use the following well-known result about the relation between edge and vertex-transitivity [2, Proposition 15.1].

Lemma 3

Let G be a connected graph and let \(\varGamma \subseteq \mathsf {Aut}(G)\) be a subgroup acting transitively on the set of edges E(G). Then either \(\varGamma \) acts transitively on the set of vertices V(G) (and thus G is vertex-transitive) or G is bipartite (or both).

The proof from [2] carries over verbatim to the setting of the previous lemma, by replacing the full group \(\mathsf {Aut}(G)\) with the subgroup \(\varGamma \).

Finally, before beginning the proof of Theorem 3 we recall some facts about the semidirect product of groups, since such products appear below. Given groups \(\varGamma _1, \varGamma _2\) and a group homomorphism \(\sigma : \varGamma _2 \rightarrow \mathsf {Aut}(\varGamma _1)\), the semidirect product \(\varGamma _1 \rtimes \varGamma _2\) is defined as the group on the underlying set \(\varGamma _1 \times \varGamma _2\) with group law

$$\begin{aligned} (g_1, h_1) \cdot (g_2, h_2) = (g_1 \sigma (h_1)(g_2), h_1 h_2) \text { for }(g_1, h_1), (g_2, h_2) \in \varGamma _1 \times \varGamma _2\,. \end{aligned}$$

The group \(\varGamma _1 \rtimes \varGamma _2\) naturally contains \(\varGamma _1, \varGamma _2\) as the subgroups \(\varGamma _1 \times \{e_{\varGamma _2}\}\) and \(\{e_{\varGamma _1}\} \times \varGamma _2\). Moreover, given a set X and actions of \(\varGamma _1, \varGamma _2\) on X such that

$$\begin{aligned} h \cdot (g \cdot x) = \sigma (h)(g) \cdot (h \cdot x) \text { for }g \in \varGamma _1, h \in \varGamma _2, x \in X \end{aligned}$$

there is a well-defined action of \(\varGamma _1 \rtimes \varGamma _2\) on X given by \((g,h) \cdot x = g \cdot (h \cdot x)\).

Proof of Theorem 3

Let G be a p-edge-transitive, non-bipartite graph. Then by Lemma 2 any p-Sylow subgroup \(\varGamma \subseteq \mathsf {Aut}(G)\) still acts transitively on the edges E(G) of G. By Lemma 3, since G is not bipartite, the group \(\varGamma \) acts transitively on the set of vertices V(G) (and thus G is also vertex-transitive).

We observe that in this case, by the Orbit-Stabilizer theorem, we have \(\# V(G) = p^k\) for some \(k \ge 1\). We claim that, in this case, G is an edge subgraph of \(W_{p^k}\).

To see this, let us reformulate our situation slightly: We identify the vertex set V(G) with the set \([p^k]=\{1, \ldots , p^k\}\). Then we can canonically identify \(\mathsf {Aut}(G)\) as a subgroup of \(S_{p^k}\), the symmetric group on \([p^k]\) (this is because a graph automorphism is uniquely determined by its action on the vertices of a graph). Inside \(\mathsf {Aut}(G)\) we have the subgroup \(\varGamma \), which is a p-group. By the Sylow theorem, there exists a p-Sylow subgroup \(\varGamma ' \subseteq S_{p^k}\) containing \(\varGamma \).Footnote 5 Since the action of \(\varGamma \) is transitive on the set of edges E(G), we can obtain E(G) by starting with some edge \(e_0 = \{v_1, v_2\} \in E(G)\) with \(v_1, v_2 \in [p^k]\) and taking its orbit \(\{ \{g v_1, g v_2\} : g \in \varGamma \} = E(G)\). But note that by instead taking the orbit of \(e_0\) under \(\varGamma ' \subseteq S_{p^k}\) we get at least this set of edges and maybe more. Denote by \(G'\) the graph with vertices \([p^k]\) and edges \(\{ \{g v_1, g v_2\} : g \in \varGamma '\}\). We claim that \(G' \cong W_{p^k}\).

To show this we will explicitly identify the p-Sylow subgroup \(\varGamma ' \subseteq S_{p^k}\) (recall that by the Sylow theorem it is unique up to conjugation, that is reordering of the elements of \([p^k]\)).

First note that \(S_{p^k}\) has \((p^k)!\) elements. Inductively one sees that the highest power of p appearing in this number is \(p^{e(k)}\) for \(e(k)=p^{k-1}+p^{k-2} + \ldots + p + 1\). We will inductively construct a subgroup \(\varGamma (p,k)\) of \(S_{p^k}\) with \(p^{e(k)}\) elements, which then is a p-Sylow subgroup. We note that a description of such a p-Sylow subgroup is given in [25].

For \(k=1\) we have \(e(k)=1\) and a p-Sylow subgroup \(\varGamma (p,1) \subseteq S_p\) is generated by a cyclic permutation \(1 \mapsto 2, 2 \mapsto 3, \ldots , p \mapsto 1\) of the elements of [p]. The group \(\varGamma (p,1)\) is isomorphic to the cyclic group \({\mathbb {Z}}/p{\mathbb {Z}}\).

Now assume we constructed \(\varGamma (p,k-1)\) for some \(k\ge 2\), then we first note that a product of p copies \(\prod _{i=0}^{p-1} \varGamma (p,k-1)\) of \(\varGamma (p,k-1)\) acts on \([p^{k}]\) where the i-th factor acts by permutations on the elements

$$\begin{aligned} ip^{k-1}+1, ip^{k-1}+2, \ldots , ip^{k-1} +p^{k-1}=(i+1)p^{k-1}\,. \end{aligned}$$

All of these actions commute, so we can see the product \(\prod _{i=0}^{p-1} \varGamma (p,k-1)\) as a subgroup of \(S_{p^{k}}\). However, there is a further action of \({\mathbb {Z}}/p{\mathbb {Z}}\) on \([p^{k}]\) sending j to \(j+p^{k-1}\) (modulo \(p^{k}\)). This action cyclically permutes the p blocks of \(p^{k-1}\) elements in \([p^{k}]\) on which the p factors of \(\prod _{i=0}^{p-1} \varGamma (p,k-1)\) act. Thus these two actions do not commute, but indeed they induce an action of the semidirect product

$$\begin{aligned}\varGamma (p,k) = \left( \prod _{i=0}^{p-1} \varGamma (p,k-1)\right) \rtimes {\mathbb {Z}}/p{\mathbb {Z}},\end{aligned}$$

where \({\mathbb {Z}}/p{\mathbb {Z}}\) maps to the automorphism group of \(\prod _{i=0}^{p-1} \varGamma (p,k-1)\) by permuting the factors of the product. We claim that \(\varGamma (p,k)\) is the desired p-Sylow subgroup of \(S_{p^{k}}\).

Indeed, as the underlying set of the semidirect product is simply the product of the two underlying sets of the groups, the number of elements of the semidirect product is

$$\begin{aligned} \# \varGamma (p,k) = (\# \varGamma (p,k-1))^p \cdot p = (p^{e(k-1)})^p \cdot p = p^{pe(k-1)+1}=p^{e(k)}, \end{aligned}$$

so it has the correct number of elements and is indeed a subgroup of \(S_{p^{k}}\).

Now recall what we want to show: for a pair \(\{v_1, v_2\}\) of vertices forming an edge of our original graph G, we want to show that the graph \(G'\) with edges \(\{ \{g v_1, g v_2\} : g \in \varGamma '\cong \varGamma (p,k)\}\) is isomorphic to the wreath graph \(W_{p^k}\). By relabeling the vertices (that is performing a conjugation in \(S_{p^k}\)) we may assume that \(\varGamma '=\varGamma (p,k)\). Furthermore, by a translation in the group \(\varGamma (p,k)\), which acts transitively on the elements of \([p^k]\), we may assume that \(v_1=1\). Now if \(v_2\) were in the first block \([p^{k-1}]\) of vertices, on which the first factor \(\varGamma (p,k-1)\) operates, then it is easy to see that the resulting graph \(G'\) would not be connected: the first factor \(\varGamma (p,k-1)\) would send the edge \(\{1,v_2\}\) only to edges within the first block \([p^{k-1}]\) and then the cyclic permutation by the factor \({\mathbb {Z}}/p{\mathbb {Z}}\) would send this pattern of edges to the \(p-1\) other blocks, giving us a disjoint union of p graphs. This is not possible, since our original graph G is a subgraph of \(G'\) and also was assumed to be connected.

Thus we may assume that \(v_2\) is in one of the other blocks

$$\begin{aligned} P(a)=[p^{k-1}]+ip^{k-1}\text { for }a=1, \ldots , p-1\,. \end{aligned}$$

Now we want to argue that we can reorder these blocks, sending P(a) to P(1) and leaving P(0) invariant, such that the group action of \(\varGamma (p,k)\) is respected. And indeed, let \(b \in {\mathbb {Z}}/p{\mathbb {Z}}\) be the multiplicative inverse of a (such that \(ab = 1 \mod p\)), then there is a permutation of \([p^k]\) sending the block P(i) to the block \(P(i\cdot b \mod p)\) (where the block is just translated as a whole, not permuting the elements inside). And indeed, we see that P(a) is sent to P(1). The reason why this permutation respects the form of the actionFootnote 6 of \(\varGamma (p,k)\) is that multiplication by b induces a group isomorphism \({\mathbb {Z}}/p{\mathbb {Z}} \rightarrow {\mathbb {Z}}/p{\mathbb {Z}}\) on the factor \({\mathbb {Z}}/p{\mathbb {Z}}\) of \(\varGamma (p,k)\).

To summarize, we can assume without loss of generality that we start with an edge \(\{1,v_2\}\) with \(v_2\) in the second block of vertices. But then it is easy to see that the graph \(G'\) obtained by taking the orbit of \(\{1,v_2\}\) under \(\varGamma (p,k)\) is indeed the wreath graph \(W_{p^k}\). Indeed, the group \(\varGamma (p,k)\) acts transitively within each of the p blocks of vertices (since the i-th factor \(\varGamma (p,k-1)\) above acts transitively there), so every edge from the first to the second block is in the orbit of \(\{1,v_2\}\). Then finally the cyclic permutation action of \({\mathbb {Z}}/p{\mathbb {Z}}\) sends these edges to the set of all edges between blocks i and \(i+1\), which exactly gives the set of edges of the wreath graph. This finishes the proof.

\(\square \)

4 The Main Reduction: From Homomorphisms to Induced Subgraphs

In what follows we will construct a sequence of reductions, starting from \(\#\textsc {Hom}({\mathcal {H}})\) and ending in \(\#\textsc {IndSub}(\varPhi )\). Here, \({\mathcal {H}}\) is a recursively enumerable set of p-edge-transitive graphs and \(\varPhi \) is a graph property such that for every graph \(H \in {\mathcal {H}}\) we have that \(\varPhi (H[\emptyset ]) \ne \varPhi (H)\).

More precisely, we will prove that

$$\begin{aligned} \#\textsc {Hom}({\mathcal {H}}) {\mathop {\le ^{\mathrm {fpt}}_{\mathrm {T}}}\limits ^{\text {Lemma 4}}} \#\textsc {cp-Hom}({\mathcal {H}}) {\mathop {\le ^{\mathrm {fpt}}_{\mathrm {T}}}\limits ^{\text {Lemma 9}}} \#\textsc {cp-IndSub}(\varPhi ) {\mathop {\le ^{\mathrm {fpt}}_{\mathrm {T}}}\limits ^{\text {Lemma 10}}} \#\textsc {IndSub}(\varPhi ) \end{aligned}$$
(7)

In particular, all of those reductions will be tight in the sense that conditional lower bounds on the fine-grained complexity of \(\#\textsc {Hom}({\mathcal {H}})\) immediately transfer to \(\#\textsc {IndSub}(\varPhi )\). For the hardness results we rely on a result of Dalmau and Jonsson [9] stating that the problem \(\#\textsc {Hom}({\mathcal {H}})\) is known to be \(\#\mathsf {W[1]}\)-hard whenever \({\mathcal {H}}\) is recursively enumerable and of unbounded treewidth.Footnote 7 Here a class of graphs is said to have unbounded treewidth if for every \(b \in {\mathbb {N}}\) there exists a graph in the class with treewidth at least b.

4.1 Reducing Homomorphisms to Color-Prescribed Homomorphisms

In the first reduction we are given graphs H and G and the goal is to compute \(\#{\mathsf {Hom}(H \rightarrow G)}\) using an oracle for \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H \rightarrow _{H} \star )\). This can be done by taking precisely |V(H)| copies of the vertices of G, that is, one for each vertex in H and then adding an edge between two vertices u and v if they are copies of adjacent vertices in G and the vertices of H corresponding to the copies of V(G) that contain u and v are adjacent in H as well; this construction is also known as the Tensor product of H and G. The construction is formalized in the proof of the following lemma. In particular it is shown that the resulting graph \({\hat{G}}\) is H-colored.

Lemma 4

Let H be a graph. There exists an algorithm \({\mathbb {A}}\) that is given a graph G as input and has oracle access to the function \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H \rightarrow _{H} \star )\) and computes \(\#{\mathsf {Hom}(H \rightarrow G)}\) in time \(f(|V(H)|)\cdot |V(G)|\) where f is a computable function. Further, every oracle query \({\hat{G}}\) satisfies \(|V({\hat{G}})| \le f(|V(H)|) \cdot |V(G)|\).

Proof

Let \(k = |V(H)|\). It will be convenient to assume that \(V(H)=[k]\). Given a graph G, we construct a graph \({\hat{G}}\) as follows. The vertex set of \({\hat{G}}\) is defined to be

$$\begin{aligned} V({\hat{G}}) = \bigcup _{i=1}^{k} V_i \,, \end{aligned}$$

where \(V_i = \{v_i ~|~ v \in V(G)\}\) is a copy of V(G) identified with vertex \(i \in V(H)\). We add an edge \(\{u_i,v_j\}\) to \({\hat{G}}\) if and only if \(\{i,j\} \in E(H)\) and \(\{u,v\} \in E(G)\). Now it can easily be verified that the function \(c: V({\hat{G}}) \rightarrow V(H)\) given by \(c(v_i) := i\) is an H-coloring of \({\hat{G}}\). Furthermore it is easy to see that

$$\begin{aligned} \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H \rightarrow _{H} {\hat{G}}) = \#{\mathsf {Hom}(H \rightarrow G)}\,, \end{aligned}$$

which concludes the proof. \(\square \)

4.2 Reducing Color-prescribed Homomorphisms to Color-prescribed Induced Subgraphs

The reduction from color-prescribed homomorphisms to color-prescribed induced subgraphs requires the introduction of an H-colored variant of the framework of graph motif parameters, which was explicitly introduced in [8] and implicitly used in [4]. More precisely, given an H-colored graph G and a property \(\varPhi \), we will express \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(\varPhi \rightarrow _{H} G)\) as a linear combination of color-prescribed homomorphisms counts, that is, terms of the form \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H[S] \rightarrow _{H} G)\). In a first step, we show complexity monotonicity for linear combinations of color-prescribed homomorphisms. While this property allows a quite simple proof, a second step, in which we study the coefficient of \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H \rightarrow _{H} G)\) requires a thorough understanding of the alternating enumerator of \(\varPhi \) and H. In case of p-edge-transitive graphs, the latter is provided by Lemma 1.

We start by introducing a colored variant of the tensor product of graphs (see e.g. Chapter 5.4.2 in [17]). Given two H-colored graphs G and \({\hat{G}}\) with colorings c and \({\hat{c}}\) we define their color-prescribed tensor product \(G\times _H{\hat{G}}\) as the graph with vertices \(V=\{(v,{\hat{v}})\in V(G)\times V({\hat{G}}) ~|~c(v)={\hat{c}}({\hat{v}})\}\) and edges between \((v,{\hat{v}})\) and \((u,{\hat{u}})\) if and only if \(\{v,u\} \in E(G)\) and \(\{{\hat{v}},{\hat{u}}\} \in E({\hat{G}})\). The next lemma states that \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}\) is linear with respect to \(\times _H\).

Lemma 5

Let H be a graph, let F be an edge-subgraph of H, and let G and \({\hat{G}}\) be H-colored. Then we have that

$$\begin{aligned} \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(F \rightarrow _{H} G \times _H{\hat{G}}) = \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(F \rightarrow _{H} G) \cdot \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(F \rightarrow _{H} {\hat{G}})\,. \end{aligned}$$

Proof

It can easily be verified that the function \(b(h,{\hat{h}})(v) := (h(v),{\hat{h}}(v))\) that assigns elements in \({{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(F \rightarrow _{H} G) \times {{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(F \rightarrow _{H} {\hat{G}})\) to elements in \({{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(F \rightarrow _{H} G \times _H{\hat{G}})\) is a well-defined bijection. \(\square \)

The proof of the complexity monotonicity property for color-prescribed homomorphisms (Lemma 7) will require to solve a system of linear equations. The following lemma proves that the corresponding matrix is non-singular.

Lemma 6

Let H be a graph (which we consider H-coloured by the identity mapping) and let M be a square matrix of size \(2^{|E(H)|}\) such that the rows and columns are identified by the subsets of edges of H. Furthermore assume that the entries of M are given by

$$\begin{aligned} M(S,T) := \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H[S] \rightarrow _{H} H[T])\,. \end{aligned}$$

Then M is non-singular. This holds true even if M is considered as a matrix over \({\mathbb {Z}}_p\), that is, the field with p elements. In the latter case, the entries are taken modulo p.

Proof

We fix any linear extension \(\lesssim \) of the subset inclusion relation on E(H) and order the columns and rows of M accordingly. We claim that M is triangular. To see this we first observe that \(M(S,S)= 1\) for every S, given by the identity homomorphism from H[S] to H[S] which is, of course, color-prescribed. Now consider M(ST) for some \(T\ne S\) with \(T \lesssim S\). It follows that there exists an edge \(\{u,v\}\) in \(S\setminus T\) since \(\lesssim \) linearly extends subset inclusion. Now assume that there exists a color-prescribed homomorphism h from H[S] to H[T]. By color-prescribedness we have that \(h(u)=u\) and \(h(v)=v\), contradicting the fact that h is a homomorphism and \(\{u,v\} \notin T\). Hence \(M(S,T) = 0\) and, consequently, M is upper-triangular. \(\square \)

We are now prepared to prove the color-prescribed variant of complexity monotonicity.

Lemma 7

(Complexity monotonicity) Let H be a graph and let a be a computable function from edge-subgraphs of H to rationals. There exists an algorithm \({\mathbb {A}}\) that is given an H-colored graph G as input and has oracle access to the function

$$\begin{aligned} \sum _{S \subseteq E(H)} a(H[S]) \cdot \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H[S] \rightarrow _{H} \star )\,, \end{aligned}$$

and computes \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H[S] \rightarrow _{H} G)\) for all S such that \(a(H[S])\ne 0\) in time \(f(|H|)\cdot |V(G)|\) where f is a computable function. Furthermore, every oracle query \({\hat{G}}\) satisfies \(|V({\hat{G}})| \le f(|H|)\cdot |V(G)|\).

Proof

Using Lemma 5 we have that for every H-colored graph F it holds that

$$\begin{aligned}&\sum _{S \subseteq E(H)} a(H[S]) \cdot \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H[S] \rightarrow _{H} (G\times _HF)) \end{aligned}$$
(8)
$$\begin{aligned}&\quad =\sum _{S \subseteq E(H)} a(H[S]) \cdot \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H[S] \rightarrow _{H} G)\cdot \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H[S] \rightarrow _{H} F)\,, \end{aligned}$$
(9)

which we can evaluate for \(F=H[\emptyset ],\dots ,H[E(H)]\). This induces a system of linear equations; for each of the aforementioned F we obtain an equation

$$\begin{aligned} b_F = \sum _{S \subseteq E(H)} a_{F,S}\cdot x_S \,, \end{aligned}$$

such that \(b_F = \sum _{S \subseteq E(H)} a(H[S]) \cdot \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H[S] \rightarrow _{H} (G\times _HF))\), and \(a_{F,S} = \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H[S] \rightarrow _{H} F)\), and \(x_S = a(H[S]) \cdot \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H[S] \rightarrow _{H} G)\). Now observe that we can compute \(b_F\) using the oracle, and that we can compute \(a_{F,S}\) in time only depending in H (since F is an edge-subgraph of H and \(S\subseteq E(H)\)). Furthermore, for our choices of F, the corresponding matrix is non-singular by Lemma 6. Consequently, the numbers \(a(H[S]) \cdot \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H[S] \rightarrow _{H} G)\) are uniquely determined and can be computed by solving the system using Gaussian elimination. Finally, we obtain the numbers \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H[S] \rightarrow _{H} G)\) by multiplying with \(a(H[S])^{-1}\) whenever \(a(H[S]) \ne 0\). \(\square \)

It remains to express the number of color-prescribed induced subgraphs that satisfy a property \(\varPhi \) as a linear combination of color-prescribed homomorphisms.

Lemma 8

Let H be a graph, let \(\varPhi \) be a graph property and let G be an H-colored graph. Then it holds that

$$\begin{aligned} \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(\varPhi \rightarrow _{H} G) = \sum _{S \in E(H)} \varPhi (H[S]) \sum _{J \subseteq E(H)\setminus S} (-1)^{\#J} \cdot \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H[S \cup J] \rightarrow _{H} G) \,. \end{aligned}$$

Moreover, the absolute values of the coefficient of \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H \rightarrow _{H} G)\) and \({\hat{\chi }}(\varPhi ,H)\) are equal.

Proof

We start by establishing the following claim.

Claim 1

Let H be graph, let \(S\subseteq E(H)\) and let G be an H-colored graph. Then

$$\begin{aligned} \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(H[S] \rightarrow _{H} G) = \sum _{J\subseteq E(H)\setminus S} (-1)^{\#J} \cdot \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Sub}(H[S\cup J] \rightarrow _{H} G)\,. \end{aligned}$$

Proof of claim

It holds that

$$\begin{aligned}&{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(H[S] \rightarrow _{H} G)\nonumber \\&\quad = {{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Sub}(H[S] \rightarrow _{H} G) \setminus \left( \bigcup _{e \in E(H)\setminus S} {{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Sub}(H[S\cup \{e\}] \rightarrow _{H} G) \right) ,\qquad \end{aligned}$$
(10)

and hence, by inclusion-exclusion, \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(H[S] \rightarrow _{H} G)\) is equal to

$$\begin{aligned}&\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Sub}(H[S] \rightarrow _{H} G) - \sum _{\emptyset \subsetneq J \subseteq E(H)\setminus S} (-1)^{\#J-1}\cdot \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Sub}(H[S\cup J] \rightarrow _{H} G) \end{aligned}$$
(11)
$$\begin{aligned}&\quad =\sum _{J\subseteq E(H)\setminus S} (-1)^{\#J} \cdot \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Sub}(H[S\cup J] \rightarrow _{H} G)\,, \end{aligned}$$
(12)

which concludes the proof of the claim.

Now we have that

$$\begin{aligned}&\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(\varPhi \rightarrow _{H} G) \end{aligned}$$
(13)
$$\begin{aligned}&\quad = \sum _{S \in E(H)} \varPhi (H[S]) \cdot \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(H[S] \rightarrow _{H} G)\end{aligned}$$
(14)
$$\begin{aligned}&\quad = \sum _{S \in E(H)} \varPhi (H[S]) \sum _{J\subseteq E(H)\setminus S} (-1)^{\#J} \cdot \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Sub}(H[S\cup J] \rightarrow _{H} G)\end{aligned}$$
(15)
$$\begin{aligned}&\quad = \sum _{S \in E(H)} \varPhi (H[S]) \sum _{J\subseteq E(H)\setminus S} (-1)^{\#J} \cdot \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H[S\cup J] \rightarrow _{H} G) \end{aligned}$$
(16)

where (14) follows from the definition of \({{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(\varPhi \rightarrow _{H} G)\), (15) is Claim 1 and (16) holds as color-prescribed homomorphisms are injective and a color-prescribed embedding is uniquely identified by its image. Collecting for the coefficient of \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H \rightarrow _{H} G)\) yields

$$\begin{aligned} \sum _{S \in E(H)} \varPhi (H[S])\cdot (-1)^{\#E(H)-\#S} = (-1)^{\#E(H)}\cdot {\hat{\chi }}(\varPhi ,H) \,. \end{aligned}$$
(17)

\(\square \)

The application of the complexity monotonicity property for color-prescribed homomorphisms (Lemma 7) requires non-zero coefficients. However, this can be guaranteed for the coefficient of interest in case of p-edge-transitive graphs as shown in Sect. 3. Formally, the reduction is constructed as follows.

Lemma 9

Let \(\varPhi \) be a computable graph property and let H be a p-edge-transitive graph such that \(\varPhi (H[\emptyset ]) \ne \varPhi (H)\). There exists an algorithm \({\mathbb {A}}\) that is given an H-colored graph G as input and has oracle access to the function

$$\begin{aligned} \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(\varPhi \rightarrow _{H} \star )\,, \end{aligned}$$

and computes \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H \rightarrow _{H} G)\) in time \(f(|H|)\cdot |V(G)|\) where f is a computable function. Furthermore, every oracle query \({\hat{G}}\) is H-colored as well and satisfies \(|V({\hat{G}})| \le f(|H|)\cdot |V(G)|\).

Proof

Using Lemma 8 we can express \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(\varPhi \rightarrow _{H} \star )\) as a linear combination of color-prescribed homomorphisms. In particular, the coefficient of \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H \rightarrow _{H} \star )\) is \((\pm 1) \cdot {\hat{\chi }}(\varPhi ,H)\) and by Lemma 1 we have that this number is non-zero whenever H is p-edge-transitive and \(\varPhi (H[\emptyset ]) \ne \varPhi (H)\). Hence we can use the algorithm from Lemma 7 to compute \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(H \rightarrow _{H} G)\) in the desired running time. \(\square \)

4.3 Reducing Color-Prescribed Induced Subgraphs to Uncolored Induced Subgraphs

The last part of the reduction sequence allows us to get rid of the colors. More precisely, we will reduce the problem of counting color-prescribed induced subgraphs of an H-colored graph to the problem of counting uncolored induced subgraphs of size |V(H)| in a graph, both with respect to some property \(\varPhi \). The proof is a straightforward application of the inclusion-exclusion principle, which is standard for reducing from the colored to the uncolored version of a parameterized counting problem (see for instance [7, Section 1.4.1]). We include a proof only for completeness.

Lemma 10

Let \(\varPhi \) be a graph property and let H be a graph with k vertices. There exists an algorithm \({\mathbb {A}}\) that is given an H-colored graph G as input and has oracle access to the function \(\#{\mathsf {IndSub}(\varPhi ,k \rightarrow \star )}\) and computes \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(\varPhi \rightarrow _{H} G)\) in time \(f(k)\cdot |V(G)|\) where f is a computable function. Furthermore, every oracle query \({\hat{G}}\) satisfies \(|V({\hat{G}})| \le |V(G)|\) and, in particular, \({\hat{G}}\) allows an H-coloring as well.

Proof

It will be convenient to assume that \(V(H)=[k]\). We first check whether the H-coloring c of G is surjective. If this is not the case then there exists some vertex \(i\in V(H)\) such that \(i \notin {{\mathsf {i}}}{{\mathsf {m}}}(c)\) and hence there is no color-prescribed induced subgraph of G, so \({\mathbb {A}}\) can just output 0. Otherwise, the H-coloring of G induces a partition of V(G) in k many non-empty and pairwise disjoint subsets, each associated with some “color” \(i \in V(H)\). This allows us to equivalently express \({{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(\varPhi \rightarrow _{H} G)\) in terms of vertex-colorful induced subgraphs:

$$\begin{aligned} {{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(\varPhi \rightarrow _{H} G) = \left\{ S \subseteq \left( {\begin{array}{c}V(G)\\ k\end{array}}\right) ~\Bigg |~c(S)=[k] ~\wedge ~ \varPhi (G[S]) = 1\right\} \end{aligned}$$
(18)

By the principle of inclusion and exclusion we obtain that

$$\begin{aligned} \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(\varPhi \rightarrow _{H} G)=\sum _{J\subseteq [k]} (-1)^{\#J}\cdot \#{\mathsf {IndSub}(\varPhi ,k \rightarrow G_J)}\,, \end{aligned}$$
(19)

where \(G_J\) is the graph obtained from G by deleting all vertices that are colored with some color in J. Hence we can compute \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {IndSub}(\varPhi \rightarrow _{H} G)\) using \(2^k\) oracle calls. Finally, we observe that H-colored graphs are closed under the removal of vertices and therefore every oracle query \(G_J\) allows an H-coloring. \(\square \)

5 Non-trivial Monotone Properties on Bipartite Graphs

In what follows, we apply the algebraic approach which was laid out in the preceding sections to bipartite graph properties. This will allow us to prove our main result. To this end, we say that a set \({\mathcal {K}}\subseteq {\mathbb {N}}\) is dense if there exists a constant c such that for every \(k'\in {\mathbb {N}}\) there exists \(k \in {\mathcal {K}}\) such that \(k' \le k \le ck'\). Furthermore, we write \({{\mathsf {I}}}{{\mathsf {S}}}_k\) for the graph with k isolated vertices. The following theorem is obtained by invoking the reduction sequence (7) to complete bipartite graphs \(K_{t,t}\) for prime powers \(t=p^k\), which are p-edge-transitive (see Sect. 3). The extension to modular counting is presented in the next section.

Theorem 1

Let \(\varPhi \) be a computable graph property and let \({\mathcal {K}}\) be the set of all prime powers t such that \(\varPhi ({{\mathsf {I}}}{{\mathsf {S}}}_{2t}) \ne \varPhi (K_{t,t})\). If \({\mathcal {K}}\) is infinite then \(\#\textsc {IndSub}(\varPhi )\) is \(\#\mathsf {W[1]}\) hard. If additionally \({\mathcal {K}}\) is dense then it cannot be solved in time \(f(k)\cdot n^{o(k)}\) for any computable function f unless ETH fails. This holds true even if the input graphs to \(\#\textsc {IndSub}(\varPhi )\) are restricted to be bipartite.

While \(\#\mathsf {W[1]}\)-hardness will follow by the classification of Dalmau and Jonsson [9], hardness under ETH requires a tight reduction from counting cliques, which we will present first. In particular we use a trick inspired by Lemma 1.11 in [7] to make the reduction parsimonious which is required for the extension to modular counting in the subsequent section.

Lemma 11

There exists an algorithm that, given a positive integer \(\ell >1\) and a graph G with n vertices, computes in time \(O(\ell n)\) a \(K_{\ell ,\ell }\)-colored graph \(G'\) with at most \(O(\ell n)\) vertices such that the number of cliques of size \(\ell \) in G equals \(\#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(K_{\ell ,\ell } \rightarrow _{K_{\ell ,\ell }} G')\).

Proof

Let the vertex set of G be \(\{v_i \mid 1 \le i \le n\}\) and let that of \(K_{\ell , \ell }\) be \(\{a_i, b_i \mid 1 \le i \le \ell \}\). We now construct the graph \(G'\) on the vertex set \(\{u_{i,j}, w_{i,j} \mid 1 \le i \le \ell , 1 \le j \le n\}\) with a \(K_{\ell , \ell }\)-coloring given by \(c(u_{i,j}) = a_i\) and \(c(w_{i, j}) = b_i\). We add an edge between \(u_{i,j}\) and \(w_{i',j'}\) if and only if

  • either \((i, j) = (i', j')\),

  • or \(i < i'\), \(j < j'\) and the vertices \(v_j\) and \(v_{j'}\) are adjacent,

  • or \(i > i'\), \(j > j'\) and the vertices \(v_j\) and \(v_{j'}\) are adjacent.

Let \(\{v_{j_1}, \ldots v_{j_{\ell }}\}\) be an \(\ell \)-clique in G. Assume w.l.o.g. that \(j_k < j_{k'}\) for \(k < k'\). Then the set \(\{u_{1,j_1}, \ldots u_{\ell , j_\ell }, w_{1,j_1}, \ldots w_{\ell , j_\ell }\}\) forms a colorful biclique in \(G'\), so it gives rise to a color-prescribed homomorphism \(h\in {{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(K_{\ell , \ell } \rightarrow _{K_{\ell ,\ell }} G')\). Now let \(h'\in {{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(K_{\ell , \ell } \rightarrow _{K_{\ell ,\ell }} G')\) be a color-prescribed homomorphism. Then there has to be the following colorful biclique in \(G'\):

$$\begin{aligned} \{u_{1,\alpha _1}, \ldots u_{\ell , \alpha _\ell }, w_{1,\beta _1}, \ldots w_{\ell , \beta _\ell }\}\,. \end{aligned}$$

We first see that for every i we have \(\alpha _i = \beta _i\) since there has to be an edge between \(u_{i, \alpha _i}\) and \(w_{i, \beta _i}\). All other edges now directly imply that \(\{v_{\alpha _1}, \ldots , v_{\alpha _\ell }\}\) is a clique of size \(\ell \) in G. Furthermore the edges enforce \(\alpha _i < \beta _{i'} = \alpha _i\) for every \(i < i'\), i.e. that the \(\alpha _i\) are sorted in increasing order and thus there is a one-to-one correspondence between homomorphisms in \({{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(K_{\ell ,\ell } \rightarrow _{K_{\ell ,\ell }} G')\) and \(\ell \)-cliques in G. \(\square \)

Proof of Theorem 1

Let \(\varPhi \) and \({\mathcal {K}}\) be as given in Theorem 1. We define a class of graphs \({\mathcal {H}}\) as follows:

$$\begin{aligned} {\mathcal {H}} = \{K_{t,t}~|~t \in {\mathcal {K}}\} \,. \end{aligned}$$

By the reductions sequence (7), given by Lemmas 4, 9 and 10, we obtain that \(\#\textsc {Hom}({\mathcal {H}})\le ^{\mathrm {fpt}}_{\mathrm {T}}\#\textsc {IndSub}(\varPhi )\). As \(\varPhi \) is computable, \({\mathcal {H}}\) is recursively enumerable. Furthermore, as \({\mathcal {K}}\) is infinite, we have that there are arbitrary large bicliques in \({\mathcal {H}}\) and, in particular, the treewidth of \({\mathcal {H}}\) is unbounded. Therefore \(\#\textsc {Hom}({\mathcal {H}})\), and hence \(\#\textsc {IndSub}(\varPhi )\), are \(\#\mathsf {W[1]}\)-hard by the classification of counting homomorphisms due to Dalmau and Jonsson [9]. For the tight bound under ETH, we reduce from the decision problem \(\textsc {Clique}\) which asks, given G and k, to decide whether G contains a clique of size k and which cannot be solved in time \(f(k)\cdot n^{o(k)}\) for any computable function f, unless ETH fails [5, 6]. Now assume that \({\mathcal {K}}\) is dense and let (Gk) be an instance of \(\textsc {Clique}\). By density of \({\mathcal {K}}\), there exists \(\ell \in {\mathcal {K}}\) such that \(k \le \ell \le ck\) for some overall constant c independent of k. We construct the graph \({\hat{G}}\) from G by adding \(\ell -k\) further vertices and adding edges between all new vertices as well as between every pair of an old and a new vertex. It can then easily be verified that G contains a clique of size k if and only if \({\hat{G}}\) contains a clique of size \(\ell \).

Next we apply Lemma 11 to \({\hat{G}}\) and \(\ell \), and obtain an \(K_{\ell ,\ell }\)-colored graph \(G'\) satisfying that the number of \(\ell \)-cliques in \({\hat{G}}\) is equal to

$$\begin{aligned} \#{{\mathsf {c}}}{{\mathsf {p}}}\text {-}\mathsf {Hom}(K_{\ell ,\ell } \rightarrow _{K_{\ell ,\ell }} G')\,. \end{aligned}$$

Now we invoke Lemmas 9 and 10 to conclude the reduction. In particular, all reductions are tight in the sense that every oracle call for \(\#\textsc {IndSub}(\varPhi )\) in the final part of the reduction is a pair \(({\tilde{G}},2\ell )\) where the number of vertices of \({\tilde{G}}\) is bounded by \(O(\ell \cdot |V(G)|)\). As \(\ell \le ck\) we conclude that every algorithm that solves \(\#\textsc {IndSub}(\varPhi )\) in time \(f(k)\cdot n^{o(k)}\) can be used to solve \(\textsc {Clique}\) in time \(f(k)\cdot n^{o(k)}\)—just check in the end whether the output is a number greater than zero.

Finally, we point out that for both (\(\#\mathsf {W[1]}\) and ETH) hardness results, the last part of the reduction, that is, Lemma 10 only queries for graphs that are \(K_{t,t}\)-colorable and hence bipartite. \(\square \)

Note that, in case \(\varPhi \) or its complement is edge-monotone, we only have to find infinitely many prime powers t for which \(\varPhi \) is neither true nor false on the set of all edge-subgraphs of \(K_{t,t}\), which is the case for all natural, non-trivial properties that do not rely on the number of vertices in some way.Footnote 8 If \(\varPhi \) (or its complement) is monotone, that is, not only closed under the removal of edges, but also under the removal of vertices, then such artificial properties do not exist and we can state the result more clearly as follows.

Theorem 2

Let \(\varPhi \) be a computable monotone graph property such that \(\varPhi \) and \(\lnot \varPhi \) hold on infinitely many bipartite graphs. Then \(\#\textsc {IndSub}(\varPhi )\) is \(\#\mathsf {W[1]}\)-hard and cannot be solved in time \(f(k)\cdot n^{o(k)}\) for any computable function f unless the Exponential Time Hypothesis fails. This holds true even if the input graphs to \(\#\textsc {IndSub}(\varPhi )\) are restricted to be bipartite.

Proof

Since \(\varPhi \) holds for infinitely many (bipartite) graphs, we have that for each positive integer k, there exists a graph H with at least k vertices such that \(\varPhi (H)=1\). Since \(\varPhi \) is monotone, that is, closed under removal of vertices and edges, and since \({{\mathsf {I}}}{{\mathsf {S}}}_k\) is a subgraph of H, we have that \(\varPhi ({{\mathsf {I}}}{{\mathsf {S}}}_k)=1\).

Next, we claim that \(\varPhi (K_{t,t})=0\) for all but finitely many t. Assume for contradiction that the latter is false, that is, for each t there exists a \(t'\ge t\) such that \(\varPhi (K_{t',t'})=1\). However, this implies that for every bipartite graph H, the property \(\varPhi \) is true for a supergraph of H. Since \(\varPhi \) is monotone, we conclude that \(\varPhi (H)=1\), contradicting the fact that \(\lnot \varPhi \) holds for infinitely many bipartite graphs.

Consequently, we have shown that \(\varPhi ({{\mathsf {I}}}{{\mathsf {S}}}_k)=1\) for all positive integers k and \(\varPhi (K_{t,t})=0\) for all but finitely many t. Hence we can apply Theorem 1 and, in particular, the set \({\mathcal {K}}\) will contain all but finitely many prime powers and is therefore dense. \(\square \)

6 Extension to Modular Counting

In the last part of the paper, we show that our main result (Theorem 1) can easily be extended to counting modulo a fixed prime:

Theorem 5

Let p be a prime number, let \(\varPhi \) be a computable graph property and let \({\mathcal {K}}\) be the set of all prime powers \(t=p^k\) such that \(\varPhi ({{\mathsf {I}}}{{\mathsf {S}}}_{2t}) \ne \varPhi (K_{t,t})\). If \({\mathcal {K}}\) is infinite then \(\mathsf {Mod}_p\textsc {IndSub}(\varPhi )\) is \(\mathsf {Mod}_p\mathsf {W[1]}\) hard. If additionally \({\mathcal {K}}\) is dense, then it cannot be solved in time \(f(k)\cdot n^{o(k)}\) for any computable function f unless ETH fails. This holds true even if the input graphs to \(\mathsf {Mod}_p\textsc {IndSub}(\varPhi )\) are restricted to be bipartite.

Here \(\mathsf {Mod}_p\textsc {IndSub}(\varPhi )\) asks, given G and k, to compute the number of induced subgraphs with k vertices in G that satisfy \(\varPhi \) modulo p. The parameterized complexity class \(\mathsf {Mod}_p\mathsf {W[1]}\) is defined by the problem of, given G and k, deciding whether the number of k-cliques in G is 0 modulo p, which is complete for the class (see [3] for \(p=2\) and Chapter 1.2.2 in [7] for the general case).

First of all, we point out that the modular counting version of Theorem 2 follows as corollary from the above theorem in the same way Theorem 2 follows from Theorem 1. For the proof of Theorem 5 we rely on the following fact stating that all required reductions in Sect. 4 work as well in the case of counting modular a prime number.

Fact 1

Let p be a fixed prime. Then Lemmas 9 and 10 remain true when counting is done modulo p if the graph H is restricted to be \(K_{t,t}\) for some prime power \(t=p^k\).

The only two non-trivial observations required to verify Fact 1 are, first, that \({\hat{\chi }}(\varPhi ,K_{t,t}) \ne 0 \mod p\) whenever \(\varPhi (K_{t,t}[\emptyset ]) \ne \varPhi (K_{t,t})\) (Lemma 1) and, second, that complexity monotonicity (Lemma 7) holds for computation modulo p as well, since non-singularity of the matrix M in the proof is given by Lemma 6 even in case the entries of M are considered to be elements of \({\mathbb {Z}}_p\). The last ingredient for the proof of Theorem 5, in particular for hardness under ETH, requires a method of isolating cliques that works in the parameterized setting. This is given by the following result of Williams et al.

Lemma 12

(Lemma 2.1 in [26]) Let \(p \ge 2\) be an integer, GH be undirected graphs. Let \(G'\) be a random induced subgraph of G such that each vertex is taken with probability 1/2, independently. If there is at least one induced H in G, the number of induced H in \(G'\) is not a multiple of p with probability at least \(2^{-|H|}\).

Proof of Theorem 5

The proof is most similar to the proof of the tight lower bound under ETH in Theorem 1. We start our reduction from the problem of finding a clique of size k. In case \({\mathcal {K}}\) is dense and we aim to establish the ETH hardness result, we perform the following two initial steps before the main reduction:

  1. 1.

    Given G and k, we construct a graph \({\hat{G}}\) such that G contains a clique of size k if and only if \({\hat{G}}\) contains a clique of size \(\ell \) where \(k\le \ell \le ck\) for some overall constant c. The details of the construction are given in the proof of Theorem 1.

  2. 2.

    We use Lemma 12 to isolate an \(\ell \)-clique in \({\hat{G}}\), assuming there is any, with high probability.

For the main part of the reduction we then first apply the reduction from counting cliques to counting color-prescribed homomorphisms from the biclique as given by Lemma 11. In particular, this reduction is parsimonious. Finally, we proceed from this point on precisely as in the proof of Theorem 1, the correctness of which follows by Fact 1.

We conclude by pointing out that, in case the randomized construction of Lemma 12 was used, we can perform probability amplification by repeating the final algorithm \(2^k\) times to end up in a constant success probability. \(\square \)

7 Conclusion

We have established hardness for \(\#\textsc {IndSub}(\varPhi )\) for any (edge-)monotone property \(\varPhi \) that is non-trivial on bipartite graphs. In particular, this holds true even if we count modulo a prime and restrict the input graphs to be bipartite as well. Hence, we did not only significantly extend the set of graph properties \(\varPhi \) for which the (parameterized) complexity of \(\#\textsc {IndSub}(\varPhi )\) is understood, but we also generalized many of the prior results, such as [13, 19] and parts of [22] to the cases of bipartite input graphs and modular counting.

As a next step towards a proof of Conjecture 1, we suggest the study of properties that are defined by forbidden induced subgraphs, for which the complexity of \(\#\textsc {IndSub}(\varPhi )\) is only partially resolved at this point.