The challenges of unbounded treewidth in parameterised subgraph counting problems

Many of the existing tractability results for parameterised problems which involve finding or counting subgraphs with particular properties rely on bounding the treewidth of the minimal subgraphs having the desired property. In this paper, we give a number of hardness results - for decision, approximate counting and exact counting - in the case that this condition on the minimal subgraphs having the desired property does not hold. These results demonstrate that in some cases the bounded treewidth condition is necessary for the existence of an efficient algorithm, and lead to two dichotomies for problems which involve finding or counting multicolour subgraphs.


Introduction
The graph parameter treewidth plays a crucial role in many results relating to parameterised counting complexity, a field introduced by Flum and Grohe in [10]. This is true in particular for subgraph counting problems, informally those problems which can be phrased as follows: Input: An n-vertex graph G = (V, E), and k ∈ N. Parameter: k. Question: How many (labelled) k-vertex subsets of V induce graphs with a given property?
It should be noted that, although we refer to induced subgraphs, problems in which the goal is to count non-induced copies of a given graph H can just as well be formulated in this manner: it suffices to define the property we are looking for to be "contains H as a subgraph".
A formal model for subgraph counting problems of this kind was introduced in [13], and this is the model we use here; in Section 2 we give the full definition of this model and its multicolour version (introduced in [14]), as well as defining natural extensions of these two models to formalise the corresponding decision problems.
Many problems falling within the scope of this model have received attention in the past, including p-#Clique, p-#Path and p-#Cycle [10], p-#Matching [6], p-#Induced Subgraph Isomorphism(C) [5], and p-#Connected Induced Subgraph [13], all of which are known to be intractable from the point of view of paramterised complexity. While there are no non-trivial problems in this family which are known to be tractable from the point of view of exact counting in the uncoloured setting, there are nevertheless a number of positive results regarding approximate counting, many of which exploit the treewidth of the subgraphs to be counted. Arvind and Raman [3] demonstrated that there is an efficient parameterised approximation algorithm to compute the number of (not necessarily induced) copies in a graph G of any given k-vertex graph H of bounded treewidth, while Jerrum and Meeks [13] generalised this to show that the same is true for any monotone property provided that all minimal labelled subgraphs with the desired property have bounded treewidth.
In this paper, we are concerned with the situation in which this last condition does not hold; we show that in a number of situations, if it is not true that all minimal unlabelled subgraphs satisfying a (not necessarily monotone) property have bounded treewidth, the problems considered become intractable (up to standard assumptions in parameterised complexity). In particular, in this setting we prove • exact counting is intractable from the point of view of parameterised complexity, and • in the related problem in which subgraphs must also be colourful (with respect to a colouring of the graph specified as part of the input), both the decision version and approximate counting are intractable from the point of view of parameterised complexity.
Notions of parameterised intractability and approximability will be made precise in Section 1.2, and some examples of problems to which these results can be applied will be given in Section 2.3. Some sufficient conditions for an exact counting problem in this model to be #W [1]-complete were established in [14]; the new hardness results here provide a different kind of sufficient condition for intractability, and so substantially increase the restrictions on what problems in the model could possibly be in FPT from the point of view of exact counting. Additionally, our results provide another source of examples of #W [1]-complete parameterised counting problems, of which relatively few are known at present.
Combined with existing tractability results, our hardness results give rise to dichotomies for the parameterised complexity of multicolour subgraph counting problems from the point of view of decision and approximate counting, when the property in question is monotone, and with the additional restriction in the case of approximate counting that the minimal labelled subgraphs having the property are also minimal when regarded as unlabelled subgraphs. Moreover, it turns out that the conditions required for tractability of both decision and approximation in this case are exactly the same, so in this situation an efficient algorithm for the decision problem implies that there exists an efficient approximation algorithm for the counting version. These results concerning the approximability of the multicolour version make some progress towards a characterisation of which problems in this model admit an FPTRAS, although there is much more work to do in order to provide a good answer to this question. The dichotomies have a flavour reminiscent of that proved by Grohe [12] concerning the complexity of deciding whether there exists a homomorphism from a fixed graph H to the input graph G, and also the result due to Dalmau and Jonsson [7] for the counting version of this problem: in this different setting, the decision problem is known to be tractable if and only if the core of H has bounded treewidth, while the counting version is tractable if and only if H has bounded treewidth itself.
The proofs of our hardness results are based on a construction that exploits the characterisation of graphs of unbounded treewidth given by the Excluded Grid Theorem of Robertson and Seymour [16]. This deep combi-natorial result was previously used by Grohe [12] in proving the hardness of the graph homomorphism problem mentioned above.
The remainder of the paper is organised as follows. In the rest of this section, we introduce the main notations and definitions that will be used throughout the paper, and mention some key background from the theory of parameterised counting complexity. In Section 2, we provide more detailed background, first describing the model we use for subgraph counting problems and some known facts about it, and giving an overview of existing results concerning the complexities of problems within the model, then introducing formally the notions of graph minors and treewidth, which are crucial to our later proofs, before giving some examples of problems in this model to which our results apply. The main technical content is in Section 3, where we describe the construction we will use for all our complexity results, and demonstrate its important features. Finally, all of our complexity results are proved in Section 4.

Notation and definitions
Throughout this paper, all graphs are assumed to be simple, that is they do not have multiple edges or self-loops. The order of a graph G, written |G|, is the number of vertices in G. Given a graph G = (V, E), and a subset U ⊂ V , we write G[U ] for the subgraph of G induced by the vertices of U . For any k ∈ N, we write [k] as shorthand for {1, . . . , k}, and V (k) for the set of all subsets of V of size exactly k, while V k denotes the set of k-tuples of Two graphs G and H are isomorphic, written G ∼ = H, if there exists a bijection θ : V (G) → V (H) so that, for all u, v ∈ V (G), we have θ(u)θ(v) ∈ E(H) if and only if uv ∈ E(G); θ is said to be an isomorphism from G to H. An automorphism on G is an isomorphism from G to itself. We write aut(G) for the number of automorphisms of G. A subgraph of G is a graph of G obtained by possibly deleting vertices and/or edges from G; a spanning subgraph is obtained by deleting edges only. H is said to be a subgraph of If G is coloured by some colouring ω : V → [k], we say that a subset U ⊂ V is colourful (under ω) if, for every i ∈ [k], there exists exactly one vertex u ∈ U such that ω(u) = i; note that can only be achieved if U ∈ V (k) .
We will be considering labelled graphs, where a labelled graph is a pair (H, π) such that H is a graph and π : [|V (H)|] → V (H) is a bijection. Given a graph G = (V, E) and a k-tuple of vertices Given two graphs G and H, a strong embedding of H in G is an injective mapping θ : if and only if uv ∈ E(H). We denote by #StrEmb(H, G) the number of strong embeddings of H in G. If H is a class of labelled graphs, we set If G is also equipped with a k-colouring ω, where |V (H)| = k, we write #ColStrEmb(H, G, ω) for the number of strong embeddings of H in G such that the image of V (H) is colourful under ω. Similarly, we set We can alternatively consider unlabelled embeddings of H in G. In this context we write #SubInd(H, G) for the number of subsets U ∈ V (G) ( Finally, we write #Clique k (G) as shorthand for #SubInd(K k , G), where K k denotes a clique on k vertices.

Parameterised Counting Complexity
In this section, we introduce key notions from parameterised counting complexity, which we will use in the rest of the paper. As when considering the complexity of parameterised decision problems, an algorithm to solve a parameterised counting problem is considered to be efficient if, on input of size n with parameter k, its running time is bounded by f (k)n O(1) , where f is any computable function of k; problems (whether decision or counting problems) admitting such a fpt-algorithm belong to the class FPT and are said to be fixed parameter tractable.
To understand the intractability of parameterised counting problems, Flum and Grohe [10] introduce two kinds of reductions between such problems.
1. An fpt parsimonious reduction from (Π, κ) to (Π , κ ) is an algorithm that computes, for every instance I of Π, an instance I of Π in time f (k) · |I| c such that κ (I ) ≤ g(κ(I)) and
2. An fpt Turing reduction from (Π, κ) to (Π , κ ) is an algorithm A with an oracle to Π such that (a) A computes Π, (b) A is an fpt-algorithm with respect to κ, and (c) there is a computable function g : N → N such that for all oracle queries "Π (y) =?" posed by A on input x we have κ (y) ≤ g(κ(x)).
Using these notions, Flum and Grohe introduce a hierarchy of parameterised counting complexity classes, #W[t], for t ≥ 1; this is the analogue of the W-hierarchy for parameterised decision problems. In order to define this hierarchy, we need some more notions related to satisfiability problems.
The definition of levels of the hierarchy uses the following problem.
p-#WD ψ Input: A structure A and k ∈ N. Parameter: k. Question: How many relations S ⊆ A s of cardinality |S| = k are such that A |= ψ(S) (where A is the universe of A)?
If Ψ is a class of first-order formulas, then p-#WD-Ψ is the class of all problems p-#WD ψ where ψ ∈ Ψ. The classes of first-order formulas Σ t and Π t , for t ≥ 0, are defined inductively. Both Σ 0 and Π 0 denote the class of quantifier-free formulas, while, for t ≥ 1, Σ t is the class of formulas where ψ ∈ Π t−1 , and Π t is the class of formulas where ψ ∈ Σ t−1 . We are now ready to define the classes #W[t], for t ≥ 1.
Just as it is considered to be very unlikely that W[1] = FPT, it is very unlikely that there exists an algorithm running in time f (k)n O(1) for any problem that is hard for the class #W [1]; hardness of a problem can be shown using either of the forms of reductions defined above. We have already mentioned the #W[1]-complete problem p-#Clique (shown to be hard in [10]), which is defined formally as follows.

p-#Clique
Input: A graph G = (V, E), and k ∈ N. Parameter: k. Question: How many k-vertex cliques are there in G?
When considering approximation algorithms for parameterised counting problems, an "efficient" approximation scheme is an FPTRAS, as introduced by Arvind and Raman [3]; this is the analogue of a FPRAS (fully polynomial randomised approximation scheme) in the parameterised setting.
Definition. An FPTRAS for a parameterised counting problem Π with parameter k is a randomised approximation scheme that takes an instance I of Π (with |I| = n), and real numbers > 0 and 0 < δ < 1, and in time f (k) · g(n, 1/ , log(1/δ)) (where f is any function, and g is a polynomial in n, 1/ and log(1/δ)) outputs a rational number z such that Later in the paper, we will also consider the parameterised complexity of decision problems. This will involve the parameterised complexity class W [1], the first level of the W-hierarchy (originally introduced by Downey and Fellows [8]), which is the decision equivalent of the #W-hierarchy. The levels of the W-hierarchy can be defined in a similar way to those of the #W-hierarchy, using the following problem.

WD ψ
Input: A structure A and k ∈ N. Parameter: k. Question: Is there S ⊆ A s of cardinality |S| = k such that A |= ψ(S) (where A is the universe of A)?
The classes W[t], for t ≥ 1, are then defined as follows.
Definition ( [11]). For t ≥ 1, W [t] is the class of all parameterised problems that are fpt-reducible to WD-Π t .
For the formal definition of fpt-reductions and other notions from the theory of paramterised complexity, we refer the reader to [11]. When proving W[1]-hardness of various problems later in the paper, we will use reductions from the problem p-Clique, shown to be W[1]-complete in [8], and formally defined as follows:

p-Clique
Input: A graph G = (V, E), and k ∈ N. Parameter: k. Question: Does G contain a k-vertex clique?

The model
The classes of counting problems we consider fall within the scope of the general model introduced in [13]; this model describes parameterised counting problems in which the goal is to count labelled subgraphs with particular properties. We repeat the definition here for completeness, as well as the extension to multicolour subgraph counting problems defined in [14], before extending it to the corresponding decision problems. Let Φ be a family (φ 1 , φ 2 , . . .) of functions φ k : {0, 1} ( k 2 ) → {0, 1}, such that the function mapping k → φ k is computable. Let (i 1 , . . . , i ( k 2 ) ) be a fixed ordering of all pairs in [k] (2) . For any labelled graph (H, π) we define where e (H,π) {j,l} ∈ {0, 1} and e {j,l} = 1 if and only if π(j)π(l) ∈ E(H). The general problem is then defined as follows.

p-#Induced Subgraph With Property(Φ)
Input: A graph G = (V, E) and an integer k. Parameter: k. Question: What is the cardinality of the set It was argued in [13] that this problem lies in #W[1]: Proposition 2.1. For any Φ, the problem p-#Induced Subgraph With Property(Φ) belongs to #W [1].
Much of this paper will be concerned with the multicolour version of the general problem, introduced in [14] (and also known to belong to #W [1]).

p-#Multicolour Induced Subgraph with Property(Φ)
Input: A graph G = (V, E), an integer k and colouring f : In Section 4 we will also consider the decision versions of both the multicolour and uncoloured variants of the problem, which are defined as follows.

p-Induced Subgraph With Property(Φ)
Input: A graph G = (V, E), and an integer k. Parameter: k.
It is straightforward to verify that both these problems belong to the parameterised complexity class W [1].
In a number of our results below, we will be concerned with the case in which Φ has certain special features; we now define two such features of interest. First of all, we say that Φ is monotone if and only if, for each k ∈ N, Any monotone property Φ is uniquely defined by the minimal labelled graphs satisfying φ k , for each k: a labelled graph (H, π) is a minimal labelled graph satisfying φ k if φ k (H, π) = 1 but, for every proper spanning subgraph H of H (that is, a graph obtained from H by deleting at least one edge but no vertices), φ k (H , π) = 0. We say that H is a minimal unlabelled graph satisfying φ k if there exists a labelling π such that φ k (H, π) = 1, but for every proper spanning subgraph H of H and every labelling π , we have φ k (H , π ) = 0. We say that a monotone property Φ is nice if, for each k ∈ N and unlabelled subgraph H on k vertices, H is a minimal unlabelled subgraph satisfying φ k if and only if there exists a labelling π such that (H, π) is a minimal labelled subgraph satisfying φ k . Observe that all of the specific problems previously studied in the literature (including p-#Clique, p-#Path, p-#Cycle, p-#Matching, p-#Connected Induced Subgraph) can be expressed as instances of p-#Induced Subgraph With Property(Φ) where Φ is a nice property.

The existing complexity landscape
In this section we review some important facts about the complexities of problems described by the various models introduced above.

Relative complexities of problem variants
Earlier in this section, we introduced both the uncoloured and multicolour versions of our general subgraph counting problem, as well as the corresponding pair of decision problems. If we consider separately the complexities of exact and approximate counting, the different versions of the model give rise to six distinct complexity questions for any given property Φ: for both the uncoloured and multicolour versions, we can ask the following three questions.

Is the decision version in FPT?
2. Is there an FPTRAS for the counting version?

Is the exact counting problem in FPT?
The answers to some of these questions have implications for some of the others. First of all, it is clear that if the exact counting problem is in FPT for some property Φ, then there is trivially an FPTRAS for the problem and also the corresponding decision problem must be in FPT.
To consider the relationship between decision and approximate counting, we need a further definition. The class randomised FPT is the class of parameterised decision problems for which there is a randomised algorithm with the following properties: if the correct answer is "NO", the algorithm always outputs "NO".
3. if the correct answer is "YES", the algorithm outputs "YES" with probability strictly greater than 1 2 .
In the following proposition, we show that the existence of an FPTRAS for a counting problem in our model implies that the corresponding decision problem belongs to randomised FPT.
Proof. Suppose that there exists an FPTRAS for p-#Induced Subgraph With Property(Φ). Running this randomised approximation algorithm with = 1/2 and δ = 1 2n+1 immediately gives a randomised fixed parameter tractable decision algorithm A with two-sided error probability strictly smaller than 1 2n : if the answer to the decision problem is "NO" then the approximation algorithm must output "0" with probability at least 1 2n+1 , whereas if the answer to the decision problem is "YES" then the approximation algorithm must output a value of at least 1/2 with probability at least 1 2n+1 . It remains to show that this two-sided error can be reduced to a one-sided error, without increasing the probability of error too much.
We do this using standard techniques, similar to those employed to show that certain problems (so-called "self-reducible" problems) in the class BPP are in fact contained in RP; the idea is that before outputting the answer "YES" we will search for a witness to the fact that the input is indeed a yes-instance. We begin by running our randomised decision algorithm A; if the output of A is "NO" then we return "NO". If, on the other hand, the output of A is "YES" we begin our search for a witness.
Suppose our input graph is G, and that the parameter is k. The first step in the search for a witness is to delete an arbitrary vertex v from our input graph G, and running A on the resulting graph. If the output of A on this new graph is "YES", we repeat the deletion process (but always ensuring that we do not delete a vertex we have previously marked as "necessary"); if the output is "NO" then we mark the vertex v as "necessary", delete a vertex that is not yet marked as necessary, and continue. This process terminates when either: 1. k + 1 vertices have been marked as necessary, in which case we return "NO", or 2. there are exactly k vertices remaining, in which case we check (in time depending only on k) whether φ k is true on any tuple formed of the remaining vertices; if so we return "YES", and otherwise we return "NO".
It is clear that this witness search process is fixed parameter tractable, and moreover that it will only return "YES" if we do indeed have a yesinstance. To bound the probability of returning "NO" if we actually have a yes-instance, observe that we call the algorithm A at most n times (where n is the number of vertices in G), so by the union bound the probability that the algorithm will return the incorrect answer on at least one of these calls is at most n 2n+1 < 1 2 ; if A returns the correct answer on all of the calls then we are sure to return "YES" on any yes-instance. Thus the procedure described does indeed give a randomised fpt-algorithm for p-Induced Subgraph With Property(Φ).
The corresponding result for the multicolour versions of the problems follows by exactly the same argument.
Subject to the widely held assumption that W [1] randomised FPT, this gives the following immediate corollary. The relationships between the complexities of multicolour and uncoloured versions of the problems are somewhat more complicated. For the case of exact counting, the following result was proved in [13].
However, this relationship is reversed for both decision and approximate counting: the use of colour-coding techniques (as described in [2] and [1]) gives the following two results. The complexity implications from the preceding results are summarised in Figure 1; an arrow from problem A to problem B implies that (subject to standard assumptions in parameterised complexity theory), if problem A is efficiently solvable (either it is in FPT, or it admits and FPTRAS, as appropriate), then there must also be an efficient algorithm for problem B. In Figure 1 above, it is natural to wonder whether some of the problems variants for any given Φ might in fact be equivalent under fpt-Turing reductions.
Here we give an example which demonstrates that, for certain pairs of problem variants, this is not the case: in particular, the converses of Propositions 2.5 and 2.6 do not hold. For our example, is true if and only if the vertices v 1 , . . . , v k induce either a clique or independent set in G. We call the decision problem in this case p-Clique or Independent Set, and the counting version p-#Clique or Independent Set.
The following result was proved in [3], using the fact from Ramsey Theory that any graph on n vertices is guaranteed to contain either a clique or independent set on k vertices, provided that n is sufficiently large compared with k.
Using a similar construction to that exploited in [3] to demonstrate the #W[1]-hardness of p-#Clique or Independent Set, it is straightforward to prove that the multicolour decision problem is W[1]-complete.
Proof. We proceed by means of a reduction from p-Multicolour Clique, shown to be W[1]-complete in [9]. Let G with colouring f be the input to an instance of p-Multicolour Clique; without loss of generality we may assume that f colours the vertices of G with colours {1, . . . , k}. We now construct G from G by adding a new vertex v adjacent to every vertex of G; we extend the colouring f , to give a colouring f of the vertices of G , by setting f (v) = k + 1. Any colourful subset of vertices in G with colouring f must therefore contain v, but as v is adjacent to all other vertices it cannot be part of any k + 1-independent set. Thus, there is a colourful clique or independent set in G (with colouring f ) if and only if there is a colourful clique in G (with colouring f ).
As a consequence, it is clear that there is unlikely to be an FPTRAS for p-#Multicolour Clique or Independent Set. However, we now demonstrate that the uncoloured counting problem is efficiently approximable, answering an open question from [3]. We begin with an auxiliary result, proved in [14]. Then the number of k-vertex subsets U ⊂ V such that U induces either a clique or independent set in G is at least Using this fact, we can now demonstrate the existence of an FPTRAS for p-#Clique or Independent Set. Lemma 2.10. There exists an FPTRAS for p-#Clique or Independent Set Proof. We obtain an approximation to the total number N of k-vertex cliques and independent sets in our graph using a simple random sampling algorithm. At each step, a set of k vertices is picked uniformly at random from all such sets, and then we check whether this set induces a clique or independent set; the sampling and checking can clearly be performed in time f (k) · n O(1) for a computable function f . To obtain a good estimate of the total number of cliques and independent sets in the entire graph, we repeat this sampling process t times (for some value of t to be determined), and compute the proportion p of our sampled sets which did induce either a clique or independent set. We then output as our approximation p n k . The value of t must be chosen to be large enough that the probability that |p n k −N | ≤ N is at least 1−δ. However, we know that the probability of any randomly chosen subset of k vertices inducing either a clique or an independent set is at least Thus it is straightforward to verify (using, for example, a Chernoff bound) that the number of trials required is bounded by a g(k) · q( −1 , log(δ −1 )), where g is a computable function and q is a polynomial in −1 and log(δ −1 ), as required to satisfy the definition of an FPTRAS.

Graph minors and Treewidth
The graph parameter treewidth will play a crucial role in the remainder of the paper. We say that (T, D) is a tree decomposition of G if T is a tree and D = {D(t) : t ∈ V (T )} is a collection of non-empty subsets of V (G) (or bags), indexed by the nodes of T , satisfying: 2. for every e = uv ∈ E(G), there exists t ∈ V (T ) such that u, v ∈ D(t), The width of the tree decomposition (T, D) is defined to be max t∈V (T ) |D(t)|− 1, and the treewidth of G, written tw(G), is the minimum width over all tree decompositions of G.
Another key concept in the following sections is that of graph minors; this extends the idea of subgraphs. The graph H is said to be a minor of G if there is a mapping m : V (H) → P(V (G)), mapping vertices of H to sets of vertices from G, satisfying: The concepts of treewidth and graph minors are combined in the celebrated Excluded Grid Theorem, proved by Robertson and Seymour.
Theorem 2.11 (Excluded Grid Theorem [16]). There is a computable function w : N → N such that the (k × k) grid is a minor of every graph of treewidth at least w(k).

Complexity results involving treewidth
A number of specific results concerning the complexity of problems described by our model have already been mentioned. Here we state more known results for such problems, all of which involve the concept of treewidth.
The first, rewritten in the language of our model, states that problem of deciding whether a graph G contains a copy (not necessarily induced) of a given k-vertex graph H of bounded treewidth is in FPT.
, 1}, such that the function mapping k → φ k is computable. Suppose that Φ is monotone, and that for each k ∈ N there is a unique minimal labelled graph (H k , π k ) satisfying φ k . If there exists some constant t ∈ N such that, for each k, tw(H k ) ≤ t, then p-Induced Subgraph With Property(Φ) and p-Multicolour Induced Subgraph with Property(Φ) are in FPT.
The following more general result follows as an easy corollary.
It is not hard to show that the same is true provided that all minimal unlabelled subgraphs with the property have bounded treewidth.
Proof. We will define a family Φ = (φ 1 , φ 2 , . . .) of monotone functions φ k : for some computable function f ) such that for every k all minimal labelled subgraphs satisfying φ k have treewidth at most t, and argue that a graph G contains a k-vertex subgraph satisfying φ k if and only if G contains a k-vertex subgraph satisfying φ k . The result will then follow from Corollary 2.13.
Suppose that the minimal labelled subgraphs satisfying φ k are precisely (H k 1 , π k 1 ), . . . , (H k r k , π k r k ). If each H k i is also a minimal unlabelled subgraph satisfying φ k , we are done with φ k = φ k , so suppose without loss of generality that there exists 1 ≤ s k ≤ r k such that the minimal unlabelled subgraphs satisfying φ k are precisely H k 1 , . . . , H k s k . Now set the minimal labelled subgraphs satisfying φ k to be (H k 1 , π k 1 ), . . . , (H k s k , π k s k ); as Φ is monotone, this uniquely , . . . , (H k s k , π k k )} then we are done, so it must be that, for some i ∈ {s k + 1, . . . , r k }, G[v 1 , . . . , v k ] = (H k i , π k i ). Since H k i is not a minimal unlabelled subgraph satisfying φ k , there must be some 1 ≤ j ≤ s such that H k j is a proper spanning subgraph of H i ; in other words there exists a permutation σ : [k] → [k] such that, for all a, b ∈ [k], we have π k i (a)π k i (b) ∈ E(H k i ) whenever σ(π k j (a))σ(π k j (b)) ∈ E(H j ). It follows immediately that φ k (G[v σ(1) , . . . , v σ(k) ]) = 1, as required.
The counting version of the problem for any Φ for which the minimal labelled satisfying subgraphs have bounded treewidth was shown to admit an FPTRAS in [13]; it follows immediately from the proof given in [13] that the same is true for the multicolour version in this situation.

Examples of problems covered by our results
Some obvious examples of problems, from the model introduced above, to which our intractability results apply come from properties that in some way depend on the treewidth of the graph. For example, if we set φ k (H, π) = 1 if and only if H has treewidth at least θ(k), where θ is any function such that θ(k) → ∞ as k → ∞, then it is clear that there cannot be any constant t such that, for all k, all minimal (unlabelled) subgraphs satisfying φ k have treewidth at most t (indeed, for any constant t, there will exist k ∈ N such that all minimal subgraphs satisfying φ k have treewidth greater than t). The same is true if, for example, we set φ k (H, π) = 1 if and only if the chromatic number of H is at least θ(k) (where again θ(k) → ∞ as k → ∞), since any graph with treewidth at most t has chromatic number at most t + 1.
It is also clear that our results apply when φ k is true only if H contains a complete bipartite spanning subgraph. This category of problems includes the case in which φ k (H) = 1 if and only if k is even and H ∼ = Kk 2 , k 2 , a problem whose parameterised complexity from the point of view of decision, in the uncoloured case, is a long-standing open problem.
Slightly less obvious examples of problems for which there is no t ∈ N that bounds the treewidth of all minimal (unlabelled) elements satisfying φ k , for all k, arise when φ k is true on a k-vertex subgraph if and only if certain connectivity conditions are satisfied: while p-#Connected Induced Subgraph, studied in [13], is an example of a property for which all minimal elements do have bounded treewidth (since the minimal elements satisfying φ k are precisely all trees on k vertices), if we instead demand stronger connectivity conditions this is no longer the case. It is straightforward to verify that the graph obtained by subdividing every edge of the k × k grid exactly once (that is, replacing every edge of the grid with a new vertex adjacent to both endpoints of the original edge) has treewidth at least k and is also a minimally 2-connected graph, in the sense that it is 2-connected but deleting any edge will result in a graph that is no longer 2-connected. Similarly, the graph illustrated in Figure 2 has treewidth at least k (as it contains the k × k grid as a minor) and is 3-connected, but deleting any edge will result in a graph that is no longer 3-connected (as such a subgraph will contain at least one vertex of degree at most 2, and so the graph cannot possibly be 3-connected). Both of these problems were already shown to be hard from the point of view of decision in the uncoloured case in [4], in which the authors proved that the problem of deciding whether a graph contains an r-connected induced subgraph on k vertices is W[1]-complete.

A construction
In this section, we describe the construction that we will exploit to prove our complexity results in the following section. Let G be the graph in an instance of p-Clique with parameter k, and let H be a graph which contains the k × k 2 grid as a minor. We then define a new coloured graph G H , and a colouring f of its vertices with |V (H)| colours. In order to define our construction, it will be necessary to fix an arbitrary total order ≺ on V (G).
Let A denote the k × k 2 grid. We will label each of the k rows with a distinct element of the set {1, . . . , k}, and each of the k 2 columns with a distinct unordered pair of elements from the same set. We then denote by a (i,{j,l}) the vertex in row i and column j.
Since We now set That is, the vertex-set of G H is made up of all the vertices in subgraphs H To complete the definition of G H , we now define its edge-set. Let u, w ∈ V (G H ). Then uw ∈ E(G H ) if and only if the following conditions are satisfied: Note that the second condition implies that there are no edges between H

Properties of the construction
In this section, we prove the important properties of the construction defined above; these properties will for the basis of the proofs of our complexity results in Section 4. We begin by giving a necessary and sufficient condition for a colourful subgraph in G H to be isomorphic to H. Proof. Let π : Y → V (H) be the mapping given by π(u) = ω −1 f (u). We claim first that Y defines an isomorphism from G H [Y ] to a subgraph of H. To verify this claim, it suffices to check that, whenever u, w ∈ Y with uw ∈ E(G H ), we also have π(u)π(w) ∈ E(H). However, by the first condition in the definition of E(G H ), we can only have uw , the following conditions are satisfied: We claim that in this case π defines an isomorphism from G H [Y ] to H. This claim holds provided that, for all u, w ∈ Y such that π(u)π(w) ∈ E(H) we also have uw ∈ E(G H ). The assumption that π(u)π(w) ∈ E(H) implies that the first condition for uw to be an edge of G H is satisfied, and the condition we are assuming is exactly the same as the second condition for uw to be an edge; thus it follows immediately that in this situation we will have uw ∈ E(G H ) as required.
Conversely, suppose that the colourful subset Y ⊂ V (G H ) induces a subgraph isomorphic to H. We have already established that π defines an isomorphism from G H [Y ] to a subgraph of H, and hence in this case π must be an isomorphism from and ω −1 f (u)ω −1 f (w) ∈ E(H); by definition of π this implies that π(u)π(w) ∈ E(H), and so as π is an isomorphism we must have uw ∈ E(G H ). It then follows immediately from the second condition in the definition of E(G H ) that as required.
Using this characterisation, we can now relate the number of colourful subgraphs in G H that are isomorphic to H to the number of cliques in G. Proof. We will prove this result by showing that there is a one-to-one correspondence between colourful copies of H in G H with colouring f and k-vertex subsets of V (G) that induce cliques, implying the result. We begin by giving an injective map from the set of k-vertex subsets inducing cliques in G to the colourful copies of H in G H with colouring f ; we will then proceed to give an injective map in the opposite direction.
Given a a subset X ∈ V (G) (k) that induces a clique in G, we denote by x 1 , . . . , x k the elements of X, with x 1 ≺ . . . ≺ x k . We then claim that the mapping π, where is an injective mapping from k-vertex subsets of V (G) that induce cliques in G to colourful copies of H in G H (with respect to the colouring f ). Observe first that this mapping is well-defined: if {x 1 , . . . , x k } induces a clique in G, all edges x j x l (with j, l ∈ [k], j = l) are edges of G, and moreover x i is incident with x j x l whenever i ∈ {j, l}, so the specified subgraphs H It is immediate from the definition of π that, for X = X , we will have π(X) = π(X ). Thus, to show that π defines an injective map from the set of k-tuples inducing cliques in G to the set of colourful copies of H in G H , it remains only to demonstrate that, whenever X induces a clique in G, π(X) must induce a colourful copy of H in G H (with respect to f ).
We verify first that π(X) is indeed colourful with respect to f . First note that all vertices of V H have distinct colours, and do not share colours with ,{j,l}) ). Thus, π(X) contains exactly one vertex u (v,e) (for some (v, e) ∈ V (G) × E(G)) for each u ∈ V (H) \ V H , and so by definition of f we see that π(X) is indeed colourful with respect to f . Hence, by Lemma 3.1, it suffices to verify that, for every pair of vertices u, w ∈ π(X)\V H such that u ∈ H {j ,l }) and ω −1 f (u)ω −1 f (w) ∈ E(H), the following conditions are satisfied: However, these two conditions follow immediately from the definition of π, so π(X) does indeed induce a colourful copy of H, as required.
We now proceed to define a mapping in the opposite direction, that is an injective mapping from colourful copies of H in G H (with colouring f H ) to k-vertex subsets of V (G) that induce cliques in G. Suppose that the colourful subset Y ⊂ V (G H ) induces a copy of H. In order to define our mapping, we prove a series of claims.  {j , l })). Similarly, for each {j, l} ∈ [k] (2) and every i, i ∈ [k], we have {j, l})). To prove this claim we suppose, for a contradiction, there exist {j, l} and {j , l } such that σ 1 Y ((i, {j, l})) = σ 1 Y ((i, {j , l })); we may assume without loss of generality that a (i,{j,l}) and a (i,{j ,l }) are adjacent in the grid A. Now, by definition of m, there exist vertices z, z ∈ V (H) such that z ∈ m(a (i,{j,l}) ), z ∈ m(a (i,{j ,l }) ) and zz ∈ E(H). Let y and y be the vertices of Y whose colours match z and z respectively, that is y = f | −1 Y ω(z) and y = f | −1 Y ω(z ) (as Y is colourful, the restriction of f to Y is a bijection). Note that we . By our assumption, {j , l })), but by Lemma 3.1 this then means that Y cannot induce a copy of H in G H , giving a contradiction. Thus we know that, for each i ∈ [k], we must have σ 1 (2) . An analogous argument can be used to show that, for each {j, l} ∈ [k] (2) , we must have σ 2 Hence we can define the mapping τ 1 and in particular that no two of these vertices are the same. As in the proof of the preceding claim, we observe that by definition of m, for each i ∈ {1, . . . , k − 1}, there exist z, z ∈ V (H) such that z ∈ m(a (i,{1,2}) ), z ∈ m(a (i+1,{1,2}) ) and zz ∈ E(H); as before, we . Since i < i + 1, it now follows from Lemma 3.1 that τ 1 Y (i) ≺ τ 1 Y (i + 1), as required.
: since G is a simple graph with no self-loops this will imply that τ 1 Y (i) = τ 1 Y (i ) and hence we will have |V Y | = k.
Suppose, therefore, that 1 ≤ i < i ≤ k, and consider the edge e ∈ E(G) such that τ 2 Y ({i, i }) = e. We claim that e must in fact be τ 1 To see that this is true, note that, by definition, we have (i ,{i,i }) must both belong to G H . However, by definition of V (G H ), the fact that i ∈ {i, i } and i ∈ {i, i } implies that both τ 1 Y (i) and τ 1 Y (i ) must be incident with e, and since τ 1 , as required, implying that V Y does indeed induce a k-clique in G. Note that this argument further implies that, for all j, l ∈ [k], is injective. It follows from the preceding claims that this mapping is a well-defined mapping from colourful subsets of V (G H ) such that G H [Y ] ∼ = H to k-tuples of G that induce cliques, so the proof of this claim will complete the proof of the result.
To see that this claim holds, suppose that Y and Y are distinct colourful subsets of G H with respect to the colouring f , such that G H [Y ], G H [Y ] ∼ = H. By the reasoning above, we know that there are functions τ 1 ), the fact that Y and Y are not equal implies that τ 1 Y = τ 1 Y . It therefore follows immediately that the images of Y and Y under our mapping are distinct.
We now prove a simple fact about the number of colourful copies of graphs from some collection H in G H , provided that H satisfies certain conditions. Proof. We know from Lemma 3.1 that any colourful subset in G H induces a subgraph of H; thus, by our assumption that H does not contain any proper subgraphs of H, it follows immediately that the number of colourful labelled copies of graphs from H in G H (with respect to the colouring f ) is exactly equal to the number of colourful labelled copies of graphs from H H in G H (with colouring f ).

Complexity results
In this section, we make use of the construction described in Section 3 above to prove a number of complexity results. We will give a treewidth-based condition that guarantees hardness of exact counting for problems falling within our model, and dichotomies for the complexity of decision and approximate counting in the multicolour case, which have implications for the corresponding uncoloured problems. We begin, however, with some auxiliary results.

Auxiliary results
Here we give two auxiliary results which will be used to prove the complexity results below. First, we will make use of the following lemma, proved in [14]. Then, for any graph G, Moreover, if G is equipped with a k-colouring f , then Note that the value of α H , as defined in the statement of this lemma, can be computed from H and H in time bounded only by some computable function of k.
The following easy proposition will also be used in several of our proofs below.
, 1}, such that the function mapping k → φ k is computable. Suppose that there exists a computable function g such that, for every t ∈ N, there exists l ≤ g(t) such that some minimal unlabelled subgraph satisfying φ l has treewidth greater than t. Then, for every j ∈ N there exists k ∈ N such that some minimal unlabelled subgraph satisfying φ k contains the (j × j 2 ) grid as a minor; moreover, the value of this k is bounded by some computable function of j.
Proof. By the Excluded Grid Theorem (Theorem 2.11), there exists a computable function w such that every graph with treewidth at least w( j 2 ) contains as a minor the ( j 2 × j 2 ) grid, and hence the (j × j 2 ) grid. Thus, by our assumptions on Φ, there exists k ≤ g(w( j 2 )) such that some minimal unlabelled graph (H, π), satisfying φ k , contains the (j × j 2 ) grid as a minor.

Hardness of exact counting
In this section, we give a sufficient condition for subgraph counting problems in our model to be #W[1]-complete: if there is no t ∈ N such that, for every k ∈ N, all minimal unlabelled subgraphs satisfying φ k have treewidth at most t, then p-#Induced Subgraph With Property(Φ) is #W[1]complete, and the same is true for p-#Multicolour Induced Subgraph with Property(Φ). , 1}, such that the function mapping k → φ k is computable. Suppose that there exists a computable function g such that, for every t ∈ N, there exists k ≤ g(t) such that some minimal unlabelled subgraph satisfying φ k has treewidth greater than t. Then p-#Induced Subgraph With Property(Φ) and p-#Multicolour Induced Subgraph with Property(Φ) are #W[1]complete.
Proof. We prove the result by means of an fpt-Turing reduction from the #W[1]-complete problem p-#Clique. Note that, by Lemma 2.4, it suffices to give a reduction from p-#Clique to p-#Multicolour Induced Subgraph with Property(Φ).
Let the graph G be the input to an instance of p-#Clique with parameter k. By Proposition 4.2, we know that there is k (bounded by some computable function of k) such that some minimal unlabelled subgraph satisfying φ k , which we shall call H, contains the (k × k 2 ) grid as a minor and, moreover, that there is no H satisfying φ k such that H is a proper subgraph of H. Let H be the set of all k -vertex labelled graphs satisfying φ k .
Recall that the graph G H and colouring f can be constructed in time h(k) · n O(1) , where h is some computable function. Given the graph G H , the colouring f and an oracle to p-#Multicolour Induced Subgraph with Property(Φ), it is now straightforward to compute the number of k-cliques in G, since  2 )), which is a computable function of k only. This therefore gives an fpt-Turing reduction from p-#Clique to p-#Multicolour Induced Subgraph with Property(Φ), as required.

A dichotomy for colourful decision when Φ is monotone
In this section we turn to the complexity of the decision versions of problems in our model, and give a dichotomy for the complexity of such problems in the multicolour case when the property in question is monotone. For the definition of fpt-reductions for parameterised decision problems, we again refer the reader to [11]. Proof. The first part of the result is precisely Corollary 2.14. Thus it remains to show that if this condition is not satisfied, we must instead have that p-Multicolour Induced Subgraph with Property(Φ) is W[1]complete. We prove W[1]-completeness by means of an fpt-reduction from p-Clique. Let G be the input in an instance of p-Clique with parameter k. By assumption, there is no integer t such that, for each k ∈ N, all minimal unlabelled graphs satisfying φ k have treewidth at most t. It then follows from Proposition 4.2 that there exists k ∈ N (where k is at most some computable function of k) such that some minimal unlabelled subgraph (H, π) satisfying φ k contains the (k × k 2 ) grid as a minor. Now, we can construct the graph G H and colouring f in time h(k) · n O(1) , where h is some computable function. Moreover, we know from Lemma 3.2 that #ColSubInd(H, G H , f ) = #Clique k (G), so in particular the number of colourful subgraphs of G H (with respect to the colouring f ) that are isomorphic to H is non-zero if and only if the number of k-cliques in G is non-zero. Since the parameter, k , in the instance of p-Multicolour Induced Subgraph with Property(Φ) is bounded by a computable function of k, this gives a fpt-reduction from p-Clique to p-Multicolour Induced Subgraph with Property(Φ) in this second case, as required. This completes the proof of the theorem.

Approximability of monotone properties
In this section we consider the conditions under which there exists an FP-TRAS for p-#Induced Subgraph With Property(Φ), under the assumption that Φ is a nice, monotone property. We begin by building on the results of Section 4.3 to show that the existence of an efficient algorithm to solve p-Multicolour Induced Subgraph with Property(Φ) in this case implies the existence of an FPTRAS for p-#Multicolour Induced Subgraph with Property(Φ). Combined with Corollary 2.3, this gives a dichotomy for the approximability of multicolour subgraph counting problems defined by a monotone property, subject to the assumption that W [1] randomised FPT.
Proof. By Theorem 4.4, we know that p-Multicolour Induced Subgraph with Property(Φ) is in FPT if and only if there exists an integer t such that, for each k ∈ N, all minimal unlabelled graphs satisfying φ k have treewidth at most t; by our assumption that Φ is nice, the same is true for the minimal labelled subgraphs satisfying φ k . Thus it remains only to show that there exists an FPTRAS for p-#Multicolour Induced Subgraph with Property(Φ) if Φ satisfies this condition; this is exactly the statement of Theorem 2.15.
We now apply the previous result to give a sufficient condition for the existence of an FPTRAS for p-#Induced Subgraph With Property(Φ) when Φ is a monotone property. Corollary 4.6. Let Φ be a family (φ 1 , φ 2 , . . .) of functions φ k : {0, 1} ( k 2 ) → {0, 1}, such that the function mapping k → φ k is computable, and suppose further that Φ is a nice, monotone property. Then, if p-Multicolour Induced Subgraph with Property(Φ) is in FPT, there is an FPTRAS for p-#Induced Subgraph With Property(Φ).
Proof. We know from Theorem 4.5 that, if p-Multicolour Induced Subgraph with Property(Φ) is in FPT, there is an FPTRAS for p-#Multicolour Induced Subgraph with Property(Φ). Thus, by Proposition 2.6, we must in this case also have an FPTRAS for p-#Induced Subgraph With Property(Φ).

Conclusions and Open Problems
We have proved a range of results concerning the complexity of subgraph counting problems in which the treewidth of minimal subgraphs having the desired property cannot be bounded by any constant. We demonstrated that, for properties Φ of this kind, both p-#Induced Subgraph With Property(Φ) and p-#Multicolour Induced Subgraph with Property(Φ) are #W[1]-complete, and that the multicolour decision problem p-Multicolour Induced Subgraph with Property(Φ) is W[1]-complete.
These results contrast with positive results for decision and approximation of monotone properties for which all minimal subgraphs satisfying the property have bounded treewidth; combining our results with these positive results gives a dichotomy for the decision version of the problem and, with an additional restriction on the relationship between the minimal labelled and unlabelled subgraphs having the property, we obtain another dichotomy for multicolour approximate counting.
There remain two natural open questions to ask concerning the existence of an FPTRAS for such problems. First of all, our dichotomy for the existence of an FPTRAS for multicoloured subgraph counting problems is only valid for monotone properties for which also satisfy our definition of a "nice" property: is the fact that the decision version is in FPT enough to guarantee the existence of an FPTRAS more generally in the multicolour case? Secondly, we gave a sufficient condition for the existence of an FPTRAS for monotone subgraph counting problems in the uncoloured version: is it possible to prove a dichotomy in this case as well?
Our #W[1]-completeness results contribute to the categories of parameterised counting problems that are known to be computationally difficult. It was asked in [14] whether there are any non-trivial subgraph counting problems in the uncoloured version of this model which admit FPT algorithms, and the results here add another powerful restriction which must be satisfied by any such problem, but the original question remains open.