Keywords

1 Introduction

Background. Assuming some structure on the input of a computational problem can greatly decrease its difficulty. For instance, it is well known that many NP-hard graph problems can be solved efficiently on graphs of bounded treewidth using dynamic programming over so-called tree decompositions [4]. The analysis of computational problems in terms of the input size and an additional parameter such as treewidth is the main objective in the field of parameterized complexity [10, 11]. A parameter similar to treewidth is treedepth [26, §6.4]. It can be defined as the minimum number of rounds needed to get to the empty graph, where in each round we can delete one vertex from each connected component (formal definitions in the preliminaries). Some NP-hard graph problems become solvable in polynomial time if the input graph is restricted to be in a certain class. For instance the NP-hard Vertex Cover can be solved in polynomial time in chordal graphs; those graphs without induced cycles of length at least four. A parameter that naturally follows from this observation is the minimum cardinality of a set of vertices whose deletion results in a graph contained in graph class \(\mathcal {H}\). Such a set is called an \(\mathcal {H}\)-deletion set. This parameter essentially indicates how far the problem is from being a trivial case (cf. [18]). The size of a feedback vertex set [20, 23] or vertex cover number [13, 14] of the graph are often used examples of such parameters, where \(\mathcal {H}\) is the class of forests and edgeless graphs respectively.

Recently there has been a push [12, 16, 17] in obtaining parameterized algorithm where the parameter is a hybrid of some overall structure of the graph, like treewidth and treedepth, and some distance to triviality. One such example introduced by Bulian and Dawar is \(\mathcal {H}\)-elimination distance (\({{\textbf {ed}}}_{\mathcal {H}}\)) [6, 7], which can be defined as the minimum number of deletion rounds needed to obtain a graph in \(\mathcal {H}\) by removing one vertex from each connected component in each round; recall that in the elimination-based definition of treedepth, the goal is to eliminate the entire graph. Hence \({{\textbf {ed}}}_{\mathcal {H}}\) is never larger than the treedepth or the (vertex-)deletion distance to \(\mathcal {H}\). Bulian and Dawar showed that \({{\textbf {ed}}}_{\mathcal {H}}\) can be computed in FPT time when \(\mathcal {H}\) is minor-closed [7].

A related hybrid variant of treewidth was introduced by Eiben et al. [12], namely \(\mathcal {H}\)-treewidth (\({{\textbf {tw}}}_{\mathcal {H}}\)). The \(\mathcal {H}\)-treewidth of a graph can be defined as the minimum treewidth of the torso graph of a vertex set whose removal ensures each component belongs to \(\mathcal {H}\). This gives rise to tree decompositions in which each bag has size at most \(k+1\), apart for an arbitrarily large set of vertices that occurs in no other bags and induces a subgraph from \(\mathcal {H}\). Similarly as before, \({{\textbf {tw}}}_{\mathcal {H}}(G)\) is not larger than \({{\textbf {tw}}}(G)\) or the deletion distance from G to \(\mathcal {H}\). For minor-closed graph classes \(\mathcal {H}\) it can be shown that graphs of \(\mathcal {H}\)-treewidth at most k are minor-closed and therefore characterized by a finite set of forbidden minors. This leads to non-uniform algorithms to recognize graphs of \(\mathcal {H}\)-treewidth at most k for minor-closed \(\mathcal {H}\) using the Graph Minor algorithm [29].

Apart from minor-closed families \(\mathcal {H}\), some isolated results are known about FPT algorithms to compute \({{\textbf {ed}}}_{\mathcal {H}}\) and \({{\textbf {tw}}}_{\mathcal {H}}\) exactly, parameterized by the parameter value. In recent work, Agrawal and Ramanujan [2] give an FPT algorithm to compute the elimination distance to a cluster graph, as part of a kernelization result using the corresponding structural parameterization. Eiben et al. [12] show that when \(\mathcal {H}\) is the class of graphs of rankwidth at most c for some constant c, then \({{\textbf {tw}}}_{\mathcal {H}}\) is FPT. Bulian and Dawar [6] considered the elimination distance to graphs of bounded degree d and gave an FPT approximation algorithm. Lindermayr et al. [24] showed that the elimination distance of a planar graph to a bounded-degree graph can be computed in FPT time. Very recently, Agrawal et al. [1] obtained non-uniform FPT algorithms for computing the elimination distance to any family \(\mathcal {H}\) defined by a finite number of forbidden induced subgraphs, thereby settling the case of bounded-degree graphs as well.

Results and Techniques. We show that \({{\textbf {tw}}}_{\mathcal {H}}\) and \({{\textbf {ed}}}_{\mathcal {H}}\) are non-uniformly fixed parameter tractable parameterized by the solution value when \(\mathcal {H}\) is the class of bipartite graphs. As a side-product of our proof, we show that \({{\textbf {tw}}}_{\mathcal {H}}\) is non-uniformly FPT when \(\mathcal {H}\) is defined by a finite number of forbidden induced subgraphs, generalizing the results of Agrawal et al. [1] for \({{\textbf {ed}}}_{\mathcal {H}}\). The non-uniformity of our algorithms stems from the use of a meta-theorem by Lokshtanov et al. [25, Theorem 23] which encapsulates the technique of recursive understanding. This theorem essentially states that for any problem expressible in Counting Monadic Second Order (CMSO) logic, the effort of classifying whether the problem is in FPT is reduced to inputs that are (sc)-unbreakable (formally defined later). The theorem allows us to use the technique of recursive understanding in a black box manner, leading to a streamlined proof at the expense of obtaining non-uniform algorithms. We believe that uniform algorithms can be obtained using the same approach by implementing the recursive understanding step from scratch and deriving an explicit bound on the sizes of representatives for the canonical congruence for \({{\textbf {ed}}}_{\mathcal {H}}\) and \({{\textbf {tw}}}_{\mathcal {H}}\) on t-boundaried graphs. As the running times would not be practical in any case, we did not pursue this route.

Our proof is independent of that of Agrawal et al. [1], but is based on an older approach inspired by the earlier work of Ganian et al. [17] that contains similar ideas. The key ingredient for our work is the insight that the approach based on recursive understanding used by Ganian et al. [17] to compute a hybrid parameterization for instances of constraint satisfaction problems, can be applied more generally to aid in the computation of \({{\textbf {ed}}}_{\mathcal {H}}\) and \({{\textbf {tw}}}_{\mathcal {H}}\). We can lift one of their main lemmas to a more general setting, where it roughly shows that given an (s(k), 2k)-unbreakable graph G and an \(\mathcal {H}\)-deletion set X in G that is a subset of some (unknown) structure that witnesses the value of \({{\textbf {tw}}}_{\mathcal {H}}\) or \({{\textbf {ed}}}_{\mathcal {H}}\), we can determine in FPT time whether such a witness exists. This allows \({{\textbf {ed}}}_{\mathcal {H}}\) and \({{\textbf {tw}}}_{\mathcal {H}}\) to be computed in FPT time if we can efficiently find a deletion set with the stated property. For families \(\mathcal {H}\) defined by finitely many forbidden induced subgraphs, a simple bounded-depth branching algorithm suffices. Our main contribution is for bipartite graphs, where we show that the relation between odd cycle transversals and graph separators that lies at the heart of the iterative compression algorithm for OCT [27], can be combined with the fact that there are only few minimal (uv)-separators of size at most 2k in (s(k), 2k)-unbreakable graphs, to obtain an \(\mathcal {H}\)-deletion set with the crucial property described above.

Related Work. Hols et al. [19] used parameterizations based on elimination distance to obtain kernelization algorithms for Vertex Cover.

In recent work [22], a superset of the authors gave FPT algorithms to approximate \({{\textbf {ed}}}_{\mathcal {H}}\) and \({{\textbf {tw}}}_{\mathcal {H}}\) for several classes \(\mathcal {H}\), including bipartite graphs and all classes defined by a finite set of forbidden induced subgraphs. That work employed completely different techniques than used here, and left open the question whether the parameters can be computed exactly in FPT time.

2 Preliminaries

We consider simple undirected graphs without self-loops. The vertex and edge set of a graph G are denoted by V(G) and E(G) respectively. When the graph is clear from context, we denote |V(G)| by n and |E(G)| by m. For each \(X \subseteq V(G)\), the graph induced by X is denoted by G[X]. We denote \(G[V(G) \setminus X]\) by \(G-X\), and write \(G-v\) instead of \(G- \{v\}\). The open and closed neighborhoods of \(v \in V(G)\) are denoted \(N_G(v)\) and \(N_G[v]\) respectively. For \(X \subseteq V(G)\), \(N_G[X] = \bigcup _{v \in X} N_G[v]\) and \(N_G(X) = N_G[X] \setminus X\). The subscript G is omitted if it is clear from context. The graph obtained from G by contracting an edge \(e = \{u,v\} \in E(G)\) is the graph obtained by deleting u and v and inserting a new vertex that is adjacent to all of \((N_G(u) \cup N_G(v)) \setminus \{u,v\}\). A graph H is a minor of G, if it can be obtained from a subgraph of G by a number of edge contractions. A parameter is a function that assigns an integer to each graph. A parameter f is minor-closed if \(f(H) \le f(G)\) for each minor H of G. The connected components of G are denoted by \(\text {cc}(G)\). A set \(Y \subseteq V(G)\) is an \(\mathcal {H}\)-deletion set if \(G-Y \in \mathcal {H}\). A graph class \(\mathcal {H}\) is hereditary if it is closed under vertex deletion, that is, if \(G \in \mathcal {H}\), then for every induced subgraph F of G it holds that \(F \in \mathcal {H}\). In this work we restrict ourselves to hereditary graph classes. A proper c-coloring of a graph is a function \(f :V(G) \rightarrow [c]\) such that for every \(\{u,v\} \in E(G)\) it holds that \(f(u) \ne f(v)\). A graph is bipartite if and only if it has a proper 2-coloring. For sets \(X,Y \subseteq V(G)\), we say that \(S \subseteq V(G)\) is an (XY)-separator if the graph \(G-S\) does not contain a vertex \(u \in X \setminus S\) and \(v \in Y \setminus S\) in the same connected component. Whenever we refer to the size of a graph, we mean the cardinality of its vertex set.

A parameterized problem \(\varPi \) is a subset \(\varSigma ^* \times \mathbb {N}\) for some finite alphabet \(\varSigma \). A parameterized problem is non-uniformly fixed-parameter tractable (FPT) if there exists a fixed d such that for every fixed \(k \in \mathbb {N}\), there exists an algorithm that determines whether \((x,k) \in \varPi \) in \(\mathcal {O}(|x|^d)\) time. (Hence there is a different algorithm for each value of k.)

Due to space limitations, proofs of statements marked by \((\bigstar )\) are deferred to the full version [21].

2.1 \(\mathcal {H}\)-treewidth and \(\mathcal {H}\)-elimination Distance

Definition 1

[17, Definition 4]. Let G be a graph and \(X \subseteq V(G)\). The torso of X, denoted by \({\textbf {T}}_G(X)\), is the graph obtained by turning the neighborhood of every connected component of \(G-X\) into a clique, followed by deleting all of \(V(G) \setminus X\).

Eiben et al. [12] use the term of collapsing \(V(G) \setminus X\) instead of the torso of X. Since our algorithms try to identify X, the torso terminology is more natural. The treewidth of a graph G is denoted by \({{\textbf {tw}}}(G)\) (cf. [3, 10, §7.2]).

Definition 2

[12, Definition 3]. The \(\mathcal {H}\)-treewidth of a graph G is the smallest integer k such that there exists a set \(X \subseteq V(G)\) with \({{\textbf {tw}}}({\textbf {T}}_G(X)) \le k\) and for each connected component \(C \in \text {cc}(G-X)\) we have \(C \in \mathcal {H}\). We call X an \({{\textbf {tw}}}_{\mathcal {H}}\) witness of width k.

Definition 3

[6, 7]. The \(\mathcal {H}\)-elimination distance of G for a hereditary graph class \(\mathcal {H}\), denoted by \({{\textbf {ed}}}_{\mathcal {H}}(G)\), is defined recursively. If G is disconnected, then \({{\textbf {ed}}}_{\mathcal {H}}(G) = \max _{C \in \text {cc}(G)} {{\textbf {ed}}}_{\mathcal {H}}(C)\). If G is connected and belongs to \(\mathcal {H}\), then \({{\textbf {ed}}}_{\mathcal {H}}(G) = 0\). Otherwise, \({{\textbf {ed}}}_{\mathcal {H}}(G) = 1 + \min _{v \in V(G)} {{\textbf {ed}}}_{\mathcal {H}}(G-v)\). The treedepth of a graph, denoted \({{\textbf {td}}}(G)\), is equivalent to \({{\textbf {ed}}}_{\mathcal {H}}(G)\) where \(\mathcal {H}\) only contains the empty graph.

Note that the definition above is well defined when \(\mathcal {H}\) is hereditary, since each hereditary graph class contains the empty graph. We argue that \(\mathcal {H}\)-elimination distance has an equivalent definition similar to that of \(\mathcal {H}\)-treewidth.

Proposition 1

(\(\bigstar \)). A graph has \({{\textbf {ed}}}_{\mathcal {H}}(G) \le k\) if and only if there exists \(X \subseteq V(G)\) such that \({{\textbf {td}}}({\textbf {T}}_G(X)) \le k\) and \(C \in \mathcal {H}\) for each \(C \in \text {cc}(G-X)\).

Similar to \({{\textbf {tw}}}_{\mathcal {H}}\) witnesses, we call X an \({{\textbf {ed}}}_{\mathcal {H}}\) witness of depth k. Since the torso operation on X turns the neighborhood of each connected component of \(G-X\) into a clique, the following note follows.

Note 1

If X is a \({{\textbf {tw}}}_{\mathcal {H}}\) witness of width \(k-1\) (respectively \({{\textbf {ed}}}_{\mathcal {H}}\) witness of depth k), then \(|N(C)| \le k\) for every \(C \in \text {cc}(G-X)\).

We are ready to introduce the main problem we try to solve.

figure b

Definition 4

[25]. Let G be a graph and \(s, c \in \mathbb {N}\). A partition (XCY) of V(G) is an (sc)-separation in G if:

  • C is a separator, that is, no edge has one endpoint in X and one in Y,

  • \(|C| \le c\), \(|X| \ge s\), and \(|Y| \ge s\).

A graph G is (sc)-unbreakable if there is no (sc)-separation in G.

The following proposition is similar to Lemma 21 of Ganian et al. [17].

Proposition 2

(\(\bigstar \)). Let G be an (sc)-unbreakable graph for \(s,c \in \mathbb {N}\) and \(\mathcal {H}\) be a graph class such that \({{\textbf {tw}}}_{\mathcal {H}}(G) \le k-1\) (resp. \({{\textbf {ed}}}_{\mathcal {H}}(G) \le k\)) and \(c \ge k\). Then at least one of the following holds:

  1. 1.

    \({{\textbf {tw}}}(G) \le s + k - 1\) (resp. \({{\textbf {td}}}(G) \le s + k - 1\)),

  2. 2.

    each \({{\textbf {tw}}}_{\mathcal {H}}\) (resp. \({{\textbf {ed}}}_{\mathcal {H}}\)) witness X of G satisfies the following:

    • \(G-X\) has exactly one connected component C of size at least s, and

    • \(|V(G) \setminus N[C]| < s\) and \(|X| \le s+k-1\).

The following lemma bounds the number of small connected vertex sets with a small neighborhood. It was originally stated for connected sets of exactly b vertices with an open neighborhood of exactly f vertices.

Lemma 1

[15, cf. Lemma 3.1]. Let G be a graph. For every \(v \in V(G)\) and \(b,f \ge 0\), the number of connected vertex sets \(B \subseteq V(G)\) such that (a) \(v \in B\), (b) \(|B| \le b+1\), and (c) \(|N(B)| \le f\) is at most \(b \cdot f \cdot \left( {\begin{array}{c}b+f\\ b\end{array}}\right) \). Furthermore they can be enumerated in \(\mathcal {O}(n \cdot b^2 \cdot f \cdot (b+f) \cdot \left( {\begin{array}{c}b+f\\ b\end{array}}\right) )\) time using polynomial space.

2.2 CMSO

We use the formalism of Counting Monadic Second Order Logic (CMSO) as treated by Lokshtanov et al. [25]. For a more complete introduction we refer to the book of Courcelle and Engelfriet [9].

Let \(\mathcal {H}\) be a graph class. We say that containment in \(\mathcal {H}\) is expressible in CMSO if there exists a CMSO formula \(\varphi _\mathcal {H}\) such that for any graph G it holds that \(G \models \varphi _\mathcal {H}\) if and only if \(G \in \mathcal {H}\).

Lemma 2

(\(\bigstar \)). There exist CMSO-formulas with the following properties:

  1. 1.

    For any graph H, there exists a formula \(\varphi _{\mathrm {H-MINOR}}(X)\) such that for any graph G and any \(X \subseteq V(G)\) it holds that \((G,X) \models \varphi _{\mathrm {H-MINOR}}(X)\) if and only if H is a minor of G[X].

  2. 2.

    For any graph class \(\mathcal {H}\) characterized by a finite set of forbidden induced subgraphs, there exists a formula \(\varphi _{\mathcal {H}}\) such that for any graph G it holds that \(G \models \varphi _{\mathcal {H}}\) if and only if graph \(G \in \mathcal {H}\).

  3. 3.

    There exists a formula \(\varphi _{BIP}\) such that for any graph G it holds that \(G \models \varphi _{BIP}\) if and only if graph G is bipartite.

  4. 4.

    For each \(k \in \mathbb {N}\), for each graph class \(\mathcal {H}\) such that containment in \(\mathcal {H}\) is CMSO expressible, and for each minor-closed parameter f, there exists a formula \(\varphi _{(k,\mathcal {H},f)}(X)\) such that for any graph G and any \(X \subseteq V(G)\) we have \((G,X) \models \varphi _{(k,\mathcal {H},f)}(X)\) if and only if \(f({\textbf {T}}_G(X)) \le k\) and \(C \in \mathcal {H}\) for each \(C \in \text {cc}(G-X)\).

Since both treewidth and treedepth are minor-closed parameters, we note the following from the lemma above.

Note 2

For each \(k \in \mathbb {N}\) and graph class \(\mathcal {H}\) such that containment in \(\mathcal {H}\) is CMSO-expressible, there exists a formula \(\varphi _{(k,\mathcal {H},{{\textbf {tw}}})}\) (respectively \(\varphi _{(k,\mathcal {H},{{\textbf {td}}})}\)) such that (Gk) is a yes-instance of \(\mathcal {H}\)-treewidth (respectively \(\mathcal {H}\)-elimination distance) if and only if \(G \models \varphi _{(k,\mathcal {H},{{\textbf {tw}}})}\) (respectively \(G \models \varphi _{(k,\mathcal {H},{{\textbf {td}}})}\)).

CMSO formulas can have free variables. A graph together with an evaluation of free variables is called a structure. We denote the problem of evaluating a CMSO formula \(\varphi \) on a structure by \(\textsc {CMSO}[\varphi ]\). The following theorem is the main tool used to achieve our algorithms, we apply it only to formulas without free variables. As the formulation differs slightly from its original form, we provide a proof in the full version.

Theorem 1

(\(\bigstar \)) [25, Theorem 23]. Let \(\hat{\varphi }\) be a CMSO formula. For all \(\hat{c} :\mathbb {N}_0 \rightarrow \mathbb {N}_0\), there exists \(\hat{s} :\mathbb {N}_0 \rightarrow \mathbb {N}_0\) such that if \(\textsc {CMSO}[\hat{\varphi }]\) parameterized by k is FPT on \((\hat{s}(k),\hat{c}(k))\)-unbreakable structures, then CMSO\([\hat{\varphi }]\) parameterized by k is FPT on general structures.

3 Algorithms for Computing \({{\textbf {ed}}}_{\mathcal {H}}\) and \({{\textbf {tw}}}_{\mathcal {H}}\)

In this section we present our algorithms. In Sect. 3.1 we present a key lemma. In Sect. 3.2 we use it to deal with \(\mathcal {H}\) characterized by a finite number of forbidden induced subgraphs, and in Sect. 3.3 we deal with bipartite graphs.

3.1 Extracting Witnesses from Deletion Sets Contained in Them

Our strategy for solving \(\mathcal {H}\)-treewidth and \(\mathcal {H}\)-elimination distance is similar to that of lemmas 9 and 10 of Ganian et al. [17] and is based on Proposition 2. Given an (s(k), c(k))-unbreakable graph, either the treewidth of the graph is bounded (1) and we can solve the problem directly using Courcelle’s Theorem, or each witness is of bounded size and introduces some structure (2).

In the following lemma we assume we are in the latter case (hence the \({{\textbf {tw}}}(G) > s(k)+k\) condition) and are given some \(\mathcal {H}\)-deletion set Y. We show that given an (s(k), c(k))-unbreakable graph, in FPT time we can find a witness X such that \(Y \subseteq X\) if such a witness exists.

Lemma 3

Consider some \(k \in \mathbb {N}\) and \(c :\mathbb {N} \rightarrow \mathbb {N}\) such that \(c(k) \ge k\). Let \(\mathcal {H}\) be a graph class such that containment in \(\mathcal {H}\) is solvable in polynomial time. There is an algorithm that runs in FPT time that, given an (s(k), c(k))-unbreakable graph for any \(s :\mathbb {N} \rightarrow \mathbb {N}\) with \({{\textbf {tw}}}(G) > s(k)+k\) and an \(\mathcal {H}\)-deletion set Y of size at most \(s(k)+k\), decides whether there is an \({{\textbf {tw}}}_{\mathcal {H}}(G)\) witness X of width at most \(k-1\) (respectively \({{\textbf {ed}}}_{\mathcal {H}}(G)\) witness X of depth at most k) such that \(Y \subseteq X\).

Proof

We refer to a witness as either being an \({{\textbf {tw}}}_{\mathcal {H}}\) witness of width at most \(k-1\) or an \({{\textbf {ed}}}_{\mathcal {H}}\) witness of depth at most k. Given a set \(X \subseteq V(G)\), we can verify that it is a witness by testing whether \({{\textbf {tw}}}({\textbf {T}}_G(X)) \le k-1\) (respectively \({{\textbf {td}}}({\textbf {T}}_G(X)) \le k\)) in FPT time [3, 28] and verifying that each connected component \(C \in \text {cc}(G-X)\) is contained in \(\mathcal {H}\), which can be done in polynomial time by assumption.

We show that we can find a witness if it exists, by doing the above verification for FPT many vertex subsets \(D \subseteq V(G)\), as follows.

  1. 1.

    For each \(y \in Y\), let \(\mathcal {C}_y\) be the set of connected vertex sets S with \(y \in S\), \(|S| \le s(k)\) and \(|N(S)| \le k\). For each \(B \subseteq Y\) with \(|B| \le k\), a choice tuple \(t_B\) contains an entry for each \(y \in Y \setminus B\), where entry \(t_B[y]\) is some set \(C_y \in \mathcal {C}_{y}\).

  2. 2.

    For each \(B \subseteq Y\) with \(|B| \le k\) and each choice tuple \(t_B\), if \(G - (Y \cup \bigcup _{y \in Y \setminus B} N(t_B[y]))\) has exactly one connected component C of size at least s(k) and \(|V(G) \setminus N[C]| < s(k)\), apply the witness verification test to \(D = Y \cup \bigcup _{y \in Y \setminus B} N(t_B[y]) \cup Q\) for each \(Q \subseteq V(G) \setminus N[C]\).

  3. 3.

    Return the logical or of all witness verification tests.

We argue that the algorithm runs in FPT time. Note that as \(|Y| \le s(k) + k\), there are at most \(\left( {\begin{array}{c}s(k)+k\\ k\end{array}}\right) \) choices for B. Furthermore \(\mathcal {C}_y\) can be computed in FPT time using Lemma 1, hence the number of choice tuples is also FPT many. For each choice for B and each choice tuple \(t_B\), there are at most \(2^{s(k)}\) choices for Q. Since each vertex set can be verified to be a witness in FPT time, the running time claim follows.

Finally we argue correctness of the algorithm. Since \({{\textbf {tw}}}(G) > s(k) + k\) (and also \({{\textbf {td}}}(G) > s(k) + k\) as \({{\textbf {tw}}}(G) \le {{\textbf {td}}}(G) - 1\)), by Proposition 2 any witness X is of size at most \(s(k) + k - 1\), the graph \(G-X\) has exactly one large connected component C of size at least s(k), and \(|V(G) \setminus N[C]| < s(k)\).

Suppose G has a witness that is a superset of Y. Fix some witness X of minimal cardinality with \(Y \subseteq X\) and let C be the unique component of size at least s(k) of \(G-X\). Note that since \(C \cap X = \emptyset \), we have \(C \cap Y = \emptyset \).

Let \(B = N(C) \cap Y\). By Note 1 we have \(|N(C)| \le k\), hence the branching algorithm makes this choice for B at some point. For each \(y \in Y \setminus B\), let \(C_y\) be the connected component of \(G-N[C]\) containing y. Since \(|V(G) \setminus N[C]| < s(k)\) and \(|N(C)| \le k\), we have that \(|V(C_y)| < s(k)\) and \(|N(C_y)| \le k\). Note that \(N(C_y) \subseteq N(C) \subseteq X\). The branching algorithm at some point tries the choice tuple \(t_B\) where \(t_B[y] = C_y\) for each \(y \in Y \setminus B\). Consider the set \(A = Y \cup \bigcup _{y \in Y \setminus B} N(t_B[y])\). Note that \(A \subseteq X\) by construction.

If \(N(C) \subseteq A\), then the single large component of \(G-A\) of size at least s(k) is exactly C. Since \(|V(G) \setminus N[C]| < s(k)\), it follows that \(X = A \cup Q\) for some \(Q \subseteq V(G) \setminus N[C]\). It follows that the algorithm correctly identifies X in this case.

The only remaining case is \(N(C) \not \subseteq A\). We argue that this cannot happen when witness X is of minimal cardinality. Suppose \(N(C) \not \subseteq A\) and let \(v \in N(C) \setminus A\). Let \(Z = Y \cup \bigcup _{y \in Y \setminus B} N[C_y]\) and note that we take the closed neighborhoods of the components, instead of the open neighborhoods as in the definition of A. Let \(C_v^*\) be the connected component of \(G-(C \cup Z)\) that contains v. We argue that \(X \setminus C_v^*\) is a witness. Note that \(C_v^* \cap Y = \emptyset \) by construction as \(Y \subseteq Z\). Because Y is an \(\mathcal {H}\)-deletion set, it follows that for each connected component \(C'\) in \(G - (X \setminus C_v^*)\) we have \(C' \in \mathcal {H}\). We argue that \(N(C_v^*) \subseteq N[C]\). Since \(C_v^*\) is a connected component of \(G - (C \cup Z)\) we have \(N(C_v^*) \subseteq C \cup Z\), so it suffices to show that \(N(C_v^*) \cap Z \subseteq N(C)\). Assume for a contradiction that \(C_v^*\) contains a vertex \(v'\) adjacent to some \(z \in Z \setminus N(C)\); note that \(v' \notin Z\). If \(z \in Y\), then \(z \in Y \setminus N(C) = Y \setminus B\) and the connected component \(C_z\) of \(G - N[C]\) is adjacent to \(v'\), implying \(v' \in N[C_z]\) and therefore \(v' \in Z\); a contradiction. If \(z \notin Y\), then by definition of Z we have \(z \in N[C_y]\) for some \(y \in Y \setminus B\). Since \(N(C_y) \subseteq N(C)\) this implies \(z \in C_y\). But then \(v' \notin C \cup Z\) is adjacent to a vertex of the component \(C_y\) of \(G - N[C]\), so \(v' \in Z\) by definition of Z; a contradiction. Since \(N(C_v^*) \subseteq N[C]\) and v is adjacent to at least one vertex in C as \(v \in N(C)\), it follows that \(C \cup C_v^*\) is a connected component of \(G - (X \setminus C_v^*)\) with \(N(C \cup C_v^*) \subseteq N(C)\). Therefore \({\textbf {T}}_G(X \setminus C_v^*)\) is an induced subgraph of \({\textbf {T}}_G(X)\). We conclude that \(X \setminus C_v^* \supseteq Y\) is a witness. Since X was assumed to be of minimal cardinality, we arrive at a contradiction and hence \(A \supseteq N(C)\).    \(\square \)

3.2 Classes \(\mathcal {H}\) with Finitely Many Forbidden Induced Subgraphs

Theorem 2

Let \(\mathcal {H}\) be a graph class characterized by a finite set of forbidden induced subgraphs. Then \(\mathcal {H}\)-treewidth and \(\mathcal {H}\)-elimination distance are non-uniformly fixed-parameter tractable.

Proof

By Lemma 2 containment in \(\mathcal {H}\) is CMSO expressible, therefore by Note 2 there exists a formula \(\varphi _{(k,\mathcal {H},f)}\) for each \(f \in \{{{\textbf {tw}}},{{\textbf {td}}}\}\) such that an instance (Gk) of \(\mathcal {H}\)-treewidth (respectively \(\mathcal {H}\)-elimination distance) is a yes-instance if and only if \(G \models \varphi _{(k,\mathcal {H},f)}\). Furthermore, containment in \(\mathcal {H}\) is polynomial time solvable, as we can verify that a graph does not contain any of the finitely many forbidden induced subgraphs.

We argue that both problems are in FPT when the input graph G is (s(k), k)-unbreakable for any \(s :\mathbb {N} \rightarrow \mathbb {N}\). If \({{\textbf {tw}}}(G) \le s(k) + k\), we solve the problems directly using Courcelle’s Theorem [8] using \(\varphi _{(k,\mathcal {H},f)}\). Otherwise by Proposition 2 each witness X is of size at most \(s(k)+k-1\). We can enumerate all minimal \(\mathcal {H}\)-deletion sets \(\mathcal {Y}\) of size at most \(s(k)+k-1\) in FPT time by finding a forbidden induced subgraph and branching in all finitely many ways of destroying it. Since any witness X is an \(\mathcal {H}\)-deletion set, for some \(Y \in \mathcal {Y}\) we have \(Y \subseteq X\). Hence we solve the problem by calling Lemma 3 for each \(Y \in \mathcal {Y}\). Applying Theorem 1 concludes the proof.    \(\square \)

Using known characterizations by a finite number of forbidden induced subgraphs (cf. [5]) we obtain the following corollary to Theorem 2.

Corollary 1

Let \(\mathcal {H}\) be set of graphs that are either (1) cliques, (2) claw-free, (3) of degree at most d for fixed d, (4) cographs, or (5) split graphs. \(\mathcal {H}\)-treewidth and \(\mathcal {H}\)-elimination distance are non-uniformly fixed-parameter tractable.

3.3 Bipartite Graphs

We use shorthand \(\text {bip}\) to denote the class of bipartite graphs. The problem of deleting k vertices to obtain a bipartite graph is better known as the Odd Cycle Transversal (OCT) problem. The problem was shown to be FPT for the first time by Reed et al. [27]. We use some of their ingredients to show the following.

Lemma 4

The \(\text {bip}\)-treewidth and \(\text {bip}\)-elimination distance problems are non-uniformly fixed-parameter tractable.

Proof

By Lemma 2 containment in the class of bipartite graphs is CMSO expressible, therefore by Note 2 there exists a formula \(\varphi _{(k,\text {bip},f)}\) for each \(f \in \{{{\textbf {tw}}},{{\textbf {td}}}\}\) such that an instance (Gk) of \(\text {bip}\)-treewidth (respectively \(\text {bip}\)-elimination distance) is a yes-instance if and only if \(G \models \varphi _{(k,\text {bip},f)}\). We argue that both problems are FPT in (s(k), 2k)-unbreakable graphs for any \(s :\mathbb {N} \rightarrow \mathbb {N}\). Note that the theorem then follows by Theorem 1.

Let G be an (s(k), 2k)-unbreakable graph. As before, we use the term witness to either refer to an \({{\textbf {tw}}}_{\mathcal {H}}\) witness of width at most \(k-1\) or an \({{\textbf {ed}}}_{\mathcal {H}}\) witness of depth at most k, depending on the problem being solved. We first test whether \({{\textbf {tw}}}(G) \le s(k)+k\), in FPT time [3]. If so, then we can solve the problems directly using Courcelle’s Theorem [8] using \(\varphi _{(k,\text {bip},f)}\). Otherwise by Proposition 2 the size of each witness in G is at most \(s(k)+k-1\), and for each witness X there is a unique connected component of \(G-X\) of at least s(k) vertices, henceforth called the large component. We use a two-step process to find an odd cycle transversal that is a subset of some witness (if a witness exists), so that we may invoke Lemma 3 to find a witness.

For a witness \(X^*\) in G and an odd cycle transversal W of G, we say that a partition \((W_L, W_I)\) of W is weakly consistent with \(X^*\) if for the unique large component C of \(G - X^*\) we have that \(W \cap C = W_L\), \(|W_L| \le k\), and \(W \subseteq C \cup X^*\). An odd cycle transversal W is strongly consistent with \(X^*\) if \(W \subseteq X^*\).

The following claim encapsulates the connection between odd cycle transversals and separators that forms the key of the iterative-compression algorithm for OCT due to Reed, Smith, and Vetta [27].

Claim 1

(\(\bigstar \)). For each partitioned OCT \(W = (W_L, W_I)\) of G, for each partition of \(W_L = W_{L,1} \cup W_{L,2}\) into two independent sets, for each proper 2-coloring c of \(G - W\), we have the following equivalence for each \(X \subseteq V(G) \setminus W\): the graph \((G - W_I) - X\) has a proper 2-coloring with \(W_{L,1}\) color 1 and \(W_{L,2}\) color 2 if and only if the set X separates A from R in the graph \(G - W\), with:

$$\begin{aligned} A &= (N_{G-W_I}(W_{L,1}) \cap c^{-1}(1)) \cup (N_{G-W_I}(W_{L,2}) \cap c^{-1}(2)) \\ R &= (N_{G-W_I}(W_{L,1}) \cap c^{-1}(2)) \cup (N_{G-W_I}(W_{L,2}) \cap c^{-1}(1)). \end{aligned}$$

Observe that \(c^{-1}(i) \subseteq V(G - W)\) for each \(i \in [2]\), so that \(A \cup R \subseteq V(G - W)\), and that the separator X is allowed to intersect \(A \cup R\).

The next two claims show that certain types of OCTs can be computed efficiently in the (s(k), 2k)-unbreakable input graph G.

Claim 2

(\(\bigstar \)). There is an FPT algorithm that outputs a list of partitioned OCTs in G with the guarantee that for each witness X, there is a partitioned OCT on the list that is weakly consistent with X.

Claim 3

There is an FPT algorithm that, given a partitioned OCT that is weakly consistent with some (unknown) witness X in G, outputs a list of OCTs in G such that at least one is strongly consistent with X.

Proof

Let \((W_L,W_I)\) be the given partitioned OCT, where \(W_L \cup W_I = W\). If \(|W| > s(k) + k - 1\), then no witness is strongly consistent with W by Proposition 2, hence we may assume \(|W| \le s(k)+k-1\).

  1. 1.

    Initialize an empty list \(\mathcal {W}\). For each \(y \in V(G)\), let \(\mathcal {C}_y\) be the set of connected vertex sets S with \(y \in S\), \(|S| \le s(k)\) and \(|N(S)| \le 2k\). Let \(c^*\) be an arbitrary proper 2-coloring of \(G-W\) and let \(B_i^* = (c^*)^{-1}(i)\) for each \(i \in [2]\).

  2. 2.

    For each partition \((W_1,W_2)\) of \(W_L\), let \(B_1 = N(W_2) \setminus W\) and \(B_2 = N(W_1) \setminus W\). Let \(A = (B_1 \cap B_2^*) \cup (B_2 \cap B_1^*)\) and \(R = (B_1 \cap B_1^*) \cup (B_2 \cap B_2^*)\).

    1. (a)

      For each choice \(Q \in \{A,R\}\) with \(|Q| \le s(k)+k\), for each \(D \subseteq Q\) with \(|D| \le k\), choice tuple \(t_{Q,D}\) has an entry for each \(y \in Q \setminus D\), where entry \(t_{Q,D}[y]\) is some vertex set \(C_y \in \mathcal {C}_y\).

    2. (b)

      For each choice \(Q \in \{A,R\}\) with \(|Q| \le s(k)+k\), for each \(D \subseteq Q\) with \(|D| \le k\), and for each choice tuple \(t_{Q,D}\), add \((W \cup D \cup \bigcup _{y \in Q \setminus D}N(t_{Q,D}[y])) \setminus W_L\) to \(\mathcal {W}\) in case it is an OCT.

The resulting list \(\mathcal {W}\) is given as the output of the algorithm. The running time follows from Lemma 1 and the fact that there are FPT many choices for \((W_1,W_2)\), D, and tuple \(t_{Q,D}\).

We argue the correctness of the algorithm. Note that each set in the output list is an OCT by construction. Consider some witness X with \((W_L,W_I)\) weakly consistent with X and let C be the unique large component of \(G-X\), which is bipartite by definition of witness. Let \(Y = (W \setminus W_L) \cup N(C) \subseteq X\), note that Y is an OCT of G. Let \(c :V(G) \setminus Y \rightarrow [2]\) be a proper 2-coloring of \(G-Y\). For some partition \((W_1,W_2)\) of \(W_L\) we have \(W_i \subseteq c^{-1}(i)\) for each \(i \in [2]\). Note that since \(Y \setminus W_I \subseteq N(C)\), we have that \(|Y \setminus W_I| \le k\).

By Claim 1, it follows that \(Y \setminus W_I \subseteq N(C)\) separates A and R in \(G-W\). Note that \(B_i \subseteq N[C]\) for each \(i \in [2]\) since \(W_L \subseteq C\), therefore \(A \subseteq N[C]\) and \(R \subseteq N[C]\). Observe that \(W_L \cup N(C)\) is an (AR)-separator of size at most 2k in G. Therefore, since G is (s(k), 2k)-unbreakable, for at least one \(Q \in \{A,R\}\) the vertex set reachable from \(Q \setminus (W_L \cup N(C))\) in \(G - (W_L \cup N(C))\) has size at most s(k). Since A and R are disjoint from \(W \supseteq W_L\) by definition, this implies \(|Q| \le s(k)+k\). Hence the algorithm tries this choice as \(|Q| \le s(k) + k\) is satisfied. Let \(D = N(C) \cap Q\). For each \(y \in Q \setminus D\), let \(C_y\) be the connected component of \(G-(N(C) \cup W_L)\) containing y. Note that \(|C_y| \le s(k)\) and \(|N(C_y)| \le 2k\). Let the choice tuple \(t_{Q,D}\) be such that \(t_{Q,D}[y] = C_y\) for each \(y \in Q \setminus D\). Observe that \((D \cup \bigcup _{y \in Q \setminus D}N(t_{Q,D}[y])) \setminus W_L \subseteq N(C)\) is an (AR)-separator in \(G-W\). Therefore \((W_I \cup D \cup \bigcup _{y \in Q \setminus D}N(t_{Q,D}[y])) \setminus W_L\) is an OCT by Claim 1 contained in X, concluding the proof.

With the two claims above, we can solve the problem as follows. Compute a list of partitions \(\mathcal {W}\) using Claim 2 and use each \(W \in \mathcal {W}\) as input to Claim 3. Using the output \(\mathcal {U}\) of Claim 3, call Lemma 3 for each \(U \in \mathcal {U}\). By the output guarantee of the claims, for each witness X we call the lemma with \(U \subseteq X\) at some point, thus solving the problem.    \(\square \)

4 Conclusion

We have shown that \(\mathcal {H}\)-elimination distance and \(\mathcal {H}\)-treewidth are non-uniformly fixed-parameter tractable for \(\mathcal {H}\) being the class of bipartite graphs, and whenever \(\mathcal {H}\) is defined by a finite set of forbidden induced subgraphs. While the algorithms presented here solve the decision variant of the problem, by self-reduction they can be used to identify a witness if one exists. The main observation driving such a self-reduction is the following: if \({{\textbf {tw}}}_{\mathcal {H}}(G) \le k\), then for an arbitrary \(v \in V(G)\) there exists a \({{\textbf {tw}}}_{\mathcal {H}}(G)\)-witness that contains v if and only the graph \(G'\) obtained from G by inserting a minimal forbidden induced subgraph into \(\mathcal {H}\) and identifying one of its vertices with v, still satisfies \({{\textbf {tw}}}_{\mathcal {H}}(G') \le k\). Hence an iterative process can identify all vertices of a witness in this way.

While we have focused on the established notions of \({{\textbf {tw}}}_{\mathcal {H}}\) and \({{\textbf {ed}}}_{\mathcal {H}}\), the ideas presented here can be generalized using minor-closed graph parameters f other than treewidth and treedepth. As long as f can attain arbitrarily large values, implying its value on a clique grows with the size of the clique, and \(\mathcal {H}\) is characterized by a finite set of forbidden induced subgraphs, we believe our approach can be generalized to answer questions of the form: does G have an \(\mathcal {H}\)-deletion set X for which \(f({\textbf {T}}_G(X)) \le k\)?