A Fixed-Parameter Perspective on #BIS

The problem of (approximately) counting the independent sets of a bipartite graph (#BIS) is the canonical approximate counting problem that is complete in the intermediate complexity class #RH\Pi_1. It is believed that #BIS does not have an efficient approximation algorithm but also that it is not NP-hard. We study the robustness of the intermediate complexity of #BIS by considering variants of the problem parameterised by the size of the independent set. We exhaustively map the complexity landscape for three problems, with respect to exact computation and approximation and with respect to conventional and parameterised complexity. The three problems are counting independent sets of a given size, counting independent sets with a given number of vertices in one vertex class and counting maximum independent sets amongst those with a given number of vertices in one vertex class. Among other things, we show that all of these problems are NP-hard to approximate within any polynomial ratio. (This is surprising because the corresponding problems without the size parameter are complete in #RH\Pi_1, and hence are not believed to be NP-hard.) We also show that the first problem is #W[1]-hard to solve exactly but admits an FPTRAS, whereas the other two are W[1]-hard to approximate even within any polynomial ratio. Finally, we show that, when restricted to graphs of bounded degree, all three problems have efficient exact fixed-parameter algorithms.


Introduction
The problem of (approximately) counting the independent sets of a bipartite graph, called #BIS, is one of the most important problems in the field of approximate counting. This problem is known to be complete in the intermediate complexity class #RHΠ 1 [8]. Many approximate counting problems are equivalent in difficulty to #BIS, including those that arise in spin-system problems [12,14] and in other domains. These problems are not believed to have efficient approximation algorithms, but they are also not believed to be NP-hard.
In this paper we study the robustness of the intermediate complexity of #BIS by considering relevant fixed parameters. It is already known that the complexity of #BIS is unchanged when the degree of the input graph is restricted (even if it is restricted to be at most 6) [2] but there is an efficient approximation algorithm when a stronger degree restriction (degree at most 5) is applied, even to the vertices in just one of the parts of the vertex partition of the bipartite graph [17].
We consider variants of the problem parameterised by the size of the independent set. We first show that all of the following problems are #P-hard to solve exactly and NP-hard to approximate within any polynomial factor.
• #Size-BIS: Given a bipartite graph G and a non-negative integer k, count the size-k independent sets of G.
• #Size-Left-BIS: Given a bipartite graph G with vertex partition (U, V ) and a non-negative integer k, count the independent sets of G that have k vertices in U , and • #Size-Left-Max-BIS: Given a bipartite graph G with vertex partition (U, V ) and a nonnegative integer k, count the maximum independent sets amongst all independent sets of G with k vertices in U .
The NP-hardness of these approximate counting problems is surprising given that the corresponding problems without the parameter k (that is, the problem #BIS and also the problem #Max-BIS, which is the problem of counting the maximum independent sets of a bipartite graph) are both complete in #RHΠ 1 , and hence are not believed to be NP-hard. Therefore, it is the introduction of the parameter k that causes the hardness.
To gain a more refined perspective on these problems, we also study them from the perspective of parameterised complexity, taking the number of vertices, n, as the size of the input and k as the fixed parameter. Our results are summarised in Table 1, and stated in detail later in the paper. Rows 1 and 3 of the table correspond to the conventional (exact and approximate) setting that we have already discussed. Rows 2 and 4 correspond to the parameterised complexity setting, which we discuss next. As is apparent from the table, we have mapped the complexity landscape for the three problems in all four settings.  Table 1: A summary of our results. Each column corresponds to one of the three problems that we consider (#Size-BIS, #Size-Left-BIS and #Size-Left-Max-BIS), and each row corresponds to one of the four settings we consider (exact polynomial-time, exact FPT-time, approximate polynomial-time, and approximate FPT-time).
In parameterised complexity, the central goal is to determine whether computational problems have fixed-parameter tractable (FPT) algorithms, that is, algorithms that run in time f (k) · n O (1) for some computable function f . Hardness results are presented using the Whierarchy [10], and in particular using the complexity classes W [1] and W [2], which constitute the first two levels of the hierarchy. It is known (see [10]) that FPT ⊆ W[1] ⊆ W [2] and these classes are widely believed to be distinct from each other. It is also known [6,Chapter 14] that the Exponential Time Hypothesis (see [15]) implies FPT = W [1]. Analogous classes #W [1] and #W [2] exist for counting problems [9].
As can be seen from the table, we prove that all of our problems are at least W[1]-hard to solve exactly, which indicates (subject to the complexity assumptions in the previous paragraph) that they cannot be solved by FPT algorithms. Moreover, #Size-Left-BIS and #Size-Left-Max-BIS are W[1]-hard to solve even approximately. It is known [19] that each parameterised counting problem in the class #W[i] has a randomised FPT approximation algorithm using a W[i] oracle, so W[i]-hardness is the appropriate hardness notion for parameterised approximate counting problems. By contrast, we show that #Size-BIS can be solved approximately in FPT time. In fact, it has an FPT randomized approximation scheme (FPTRAS).
Motivated by the fact that #BIS is known to be #P-complete to solve exactly even on graphs of degree 3 [24], we also consider the case where the input graph has bounded degree. While the conventional problems remain intractable in this setting (row one of the table), we prove that all three of our problems admit linear-time fixed-parameter algorithms for boundeddegree instances (row two). Note that Theorem 14(i) is also implicit in independent work by Patel and Regts [20].

Preliminaries
For a positive integer n, we let [n] denote the set {1, . . . , n}. We consider graphs G to be undirected. For a vertex set X ⊆ V (G), denote by G[X] the subgraph induced by X. For a vertex v ∈ V (G), we write Γ(v) for its open neighbourhood (that is, excluding v itself).
Given a graph G, we denote the size of a maximum independent set of G by µ(G). We denote the number of all independent sets of G by IS(G), the number of size-k independent sets of G by IS k (G), and the number of size-µ(G) independent sets of G by MIS(G). A bipartite graph G is presented as a triple (U, V, E) in which (U, V ) is a partition of the vertices of G into vertex classes, and E is a subset of U × V . If G = (U, V, E) is a bipartite graph then an independent set S of G is said to be an "ℓ-left independent set of G" if |S ∩ U | = ℓ. The size of a maximum ℓ-left independent set of G is denoted by µ ℓ-left (G). An ℓ-left independent set of G is said to be "ℓ-left-maximum" if and only if it has size µ ℓ-left (G). Finally, IS ℓ-left (G) denotes the number of ℓ-left independent sets of G and IS ℓ-left-max (G) denotes the number of ℓ-left-maximum independent sets of G. Using these definitions, we now give formal definitions of #BIS and of the three problems that we study.
For each of our computational problems, we add "[∆]" to the end of the name of the problem to indicate that the input graph G has degree at most ∆. For example, #BIS[∆] is the problem defined as follows.
When stating quantitative bounds on running times of algorithms, we assume the standard word-RAM machine model with logarithmic-sized words.

Exact computation: Hardness results
In this section, we prove the hardness results presented in the first two rows of Table 1.

Polynomial-time computation
We prove that all three problems are #P-hard, even when the input graphs are restricted to have degree at most 3.
Proof. The problems #Size-BIS [3] and #Size-Left-BIS [3] are in #P, which can be deduced from their definitions. We show that the problems are #P-hard. Xia, Zhang and Zhao [24,Theorem 9] show that #BIS [3] is #P-hard, even under the additional restriction that the input graph is planar and 3-regular.
There is a straightforward reduction from #BIS [3] to #Size-BIS [3]. Suppose that G is an n-vertex input to #BIS [3]. Then IS(G) = n k=0 IS k (G). Using an oracle for #Size-BIS [3] (with the graph G and each k ∈ {0, . . . , n}) one can therefore compute IS(G), as desired.
Proof. Vadhan has shown [23, Corollary 4.2(1)] that #Max-BIS [3] is #P-complete. We now reduce #Max-BIS [3] to #Size-Left-Max-BIS [3]. Let G = (U, V, E) be an instance of #Max-BIS [3] and let s = |U |. For each j ∈ {0, . . . , s}, let x j be the number of size-µ(G) (s − j)-left independent sets of G. We wish to compute MIS(G) = s j=0 x j , so it suffices to show how to compute the vector (x 0 , . . . , x s ) in polynomial time using an oracle for #Size-Left-Max-BIS [3] -this is what we do in the remainder of the proof.
For every non-negative integer i, let G i = (U i , V i , E i ) be the graph formed from G by adding a disjoint matching of size s + i. Note that µ(G i ) = µ(G) + s + i. Also, G i has an s-left independent set of size µ(G i ) (to see this, consider any size-µ(G) independent set of G, say one that is a-left for some a ∈ {0, . . . , s}, and augment this with s − a matching vertices from U i and i + a matching vertices from V i ). Let w i be the number of size-(µ(G i )) s-left independent sets of G i and note that IS s-left-max (G i ) = w i . Since G i has degree at most 3, w i can be computed using an oracle for #Size-Left-Max-BIS [3] (using the input graph G i and setting the input ℓ equal to s).
From the definitions of x j and w i , we have Now let M be the matrix whose rows and columns are indexed by {0, . . . , s} and whose entry M i,j is s+i j . Let w be the transpose of the row vector (w 0 , . . . , w s ) and x be the transpose of the row vector (x 0 , . . . , x s ). Then Equation (1) can be re-written as w = M x.
Now [13,Corollary 2] shows that M is invertible (taking k = s + 1, a i = s + i − 1 and b j = j − 1 for 1 ≤ i, j ≤ k, in the language of the corollary), so the vector x can be computed as x = M −1 w. Since it suffices to compute x, and the vector w can be computed using the oracle, this completes the reduction.

Fixed-parameter intractability
We first define the parameterised complexity classes relevant in this paper, namely, the class W [1] of decision problems, and the counting classes #W [1] and #W [2]. For simplicity, we do so in terms of complete problems and reductions. The following definitions are taken from Flum and Grohe [10].

Definition 3. Let F and G be parameterised problems. For any instance x of F , write k(x)
for the parameter of F and |x| for the size of x. For any instance y of G, write ℓ(y) for the parameter of y. An FPT Turing reduction from F to G is an algorithm with an oracle for G that, for some computable functions f, g : N → N and for some constant c ∈ N, solves any instance x of F in time at most f (k(x)) · |x| c in such a way that for all oracle queries the instances y of G satisfy ℓ(y) ≤ g(k(x)). Now, write F for the set of all instances of F , and for all x ∈ F write F (x) for the desired output given input x. Likewise, write G for the set of all instances of G, and for all y ∈ G write G(y) for the desired output given input y. Suppose R : F → G is a function satisfying the following properties: for all x ∈ F, F (x) = G(R(x)); there exists a computable function f : N → N and a constant c ∈ N such that for all x ∈ F, R(x) is computable in time at most f (k(x)) · |x| c ; there exists a computable function g : N → N such that for all x ∈ F, ℓ(R(x)) ≤ g(k(x)). If F and G are decision problems, we call R an FPT many-one reduction from F to G; if F and G are counting problems, we call R an FPT parsimonious reduction from F to G.
We define W [1] in terms of the following problem.
Name: Size-Clique. Input: A graph G and a positive integer k. Output: True if G contains a k-clique, false otherwise. Parameter: k.
W [1] is the set of all parameterised decision problems with an FPT many-one reduction to Size-Clique. We say a problem F is W[1]-hard if there is an FPT Turing reduction from Size-Clique to F . For a proof that this is equivalent to the standard definition of W [1], see e.g., Downey and Fellows [7,Theorem 21.3.4].
We define #W [1] in terms of the following problem.
Name: #Size-Clique. Input: A graph G and a positive integer k. Output: The number of k-cliques in G. Parameter: k.
#W [1] is the set of all parameterised counting problems with an FPT parsimonious reduction to #Size-Clique. We say a problem F is #W[1]-hard if there is an FPT Turing reduction from #Size-Clique to F . For a proof that this is equivalent to the standard definition of #W [1], see e.g., [10,Theorem 14.18].
Recall that a set D ⊆ V (G) is called a dominating set of a graph G if every vertex v ∈ V (G) is either contained in D or adjacent to a vertex of D. We define #W [2] in terms of the following problem.
Name: #Size-Dominating-Set. Input: A graph G = (U, E) and a positive integer k. Output: The number of dominating sets of G of size k. Parameter: k.
#W [2] is the set of all parameterised counting problems with an FPT parsimonious reduction to #Size-Dominating-Set. We say a problem F is #W [2]-hard if there is an FPT Turing reduction from #Size-Dominating-Set to F . For a proof that this is equivalent to the standard definition of #W [2], see [9,Theorem 19]).
In order to prove our exact fixed-parameter hardness results, we consider the following problem.
Name: #Size-Partitioned-Biclique. Input: An integer t, a 2t-coloured graph G, and a 2t-coloured balanced biclique H on 2t vertices (i.e. a 2t-coloured copy of K t,t ) in which every colour appears exactly once. Output: The number Sub G (H) of subgraphs K ⊆ G with K ≃ H. Parameter: t.
Proof. We will prove first easiness, then hardness.

#Size-BIS is in #W[1]:
We give an FPT parsimonious reduction to #Size-Clique. Indeed, Then the size-k independent sets of G correspond exactly to the size-k cliques of G ′ , as required.

#Size-BIS is #W[1]-hard:
We give an FPT Turing reduction from #Size-Partitioned-Biclique. Note that the class {K t,t : t ≥ 1} of all balanced bicliques is recursively enumerable and contains graphs of arbitrarily high treewidths, so #Size-Partitioned-Biclique is #W Define a coloured graph G ′ = ((V, E ′ ), c). Then each copy of H in G spans an independent set in G ′ in which every colour appears exactly once and vice versa, so Sub G (H) is precisely the number of such independent sets in G ′ .
For any set S ⊆ [2t], let I S be the set of size-2t independent sets in G ′ which contain no vertices with colours in S. By the inclusion-exclusion principle, Moreover, for any set S ⊆ [2t], let G S be the bipartite graph (U S , V S , E S ) defined by Then I S is precisely the set of size-2t independent sets in G S . Our algorithm therefore determines each |I S | by calling a #Size-BIS oracle with input (G S , 2t), then uses (2) to compute Sub G (H).
Next, we turn to the exact parameterised complexity of #Size-Left-BIS. The hardness result we obtain for this problem is a bit stronger than for #Size-BIS: we prove that it is #W[2]-hard.
Proof. We reduce from the dominating set problem. Let G = (U, E) and k be given as input for #Size-Dominating-Set where U = {u 1 , . . . , u n }. The reduction computes the bipartite split graph of G; For non-negative integers ℓ and r, we define an (ℓ, r)-set of G ′ to be a size-ℓ subset X of U that has exactly r neighbours in V . Let Z ℓ,r be the number of (ℓ, r)-sets of G ′ . Note that a size-k subset X of U is a dominating set of G if and only if it is a (k, n)-set of G ′ , so there are precisely Z k,n size-k dominating sets of G.
The algorithm applies polynomial interpolation to determine Z k,r for all r ∈ {0, . . . , n}. We use a special case of the cloning construction from the proof of Theorem 4. For every positive Let M be the (n + 1) × (n + 1) matrix whose rows are indexed by [n + 1] and columns are indexed by {0, . . . , n} such that M i,r = 2 i(n−r) holds. Then (3) can be viewed as a linear equation The oracle for #Size-Left-BIS can be used to compute w, and M is invertible since it is a (transposed) Vandermonde matrix. Thus the reduction can compute z, and in particular Z k,n , as required.
We defer the proof of the W[1]-hardness of #Size-Left-Max-BIS to the next section, as it is implied by the corresponding approximation hardness result.

Approximate computation: Hardness results
In this section, we prove the hardness results in rows 3 and 4 of Table 1. Note that the reductions from Section 3 cannot be used here, since #BIS is not known to be NP-hard to approximate. In order to state our hardness results formally, we introduce approximation versions of the problems that we consider. Name: Deg-c-#ApxSizeLeftMaxBIS. Input: A bipartite graph G on n vertices and a non-negative integer ℓ.
Name: Deg-c-#ApxSizeLeftBIS. Input: A bipartite graph G on n vertices and a non-negative integer ℓ.
Name: Deg-c-#ApxSizeBIS. Input: A bipartite graph G on n vertices and a non-negative integer k.
We first prove the results in the last column of Table 1 and establish the others by reduction. Proof. Let c be any non-negative integer. We will give a reduction from Size-Clique to Deg-c-#ApxSizeLeftMaxBIS which is both an FPT Turing reduction and a polynomial-time Turing reduction. The theorem then follows from the fact that Size-Clique is both NP-hard [ Let (G, k) be an instance of Size-Clique with G = (V, E) and n = |V |. We use a standard powering construction to produce an intermediate instance (G ′ , k) of Size-Clique with G ′ = (V ′ , E ′ ). More precisely, let t = n 2c , let C be a set of k new vertices, and let From (G ′ , k), we construct an instance (G ′′ , ℓ) of Deg-c-#ApxSizeLeftMaxBIS with G ′′ = (U, V ′ , E ′′ ) and ℓ = k 2 . For this, let U = {u e | e ∈ E ′ } be a set of vertices and let E ′′ = {(u e , v) | e ∈ E ′ , v ∈ e}. The reduction queries the oracle for (G ′′ , ℓ), which yields an approximate value z for the number IS ℓ-left-max (G ′′ ). If z ≤ n c , the reduction returns 'no', there is no k-clique in G, and otherwise it returns 'yes'. It is obvious that the reduction runs in polynomial time.
It remains to prove the correctness of the reduction. Let CL k (G) be the number of k-cliques in G. The ℓ-left-maximum independent sets X of G ′′ correspond bijectively to the size-ℓ edge sets {e | u e ∈ X ∩ U } of G ′ which span a minimum number of vertices. Note that any set of ℓ = k 2 edges must span at least k vertices, with equality only in the case of a k-clique. Since G ′ contains at least one k-clique (induced by C), we have IS ℓ-left-max (G ′′ ) = CL k (G ′ ). Moreover, each k-clique X in G corresponds to a size-t k family of k-cliques in G ′ . Each k-clique in the family consists of exactly one vertex from each set {x} × [t] such that x ∈ V (X). This accounts for all k-cliques in Let z be the result of applying our oracle to (G ′′ , ℓ). If G contains no k-cliques, then by (4) we have z ≤ n c · IS ℓ-left-max (G ′′ ) = n c and the reduction returns 'no'. Otherwise, we have z ≥ n −c · IS ℓ-left-max (G ′′ ) ≥ n −c (t k + 1) > n c and the reduction returns 'yes'. Thus the reduction is correct and the theorem follows. Proof. Let c be any non-negative integer. We will give a reduction from the problem Deg-(c+1)-#ApxSizeLeftMaxBIS to the problem Deg-c-#ApxSizeLeftBIS which is both an FPT Turing reduction and a polynomial-time Turing reduction. The result then follows by Theorem 6.
Let (G, ℓ) be an instance of Deg-c-#ApxSizeLeftMaxBIS. Write G = (U, V, E), let n = |V (G)|, and let t = 6n. Without loss of generality, suppose n ≥ 5 and that n is sufficiently large that n c 2 −n ≤ 1.
, and let z be the result of applying our oracle to (G ′ , ℓ).
For any non-negative integers i and j, we define IS i, j (G) to be the number of independent sets X ⊆ V (G) with |X ∩ U | = i and |X ∩ V | = j. Each ℓ-left independent set X of G corresponds to the family of ℓ-left independent sets of G ′ consisting of X ∩ U together with at least one vertex from each set {x} × [t] such that x ∈ X ∩ V . Thus by the definition of µ, Since G contains at most 2 n independent sets and IS ℓ, µ−ℓ (G) ≥ 1, we have /5 , and hence the algorithm can obtain µ by rounding ℓ + lg(z)/ lg(2 t − 1) to the nearest integer. Moreover, by (5) we have The algorithm therefore outputs z/(2 t − 1) µ−ℓ .

Theorem 9. For all c ≥ 0, Deg-c-#ApxSizeBIS is NP-hard.
Proof. For all c ≥ 0, we give a polynomial-time Turing reduction from the problem Deg-(c + 1)-#ApxSizeLeftBIS to the problem Deg-c-#ApxSizeBIS. The result then follows from Theorem 7.
Fix c ≥ 0 and let (G, ℓ) be an instance of Deg-(c + 1)-#ApxSizeLeftBIS. Suppose that G = (U, V, E) where U = {u 1 , . . . , u p }. Note from the problem definition that n = |U ∪ V | and suppose without loss of generality that ℓ ∈ [p] and that n ≥ 40 (otherwise, (G, ℓ) is an easy instance of Deg-(c + 1)-#ApxSizeLeftBIS, so the answer can be computed, even without using the oracle).
Let s = 2n 6 and t = ⌊s Figure 1: An example of the reduction from Deg-(c + 1)-#ApxSizeLeftBIS to Deg-c-#ApxSizeLeftBIS used in the proof of Theorem 9 when G = P 3 . Each vertex u i ∈ U is replaced by three vertex sets U ′ i , V i and U i in the resulting graph G ′ . Note that G ′ does not depend on the input parameter ℓ.
Intuitively, the proof will proceed as follows. We will map independent sets X ′ of G ′ to independent sets X of G by taking X ∩ V = X ′ ∩ V and adding each u i ∈ U to X if and only if U i ∩ X ′ = ∅. We will show that roughly half the independent sets of each gadget U ′ i ∪ V i ∪ U i have this form. We will also show that within each gadget, almost all independent sets with vertices in U i have size roughly (s + t)/2, and almost all others have size roughly 2s/3. Thus the independent sets in G with ℓ vertices in U roughly correspond to the independent sets in G ′ of size roughly ℓ · (s + t)/2 + (p − ℓ) · 2s/3, which we count using a #Size-BIS oracle.
We start by defining disjoint sets of independent sets of G ′ . For x ∈ {0, . . . , p}, let E(x) = 2s 3 (p − x) + s+t 2 x and let Note that since n ≥ 3, we have t > 17s/30 and 120n ≤ s. Thus, if x ′ > x, We conclude that the sets A 0 , . . . , A p are disjoint. Next, we connect the independent sets of G ′ with those of G. Each independent set X ′ of G ′ projects onto the independent set (X Given an independent set X of G, let ϕ(X) be the set of independent sets X ′ of G ′ which project onto X. If u i ∈ X, then there are 2 t − 1 possibilities for X ′ ∩ U i and 2 s possibilities for It follows that, for any x-left independent set X of G, |ϕ(X)| = F (x), which establishes the first of the following claims. The proofs of Claims 2 and 3 are mere calculation, so before proving them we use the claims to complete the proof of the lemma. Recall that (G, ℓ) is an instance of Deg-(c + 1)-#ApxSizeLeftBIS with ℓ ∈ [p] and n ≥ 2. Together, the claims imply where the final F (ℓ) comes from the contribution to |A ℓ | corresponding to the (at most 2 n ) independent sets of G that are not ℓ-left independent sets. Since ℓ ∈ [p], the quantity IS ℓ-left (G) is at least 1, which means that the right-hand side of (6) is at most 2F (ℓ)IS ℓ-left (G). Also, F (ℓ) > 0. Thus, (6) implies The oracle for Deg-c-#ApxSizeBIS can be used to compute a number z such that n −c |A ℓ | ≤ z ≤ n c |A ℓ |. (To do this, just call the oracle repeatedly with input G ′ and with every non-negative integer k such that |k − E(ℓ)| ≤ s 20 + n, adding the results.) Thus, so the desired approximation of IS ℓ-left (G) can be achieved by dividing z by F (ℓ). We now complete the proof by proving Claims 2 and 3.

Proof of Claim 2:
Consider any x ∈ {0, . . . , p} and let X be an x-left independent set of G. We will show |ϕ(X) ∩ A x | ≥ F (x)/2, which implies the claim by taking ℓ = x. In fact, we will establish the much stronger inequality which will also be useful in the proof of Claim 3. To establish Equation (7) we will show that the probability that a random element Y of ϕ(X) satisfies |Y | − E(x) ≤ s 20 + n is at least So let Y be a uniformly random element of ϕ(X). We will show that, with probability at least 1 − 3ne −n 2 , the following bullet points hold.
≤ s+t n 2 , Since n ≥ 40, we have (p − x)s/n 2 + x(s + t)/n 2 ≤ 2ps/n 2 ≤ s/20 and |Y ∩ V | ≤ n, so the claim follows. To obtain the desired failure probability, we will show that, for any i ∈ [p], the probability that the relevant bullet point fails to hold is at most 3e −n 2 (so the total failure probability is at most 3ne −n 2 , by a union bound).
First, consider any i ∈ [p] with u i / ∈ X. In this case, is generated by including (independently for each j ∈ [s]) one of three possibilities: (i) u i,j but not v i,j , (ii) v i,j but not u i,j , or (iii) neither u i,j nor v i,j . Each of the three choices is equally likely. Thus |Y ∩ (U i ∪ V i ∪ U ′ i )| is distributed binomially with mean 2s/3, so by a Chernoff bound (Lemma 8), the probability that the first bullet point fails for i is at most 2e −s/2n 4 < 3e −n 2 , as desired.
Second, consider any i ∈ [p] with u i ∈ X. In this case, Y ∩ (U i ∪ V i ∪ U ′ i ) is chosen uniformly from all subsets of U i ∪ U ′ i that contain at least one element of U i . The total variation distance between the uniform distribution on these subsets and the uniform distribution on all subsets of U i ∪ U ′ i is at most 2 −t . Also, by a Chernoff bound (Lemma 8), the probability that a uniformlyrandom subset of U i ∪ U ′ i has a size that differs from its mean, (s + t)/2, by at least (s + t)/n 2 is at most 2e −2(s+t)/(3n 4 ) . Thus, the probability that the second bullet point fails for i ist at most 2 −t + 2e −2(s+t)/(3n 4 ) ≤ 3e −n 2 , as desired.
The claim follows from F (x) ≤ 3 ps ≤ 3 2n F (ℓ) and from the fact that n ≥ 40.

Algorithms
In this final section, we give our algorithmic results: An FPT randomized approximation scheme (FPTRAS) for #Size-BIS, and an exact FPT-algorithm for all three problems in bounded-degree graphs. We define an FPTRAS of #Size-BIS as in Arvind and Raman [1].

Definition 10.
An FPTRAS for #Size-BIS is a randomised algorithm that takes as input a bipartite graph G, a non-negative integer k, and a real number ε ∈ (0, 1) and outputs a real number z. With probability at least 2/3, the output z must satisfy (1 − ε)IS k (G) ≤ z ≤ (1 + ε)IS k (G). Furthermore, there is a function f : R → R and a polynomial p such that the running time of the algorithm is at most f (k) p(|V (G)|, 1/ε).

Theorem 11.
There is an FPTRAS for #Size-BIS with time complexity O 2 k · k 2 /ε 2 for input graphs with n vertices and m edges.
Proof. Let (G, k) be an instance of #Size-BIS with G = (U, V, E) and n = |V (G)|. Let ε > 0 be the other input of the FPTRAS. Let t = 10⌈2 k /ε 2 ⌉. The FPTRAS independently samples t uniformly-random size-k subsets of U ∪ V . Let X be the number of independent sets among the samples. The output z of the FPTRAS is z = X · n k /t. Note that E(X) = t · IS k (G)/ n k . We now show that with probability at least 2/3, Since each sample lies entirely within U or entirely within V with probability at least 2 −k , we have E(X) ≥ t2 −k ≥ 10/ε 2 . By Lemma 8, we have Thus, with probability at least 2/3, we have |X − E(X)| ≤ εE(X), and so |z − IS k (G)| ≤ εIS k (G) holds as required.
Recall that we use the word-RAM model, in which operations on O(log n)-sized words take O(1) time. Thus for each of the t samples, the algorithm generates the sample in O(k) time and makes k 2 queries to the graph to check that the selected set is an independent set. The running time is therefore as claimed.
We now turn to our algorithms for bounded-degree graphs. We require the following definitions. For any positive integer s, an s-coloured graph is a tuple (G, c) where G is a graph and c : V (G) → [s] is a map. Suppose G = (G, c) and G ′ = (G ′ , c ′ ) are coloured graphs with G = (V, E) and G ′ = (V ′ , E ′ ).
We say a map φ : V → V ′ is a homomorphism from G to G ′ if φ is a homomorphism from G to G ′ and, for all v ∈ V , c(v) = c ′ (φ(v)). If φ is also bijective, we say φ is an isomorphism from G to G ′ , that G and G ′ are isomorphic, and write G ≃ G ′ . For all X ⊆ V , we define , c| X ), and say G[X] is an induced subgraph of G. Given coloured graphs H and G, we denote the number of sets X ⊆ V (G) with G[X] ≃ H by #Ind(H → G). Finally, we define V (G) = V and E(G) = E and we define ∆(G) to be the maximum degree of G.
For each positive integer ∆, we consider a counting version of the induced subgraph isomorphism problem for coloured graphs of degree at most ∆.
We will later reduce our bipartite independent set counting problems to the coloured induced subgraph problem. Note that #Induced-Coloured-Subgraph[∆] can be expressed as a firstorder model-counting problem in bounded-degree structures. A well-known result of Frick [11,Theorem 6] would yield an algorithm for #Induced-Coloured-Subgraph[∆] with running time g(k) · n, where k = |V (H)| and n = |V (G)|. (To our knowledge this fact has not appeared in the literature, but the proof is not hard.) However, the function g of Frick's algorithm may grow faster than any constant-height tower of exponentials. In the following, we provide an algorithm for #Induced-Coloured-Subgraph[∆] that is substantially faster: It runs in time O(nk (2∆+3)k ).
The algorithm follows the strategy of [4] to count small subgraphs: Instead of counting (coloured) induced subgraphs, we can count (coloured) homomorphisms and recover the number of induced subgraphs via a simple basis transformation. Transforming to homomorphisms is useful because homomorphisms from small patterns to bounded-degree host graphs can be counted by a simple branching procedure-this is however not true for small induced subgraphs. The following lemma encapsulates counting homomorphisms in graphs of bounded degree. Given coloured graphs H and G, we denote the number of homomorphisms from H to G by #Hom(H → G).

Lemma 12.
There is an algorithm to compute #Hom(H → G) in time O(nk k (∆+1) k ), where G is a coloured graph with n vertices, H is a coloured graph with k vertices, and both graphs have maximum degree at most ∆.
Proof. The algorithm works as follows: If H is not connected, let H 1 , . . . , H ℓ be its connected components. Then it is straightforward to verify that Thus it remains to describe the algorithm for connected pattern graphs H. Let u 1 , . . . , u k be an arbitrary traversal of H with {u 1 , . . . , u k } = V (H); the latter property can be satisfied since H is a connected graph with k vertices. Note that if f : V (H) → V (G) is a homomorphism from H to G, then f (u 1 ), . . . , f (u k ) is a traversal in G, and this correspondence is injective. Thus the algorithm computes the number of traversals v 1 , . . . , v k in G for which the mapping f with f (u i ) = v i for all i is a homomorphism from H to G. This number is equal to #Hom(H → G), which the algorithm seeks to compute.
Since the maximum degree of G is ∆, any set S ⊆ V (G) satisfies |Γ(S)| ≤ ∆|S|. Thus there are at most n · (∆k + k) k−1 traversal sequences in G, which can be generated in linear time in the number of such sequences. For each traversal sequence, verifying whether the sequence corresponds to a homomorphism takes time O(k∆) (in the word-RAM model with incidence lists for H already prepared). Overall, we obtain a running time of O(n · k k · (∆ + 1) k ).
Using the above algorithm, we now construct an algorithm that performs a kind of basis transformation to obtain the number of induced coloured subgraphs. For coloured graphs K and B, let #Surj(K → B) be the number of vertex-surjective homomorphisms from K to B, i.e., the number of those homomorphisms from K to B that contain all vertices of B in their image.
Let S be the set of all q-coloured graphs K such that ∆(K) ≤ ∆ and, for some t ∈ [k], V (K) = [t]. Let S ′ be a set of representatives of (coloured) isomorphism classes of S.
Let x be the vector indexed by S ′ such that x K = #Ind(K → G) for all K ∈ S ′ . This vector contains the number of induced subgraph copies of H in G, but it also contains the number of subgraph copies of all other graphs in S ′ in G. Let b be the vector indexed by S ′ such that b K = #Hom(K → G) for all K ∈ S ′ ; each entry of this vector can be computed via the algorithm of Lemma 12. Then we will show that x and b can be related to each other via an invertible matrix A such that Ax = b. By calculating A and b, we can then output To elaborate on this linear relationship between induced subgraph and homomorphism numbers, let us first consider some arbitrary graph K ∈ S ′ . By partitioning the homomorphisms from K to G according to their image, we have In the right-hand side sum, we can collect terms with isomorphic induced subgraphs G[X], since we clearly have #Surj(K → B) = #Surj(K → B ′ ) if B ≃ B ′ . Hence, we obtain Let A be the matrix indexed by S ′ with A K,K ′ = #Surj(K → K ′ ) for all K, K ′ ∈ S ′ . Then (8) implies that Ax = b. (An uncoloured version of this linear system is originally due to Lovász [18].) We next prove that A is invertible. Indeed, given K, K ′ ∈ S ′ , write K K ′ if K admits a vertex-surjective homomorphism to K ′ . Since is a partial order, as is readily verified, it admits a topological ordering π. Permuting the rows and columns of A to agree with π does not affect the rank of A, and it yields an upper triangular matrix with non-zero diagonal entries, so it follows that A is invertible.
The algorithm is now immediate. It first determines S by listing all q-coloured graphs on at most k vertices with at most ⌊∆k/2⌋ edges, then checking each one to see whether it satisfies the degree condition. It then determines S ′ from S by testing every pair of coloured graphs in S for isomorphism (by brute force). It then determines each entry A K,K ′ of A (by brute force) by listing the vertex-surjective maps K → K ′ . It then determines b by invoking Lemma 12 to compute each entry b K = #Hom(K → G) for K ∈ S ′ . Finally, it outputs #Ind(H → G) = (A −1 b) H .
Running time. All arithmetic operations are applied to integers bounded by n k , so they each fit into O(k) words, and we bound the complexity of each operation crudely by O(k 2 ). The number of q-coloured graphs on t vertices with at most ⌊∆k/2⌋ edges is at most We note that the above algorithm is not limited to host graphs of bounded degree. That is, the same approach can be taken for any host graph class for which counting homomorphisms from (vertex-coloured) patterns with k vertices has an f (k) · n O(1) time algorithm. To this end, simply use this algorithm as a sub-routine instead of Lemma 12 in the algorithm constructed in the proof of Theorem 13. Examples for such classes of host graphs are planar graphs or, more generally, any graph class of bounded local treewidth [11].  [20] implicitly contains an algorithm for counting independent sets of size k in graphs of maximum degree ∆ in time O(c k n), where c is a constant depending on ∆. This implies Theorem 14(i). Since our own proof is very short, we provide it for the benefit of the reader. Subsequent work [21], published after our original paper [3], includes a version of Theorem 13 with running timeÕ((4∆) 2k n) (which is essentially best-possible under ETH). Note that using this result in the proof of Theorem 14(ii) and (iii) in place of Theorem 13 would not yield algorithms with running times n · ℓ o(ℓ) , as the quantity |S ′ ℓ,r | defined in the proof is ℓ Ω(ℓ) when ∆ = 3 (for suitable values of r).

Recent independent work by Patel and Regts
Proof. Proof of part (i): This is immediate from Theorem 13, since #Size-BIS[∆] is a special case of #Induced-Coloured-Subgraph[∆] (taking G to be monochromatic and H to be a monochromatic independent set of size k). Proof of part (ii): For any bipartite graph G = (U, V, E) with degree at most ∆ and any non-negative integers ℓ and r, let N ℓ,r (G) be the number of sets X ⊆ U with |X| = ℓ and |Γ(X)| = r. Let N ′ ℓ,r (G) be the number of pairs of sets X ⊆ U , Y ⊆ V such that |X| = ℓ, |Y | = r and Y ⊆ Γ(X). Then we have . . , ℓ+r}, degree at most ∆ and no isolated vertices in V J . Let S ℓ,r be the corresponding set of coloured graphs, and let S ′ ℓ,r be a set of representatives of (coloured) isomorphism classes in S ℓ,r . Then N ′ ℓ,r (G) = K∈S ′ ℓ,r #Ind(K → φ(G)), and hence by (9) we have To compute N ℓ,∆ℓ (G), . . . , N ℓ,0 (G), our algorithm applies (10). For each r ∈ {∆ℓ, . . . , 0}, it determines the #Ind(K → φ(G)) terms of (10) using the #Induced-Coloured-Subgraph[∆] algorithm of Theorem 13, and the remaining terms of (10) recursively with dynamic programming. Finally, it computes IS ℓ-left (G) using (11).