1 Introduction

Graph transversal problems play a central role in Theoretical Computer Science. To define the notion of a graph transversal, let \(\mathcal{H}\) be a family of graphs, \(G=(V,E)\) be a graph and \(S\subseteq V\) be a subset of vertices of G. The graph \(G-S\) is obtained from G by removing all vertices of S and all edges incident to vertices in S. We say that S is an \(\mathcal{H}\)-transversal of G if \(G-S\) is \(\mathcal{H}\)-free, that is, if \(G-S\) contains no induced subgraph isomorphic to a graph of \(\mathcal{H}\). In other words, S intersects every induced copy of every graph of \(\mathcal{H}\) in G. Let \(C_r\) and \(P_r\) denote the cycle and path on r vertices, respectively. Then S is a vertex cover, feedback vertex set, or odd cycle transversal if S is an \(\mathcal{H}\)-transversal for, respectively, \(\mathcal{H}=\{P_2\}\) (that is, \(G-S\) is edgeless), \(\mathcal{H}=\{C_3,C_4,\ldots \}\) (that is, \(G-S\) is a forest), or \(\mathcal{H}=\{C_3,C_5,C_7,\ldots \}\) (that is, \(G-S\) is bipartite).

Usually the goal is to find a transversal of minimum size in some given graph. In this paper we focus on the decision problems corresponding to the three transversals defined above. These are the Vertex Cover, Feedback Vertex Set and Odd Cycle Transversal problems, which are to decide whether a given graph has a vertex cover, feedback vertex set or odd cycle transversal, respectively, of size at most k for some given positive integer k. Each of these three problems is well studied and is well known to be NP-complete.

We may add further constraints to a transversal. In particular, we may require a transversal of a graph G to be connected, that is, to induce a connected subgraph of G. The corresponding decision problems for the three above transversals are then called Connected Vertex Cover, Connected Feedback Vertex Set and Connected Odd Cycle Transversal, respectively.

Garey and Johnson [15] proved that Connected Vertex Cover is NP-complete even on planar graphs of maximum degree 4 (see, for example, [14, 31, 36] for NP-completeness results for other graph classes). Grigoriev and Sitters [18] proved that Connected Feedback Vertex Set is NP-complete even on planar graphs with maximum degree 9. More recently, Chiarelli et al. [10] proved that Connected Odd Cycle Transversal is NP-complete even on graphs of arbitrarily large girth and on line graphs.

As all three decision problems and their connected variants are NP-complete, we can consider how to restrict the input to some special graph class in order to achieve tractability. Note that this approach is in line with the aforementioned results in the literature, where NP-completeness was proven on special graph classes. It is also in line with with, for instance, polynomial-time results for Connected Vertex Cover by Escoffier, Gourvès and Monnot [12] (for chordal graphs) and Ueno, Kajitani and Gotoh [35] (for graphs of maximum degree at most 3 and trees).


Just as in most of these papers, we consider hereditary graph classes, that is, graph classes closed under vertex deletion. Hereditary graph classes form a rich framework that captures many well-studied graph classes. It is not difficult to see that every hereditary graph class \(\mathcal{G}\) can be characterized by a (possibly infinite) set \({\mathcal{F}}_{\mathcal{G}}\) of forbidden induced subgraphs. If \(|{\mathcal{F}}_{\mathcal{G}}|=1\), say \(\mathcal{F}=\{H\}\), then \(\mathcal{G}\) is said to be monogenic, and every graph \(G\in \mathcal{G}\) is said to be H-free. Considering monogenic graph classes can be seen as a natural first step for increasing our knowledge of the complexity of an NP-complete problem in a systematic way. Hence, we consider the following research question:

How does the structure of a graph H influence the computational complexity of a graph transversal problem for input graphs that are H -free?


Note that different graph transversal problems may behave differently on some class of H-free graphs. However, the general strategy for obtaining complexity results is to first try to prove that the restriction to H-free graphs is NP-complete whenever H contains a cycle or the claw (the 4-vertex star). This is usually done by showing, respectively, that the problem is NP-complete on graphs of arbitrarily large girth (length of a shortest cycle) and on line graphs, which form a subclass of claw-free graphs. If this is the case, then we are left to consider the case when H does not contain a cycle, implying that H is a forest, and does not contain a claw either, implying that H is a linear forest, that is, the disjoint union of one or more paths.

1.1 The Graph H Contains a Cycle or Claw

It follows from Poljak’s construction [30] that Vertex Cover is NP-complete on graphs of arbitrarily large girth. Hence, Vertex Cover is NP-complete on H-free graphs if H contains a cycle. However, Vertex Cover becomes polynomial-time solvable when restricted to claw-free graphs [25, 32]. In contrast, the other five problems Connected Vertex Cover, (Connected) Feedback Vertex Set and (Connected) Odd Cycle Transversal are all NP-complete on graphs of arbitrarily large girth and on line graphs; see Table 1. Hence, for these five problems, it remains to consider only the case when H is a linear forest.

1.2 The Graph H Is a Linear Forest

In this paper, we focus on proving new complexity results for Feedback Vertex Set, Connected Feedback Vertex Set, Odd Cycle Transversal and Connected Odd Cycle Transversal on H-free graphs. It follows from Sect. 1.1 that we may assume that H is a linear forest. Below we first discuss the known polynomial-time solvable cases. As we will use algorithms for Vertex Cover and Connected Vertex Cover as subroutines for our new algorithms, we include these two problems in our discussion.

For every \(s\ge 1\), Vertex Cover (by combining the results of [1, 34]) and Connected Vertex Cover [10] are polynomial-time solvable on \(sP_2\)-free graphs.Footnote 1 Moreover, Vertex Cover is also polynomial-time solvable on \((sP_1+ P_6)\)-free graphs, for every \(s\ge 0\) [20], as is the case for Connected Vertex Cover on \((sP_1+ P_5)\)-free graphs [24]. Their complexity on \(P_r\)-free graphs is unknown for \(r\ge 7\) and \(r\ge 6\), respectively.

Both Feedback Vertex Set and Odd Cycle Transversal are polynomial-time solvable on permutation graphs [4], and thus on \(P_4\)-free graphs. Recently, Okrasa and Rzążewski [29] proved that Odd Cycle Transversal is NP-complete on \(P_{13}\)-free graphs. A small modification of their construction yields the same result for Connected Odd Cycle Transversal. The complexity of Feedback Vertex Set and Connected Feedback Vertex Set is unknown when restricted to \(P_r\)-free graphs for \(r\ge 5\). For every \(s\ge 1\), both problems and their connected variants are polynomial-time solvable on \(sP_2\)-free graphs [10], using the price of connectivity for feedback vertex set [2, 21].Footnote 2

1.3 Our Results

In Sect. 3 we prove that Connected Feedback Vertex Set and Connected Odd Cycle Transversal are polynomial-time solvable on \(P_4\)-free graphs, just as is the case for Feedback Vertex Set and Odd Cycle Transversal. In Sect. 4 we prove that for every \(s\ge 1\), these four problems are all polynomial-time solvable on \((sP_1+ P_3)\)-free graphs; see also Table 1. Finally, in Sect. 5, we show that Odd Cycle Transversal and Connected Odd Cycle Transversal are NP-complete on \((P_2+ P_5,P_6)\)-free graphs, that is, graphs that are both \((P_2+ P_5)\)-free and \(P_6\)-free.

Table 1 The complexities of the three connected transversal problems together with the original transversal problems on graphs of girth at least p for every (fixed) constant \(p\ge 3\), on line graphs, and on H-free graphs for various linear forests H

To prove our polynomial-time results, we rely on two proof ingredients. The first one is that we use known algorithms for Vertex Cover and Connected Vertex Cover restricted to H-free graphs as subroutines in our new algorithms. The second is that we consider the connected variant of the transversal problems in a more general form. For Connected Vertex Cover this variant is defined as follows:

figure a

Note that Connected Vertex Cover Extension becomes the original problem if \(W=\emptyset \). We define the problems Connected Feedback Vertex Set Extension and Connected Odd Cycle Transversal Extension analogously. We will prove all our results for connected feedback vertex sets and connected odd cycle transversals for the extension versions. These extension versions will serve as auxiliary problems for some of our inductive arguments, but this approach also leads to slightly stronger results.

Remark 1

For any connected extension variant of these problems on \(\mathcal{H}\)-transversals, we may assume that the input graph G is connected. If it is not, then either all but at most one connected component of G is \(\mathcal{H}\)-free and does not intersect W, in which case it need not be considered, or the answer is immediately no. It is easy to check \(\mathcal{H}\)-freeness for the three problems we consider.

Remark 2

Note that one could also define extension versions for any original transversal problem (that is, where there is no requirement for the transversal to be connected). However, such extension versions will be polynomially equivalent. Indeed, we can solve the extension version on the input (GWk) by considering the original problem on the input \((G-W,\max \{0, k-|W|\})\) and adding W to the solution. However, due to the connectivity condition, we cannot use this approach for the connected variants.

Remark 3

It is known that Vertex Cover is polynomial-time solvable on \((P_1+ H)\)-free graphs whenever this is the case on H-free graphs. This follows from a well-known observation, see, for example, [27]: one can solve the complementary problem of finding a maximum independent set in a \((P_1+ H)\)-free graph by solving this problem on each H-free graph obtained by removing a vertex and all of its neighbours. However, this trick does not work for Connected Vertex Cover. Moreover, it does not work for Feedback Vertex Set and Odd Cycle Transversal and their connected variants either.

2 Preliminaries

Let \(G=(V,E)\) be a graph. For a set \(S\subseteq V\), we write G[S] to denote the subgraph of G induced by S. We say that S is connected if G[S] is connected. We write \(G-S\) to denote the graph \(G[V\setminus S]\). A subset \(D\subseteq V\) is a dominating set of G if every vertex of \(V\setminus D\) is adjacent to at least one vertex of D. An edge uv of a graph \(G=(V,E)\) is dominating if \(\{u,v\}\) is a dominating set. The complement of G is the graph \(\overline{G}=(V,\{uv\; |\; uv\not \in E\; \text{ and }\; u\ne v\})\). The neighbourhood of a vertex \(u\in V\) is the set \(N_G(u)=\{v\; |\; uv\in E\}\) and for \(U\subseteq V\), we let \(N_G(U)=\bigcup _{u\in U}N(u)\setminus U\). We omit the subscript when there is no ambiguity. We denote the degree of a vertex \(u\in V\) by \(\deg (u)=|N_G(u)|\).

Let \(G=(V,E)\) be a graph and let \(S\subseteq V\). Then S is a clique if the vertices of S are pairwise adjacent and an independent set if the vertices of S are pairwise non-adjacent. A graph is complete if its vertex set is a clique. We let \(K_r\) denote the complete graph on r vertices. Let \(T\subseteq V\) with \(S\cap T=\emptyset \). Then S is complete to T if every vertex of S is adjacent to every vertex of T, and S is anti-complete to T if there are no edges between S and T. In the first case, we also say that S is complete to G[T] and in the second case anti-complete to G[T].

A graph is bipartite if its vertex set can be partitioned into at most two independent sets. A bipartite graph is complete bipartite if its vertex set can be partitioned into two independent sets X and Y such that X is complete to Y. If X or Y has size 1, the complete bipartite graph is said to be a star. Note that every edge of a complete bipartite graph is dominating.

Let \(G_1\) and \(G_2\) be two vertex-disjoint graphs. The union operation creates the disjoint union \(G_1+ G_2\) of \(G_1\) and \(G_2\), that is, the graph with vertex set \(V(G_1)\cup V(G_2)\) and edge set \(E(G_1)\cup E(G_2)\). We denote the disjoint union of r copies of \(G_1\) by \(rG_1\). The join operation adds an edge between every vertex of \(G_1\) and every vertex of \(G_2\). A graph G is a cograph if G can be generated from \(K_1\) by a sequence of join and union operations. A graph is a cograph if and only if it is \(P_4\)-free (see, for example, [5]).

The following lemma is well known, but we include a short proof for completeness.

Lemma 1

Every connected \(P_4\)-free graph on at least two vertices has a spanning complete bipartite subgraph which can be found in polynomial time.

Proof

Let G be a connected \(P_4\)-free graph on at least two vertices. Then G is the join of two graphs G[X] and G[Y]. Hence, G has a spanning complete bipartite subgraph with partition classes X and Y. Note that this implies that \(\overline{G}\) is disconnected. In order to find a (not necessarily unique) spanning complete bipartite subgraph of G with partition classes X and Y in polynomial time, we put the vertices of one connected component of \(\overline{G}\) in X and all the other vertices of \(\overline{G}\) in Y. \(\square \)

Grzesik et al. [20] gave a polynomial-time algorithm for finding a maximum independent set of a \(P_6\)-free graph in polynomial time. As the complement \(V(G)\setminus I\) of every independent set I of a graph G is a vertex cover, their result implies that Vertex Cover is polynomial-time solvable on \(P_6\)-free graphs. Using the folklore trick mentioned in Remark 3 (see also, for example, [24, 27]) their result can also be formulated as follows.

Theorem 1

[20] For every \(s\ge 0\), Vertex Cover can be solved in polynomial time on \((sP_1+ P_6)\)-free graphs.

We recall also that Connected Vertex Cover is polynomial-time solvable on \((sP_1+ P_5)\)-free graphs [24]. We will need the extension version of this result. Its proof is based on a straightforward adaption of the proof for Connected Vertex Cover on \((sP_1+ P_5)\)-free graphs [24] (see “Appendix” for a proof).

Theorem 2

[24] For every \(s\ge 0\), Connected Vertex Cover Extension can be solved in polynomial time on \((sP_1+ P_5\))-free graphs.

3 The Case H = P4

Recall that Brandstädt and Kratsch [4] proved that Feedback Vertex Set and Odd Cycle Transversal can be solved in polynomial time on permutation graphs, which form a superclass of the class of \(P_4\)-free graphs. Hence, we obtain the following proposition.

Proposition 1

[4] Feedback Vertex Set and Odd Cycle Transversal can be solved in polynomial time on \(P_4\)-free graphs.

In this section, we prove that the (extension versions of the) connected variants of Feedback Vertex Set and Odd Cycle Transversal are also polynomial-time solvable on \(P_4\)-free graphs. We make use of Proposition 1 in the proofs.

Theorem 3

Connected Feedback Vertex Set Extension can be solved in polynomial time on \(P_4\)-free graphs.

Proof

Let \(G=(V,E)\) be a \(P_4\)-free graph on n vertices and let W be a subset of V. By Remark 1, we may assume that G is connected. By Lemma 1, in polynomial time we can find a spanning complete bipartite subgraph \(G'=(X,Y,E')\), and we note that, by definition, every edge in \(G'\) is dominating. Below, in Step 1, in polynomial time we compute a smallest connected feedback vertex set of G that contains W and intersects both X and Y. In Step 2, in polynomial time we compute a smallest connected feedback vertex set of G that contains W and that is a subset of either X or Y (if such a set exists). Then the smallest set found is a smallest connected feedback vertex set of G that contains W.

Step 1

Compute a smallest connected feedback vertex set S of G such that \(W \subseteq S\), \(S\cap X \ne \emptyset \)and \(S\cap Y\ne \emptyset \).

We perform Step 1 as follows. Consider two vertices \(u \in X\) and \(v \in Y\). We shall describe how to find a smallest connected feedback vertex set of G that contains \(W \cup \{u,v\}\). We find a smallest feedback vertex set \(S'\) in \(G-(W\cup \{u,v\})\). As \(G-(W\cup \{u,v\})\) is \(P_4\)-free, this takes polynomial time by Proposition 1. Then \(S' \cup W\cup \{u,v\}\) is a smallest feedback vertex set of G that contains \(W \cup \{u,v\}\) and is connected, since uv is a dominating edge. By repeating this polynomial-time procedure for all \(O(n^2)\) possible choices of u and v, we will find S in polynomial time.

Step 2

Compute a smallest connected feedback vertex set S of G such that \(S \subseteq X\)or \(S \subseteq Y\).

For Step 2 we describe only the \(S \subseteq X\) case, as the \(S\subseteq Y\) case is symmetric. Thus we may assume that \(W \subseteq X\), otherwise no such set exists. Clearly, we may also assume that G[Y] contains no cycles. If G[Y] contains an edge it follows that \(S=X\), otherwise \(G-S\) would contain a triangle. Suppose instead that Y is an independent set. If \(|Y|=1\), then \(X \setminus S\) must be an independent set, otherwise \(G-S\) contains a triangle. So S is a smallest connected vertex cover of G[X] that contains W. As G[X] is \(P_4\)-free, we can find such an S in polynomial time by Theorem 2. If \(|Y|\ge 2\), then \(|X\setminus S|\le 1\), as otherwise \(G-S\) contains a 4-cycle. Thus, we check, in polynomial time, if there exists a vertex \(x\in X\setminus W\), such that \(X\setminus \{x\}\) is connected. If so, \(S= X \setminus \{x\}\). \(\square \)

Theorem 4

Connected Odd Cycle Transversal Extension can be solved in polynomial time on \(P_4\)-free graphs.

Proof

We only provide an outline, as the proof follows that of Theorem 3. We perform the same two steps. In Step 1, we need to find a smallest odd cycle transversal \(S'\) in \(G-(W\cup \{u,v\})\) and can again apply Proposition 1. In Step 2, we again note that if G[Y] contains an edge, then \(S=X\). Suppose that Y is an independent set. Then \(G-S\) contains no odd cycles if and only if \(X \setminus S\) is independent, so S is a smallest connected vertex cover of G[X] that contains W. (That is, the \(|Y|=1\) case from the proof of Theorem 3 can be used for all values of |Y|, as we are no longer concerned with whether \(G-S\) might contain cycles of even length.) \(\square \)

4 The Case H = sP1 + P3

In this section, we will prove that Feedback Vertex Set and Odd Cycle Transversal and their connected variants can be solved in polynomial time on \((sP_1+ P_3)\)-free graphs. We need three structural results. First, let us define a function c on the non-negative integers by \(c(s):=\max \{3,2s-1\}\). We will use this function c throughout the remainder of this section, starting with the following lemma.

Lemma 2

Let \(s \ge 0\)be an integer. Let G be a bipartite \((sP_1+ P_3)\)-free graph. If G has a connected component on at least c(s) vertices, then there are at most \(s-1\)other connected components of G and each of them is on at most two vertices.

Proof

First note that the \(s=0\) case of the lemma is trivially true, as every connected component of a bipartite \(P_3\)-free graph has at most two vertices.

Suppose, for contradiction, that G has a connected component \(C_1\) on at least c(s) vertices and a connected component \(C_2\) on at least three vertices. As \(C_1\) is bipartite and contains at least \(2s-1\) vertices, \(C_1\) contains a independent set of s vertices that induce \(sP_1\). As \(C_2\) is bipartite and contains at least three vertices, \(C_2\) has a vertex v of degree at least 2, and so v and two of its neighbours induce a \(P_3\). Thus G is not \((sP_1+ P_3)\)-free, a contradiction.

Similarly, if G contains a connected component \(C_1\) on at least \(c(s)\ge 3\) vertices, then this component contains an induced \(P_3\). Since G is \((sP_1+ P_3)\)-free, G can contain at most \(s-1\) connected components other than \(C_1\). \(\square \)

The internal vertices and leaves of a tree are the vertices of degree at least 2 and degree 1, respectively.

Lemma 3

Let \(s \ge 0\)be an integer. Let T be an \((sP_1+ P_3)\)-free tree. Then T has at most 4s internal vertices.

Proof

Let U be the set of internal vertices of T. Suppose that \(|U|\ge 4s+1\ge 1\). We will show that this leads to a contradiction. As a path with at least \(4s+ 1\) internal vertices contains an induced \(sP_1+ P_3\), we may assume that T is not a path and so has at least three leaves. Hence \(|V(T)|\ge 4s+4\).

Let X and Y be the two bipartition sets of T, and assume without loss of generality that \(|X|\ge 2s+2\). For \(Z \in \{X,Y\}\), let \(L_Z\) and \(U_Z\) be the leaves and internal vertices of T that belong to Z. If there is a vertex in Y of degree at least 2 that is anti-complete to a set of s vertices of X, then T contains an induced \(sP_1+ P_3\), a contradiction. Therefore we may assume that every vertex of Y either has degree at least \(|X|-s+1\) or is in \(L_Y\). Then

$$\begin{aligned} |X|+|U_Y|+|L_Y|-1= & {} |X|+|Y|-1 \\= & {} |V(T)|-1\\= & {} |E(T)| \\= & {} \sum _{v\in Y} \deg (v)\\\ge & {} \sum _{v\in U_Y} (|X|-s+1)+|L_Y|\\= & {} (|X|-s+1)|U_Y|+|L_Y| \\= & {} |X||U_Y|-s|U_Y|+|U_Y|+|L_Y|. \end{aligned}$$

Thus we have \(|X|-1 \ge |X||U_Y|-s|U_Y|\) and we rearrange to see that

$$\begin{aligned} |U_Y|\le \frac{|X|-1}{|X|-s}=1+\frac{s-1}{|X|-s}. \end{aligned}$$

Since \(|X|\ge 2s+2\), we have that \(|U_Y|<2\). First suppose \(|U_Y|=0\). Then \(|U_X|\le 1\) and \(|L_X|=0\), or \(|U_X|=0\) and \(|L_X|\le 1\). Both cases contradict the assumption that X has at least \(2s+2\) vertices. Now suppose \(|U_Y|=1\). Then, by our assumption that \(|U|\ge 4s+1\), we have that \(|U_X|\ge 4s\) and so \(|L_Y|\ge |U_X|\ge 4s\). Now it is easy to find an induced \(sP_1+ P_3\) (see Fig. 1), and this contradiction completes the proof. \(\square \)

Fig. 1
figure 1

The structure of the tree T in the proof of Lemma 3 in the case when \(|U_Y|=1\). The set \(L_X\) is an independent set of vertices that each are adjacent to the unique vertex \(y\in U_Y\). The set \(L_Y\) is partitioned into independent sets of vertices that have the same neighbour in \(U_X\). The vertices yxz, together with s vertices of \(L_y\) not adjacent to x, induce an \(sP_1+ P_3\) in T (which leads to the desired contradiction in the proof)

The bound of 4s in Lemma 3 is not tight but, as we shall see later, it suffices for our purposes.

Lemma 4

Let \(s \ge 0\)be an integer. Let G be a connected \((sP_1+P_3)\)-free graph, and let U be a set of vertices in G. Then there is a set of vertices R in G such that \(G[R \cup U]\)is connected and \(|R| \le 2s^2-2s+3\).

Proof

If G[U] is connected, then let \(R = \emptyset \). Otherwise, since G cannot now be a complete graph, it contains an induced path P on three vertices in G. The number of connected components of G[U] that do not contain a vertex that is either in P or adjacent to a vertex of P in G is at most \(s-1\), otherwise G contains an induced \(sP_1+ P_3\). Let R contain the vertices of P and the internal vertices of shortest paths in G from P to each set of vertices that induces a connected component of G[U]. As at most \(s-1\) of these shortest paths have more than zero internal vertices, and as each contains at most 2s internal vertices (any longer path contains an induced \(sP_1+ P_3\)), it follows that \(|R| \le 3+2s(s-1)=2s^2-2s+3\). As \(G[R\cup U]\) is connected, the lemma is proved. \(\square \)

We now prove our four results. For the connected variants, we consider the more general extension versions.

Theorem 5

For every \(s\ge 0\), Feedback Vertex Set can be solved in polynomial time on \((sP_1+ P_3)\)-free graphs.

Proof

Let \(s \ge 0\) be an integer, and let \(G=(V,E)\) be an \((sP_1+ P_3)\)-free graph. We must show how to find a smallest feedback vertex set of G. We will in fact show how to find a largest induced forest of G, the complement of a smallest feedback vertex set. The proof is by induction on s. If \(s=0\), then we can use Proposition 1. We now assume that \(s\ge 1\) and that we have a polynomial-time algorithm for finding a largest induced forest in \(((s- 1)P_1+ P_3)\)-free graphs. Our algorithm performs the following two steps in polynomial time. Together, these two steps cover all possibilities.

Step 1

Compute a largest induced forest F such that every connected component of F has at least c(s) vertices.

By Lemma 2 we know that F will be connected, and so by Lemma 3F will be a tree with at most 4s internal vertices. We consider every possible choice U of a non-empty set of at most 4s vertices. There are \(O(n^{4s})\) choices. If U induces a tree, we will find a largest induced tree whose internal vertices all belong to U. This can be found by adding to U the largest possible set of vertices that are independent and belong to the set R of vertices in \(G-U\) that each have exactly one neighbour in U. That is, we need a largest independent set in G[R] and, by Theorem 1, such a set can be found in polynomial time.

Step 2

Compute a largest induced forest F such that F has a connected component with at most \(c(s)-1\)vertices.

We consider every possible choice of a non-empty set T of at most \(c(s)-1\) vertices and discard those that do not induce a tree. There are \(O(n^{c(s)-1})\) choices for T. Let \(U=N(T)\), and let \(G'=G-(T\cup U)\). Then \(G'\) is \(((s- 1)P_1+ P_3)\)-free. Thus we can find a largest induced forest \(F'\) of \(G'\) in polynomial time and \(F' + G[T]\) is a largest induced forest of G among those that have G[T] as a connected component. \(\square \)

Theorem 6

For every \(s\ge 0\), Connected Feedback Vertex Set Extension can be solved in polynomial time on \((sP_1+ P_3)\)-free graphs.

Proof

There are similarities to the proof of Theorem 5, but more arguments are needed. Let \(s \ge 0\) be an integer, let \(G=(V,E)\) be a connected \((sP_1+ P_3)\)-free graph and let W be a subset of V. We must show how to find a smallest connected feedback vertex set of G that contains W in polynomial time. We show how to solve the complementary problem in polynomial time: how to find a largest induced forest F of G that does not include any vertex of W and \(V \setminus F\) is connected. We will say that an induced forest F is good if it has these two properties. \(\square \)

Our algorithm performs the following three steps in polynomial time. Together, these three steps cover all possibilities.

Step 1

Compute a largest good induced forest F such that there is a connected component of F that has at least c(s) vertices.

By Lemma 2 we know that F has exactly one connected component on at least c(s) and there are at most \(s-1\) other connected components of F, each on at most two vertices. By Lemma 3, the connected component on at least c(s) vertices has at most 4s internal vertices. We consider \(O(n^{4s+2(s-1)})\) choices of a non-empty set U of at most 4s vertices that induces a tree and a set \(U'\) of at most \(2(s-1)\) vertices that induces a disjoint union of vertices and edges such that \(U \cup U'\) does not intersect W, U is disjoint from \(U'\) and no vertex of U has a neighbour in \(U'\). Let R be the set of vertices that each have exactly one neighbour in U and no neighbour in \(U'\), but do not belong to W. We then add to \(U\cup U'\) the largest possible set L of vertices that are independent and belong to the set R such that \(G-(L\cup U \cup U')\) is connected. This is achieved by taking the complement of the smallest connected vertex cover of \(G-(U \cup U')\) that contains \(V \setminus (R \cup U \cup U')\). By Theorem 2, this can be done in polynomial time.

Step 2

Compute a largest good induced forest F such that F has at most \(s-1\)connected components and each connected component has at most \(c(s)-1\)vertices.

Since the number of vertices in F is bounded by the constant \((s-1)(c(s)-1)\), we can simply check all sets containing at most that many vertices to see if they induce such a good forest.

Step 3

Compute a largest good induced forest F such that F has at least s connected components and each connected component has at most \(c(s)-1\)vertices.

We consider \(O(n^{s(c(s)-1)})\) choices of a non-empty set L of at most \(s(c(s)-1)\) vertices. We reject L unless G[L] is a good induced forest on s connected components with no connected component of more than \(c(s)-1\) vertices. Assuming our choice of L is correct, the connected components of G[L] will become connected components of G[F].

Let \(U=N(L)\) and note that no vertex of U is in F. If \(G-U\) is a good forest, then we are done. Otherwise we consider every set R of at most \(2s^2-2s+3\) vertices of \(G - (L \cup U \cup W)\) such that \(G[R \cup U \cup W]\) is connected; see also Fig. 2. We note that if there is a largest induced forest F such that the connected components of G[L] are also connected components of G[F], then Lemma 4 applied to \(G-F\) implies that such a set R exists.

Let \(S=R \cup U \cup W\). If \(G-S\) is a forest, then we are done. Otherwise note that \(G-(L \cup S)\) is the disjoint union of one or more complete graphs: \(G-(L \cup S)\) cannot contain an induced \(P_3\), as it is anti-complete to L which contains an induced \(sP_1\).

As G is connected, each of the complete graphs in \(G-(L\cup S)\) contains at least one vertex that is adjacent to some vertex of S. Hence in polynomial time we can find a set \(S'\) of vertices containing all but \(\min \{2,|X|\}\) vertices from each of the complete graphs X in such a way that \(G[S \cup S']\) is connected. Then \(G-(S \cup S')\) is a largest good induced forest that contains L and no vertex of \(R\cup U\).

Fig. 2
figure 2

The decomposition of the \((sP_1+ P_3)\)-free graph G, as given in Step 3 of the algorithm from the proof of Theorem 6

After considering each of the \(O(n^{2s^2-2s+3})\) choices for R, in polynomial time we find a largest good induced forest that contains L and no vertex of U. After considering each of the \(O(n^{s(c(s)-1)})\) choices for L, we find in polynomial time a largest good induced forest that has at least s connected components, each with at most \(c(s)-1\) vertices. \(\square \)

Theorem 7

For every \(s\ge 0\), Odd Cycle Transversal can be solved in polynomial time on \((sP_1+ P_3)\)-free graphs.

Proof

Let \(s \ge 0\) be an integer, and let \(G=(V,E)\) be an \((sP_1+ P_3)\)-free graph. We must describe how to find a smallest odd cycle transversal of G. If \(s=0\), then we can use Proposition 1. We now assume that \(s\ge 1\) and use induction. We will in fact describe how to solve the complementary problem and find a largest induced bipartite subgraph of G. The proof is by induction on s and our algorithm performs two steps in polynomial time, which together cover all possibilities.

Step 1

Compute a largest induced bipartite subgraph B such that every connected component of B has at least c(s) vertices.

By Lemma 2, we know that B will be connected. Hence, B has a unique bipartition, which we denote \(\{X,Y\}\). We first find a largest induced bipartite subgraph B that is a star: we consider each vertex x and find a largest induced star centred at x by finding a largest independent set in N(x). This can be done in polynomial time by Theorem 1.

Next, we find a largest induced bipartite subgraph B that is not a star. We consider each of the \(O(n^2)\) choices of edges xy of G and find a largest induced connected bipartite subgraph B such that \(x \in X\) and \(y \in Y\) and neither x nor y has degree 1 in B (since B is not a star, it must contain such a pair of vertices). Note that the number of vertices in X non-adjacent to y is at most \(s-1\), otherwise B induces an \(sP_1+ P_3\). Similarly there are at most \(s-1\) vertices in Y non-adjacent to x. We consider each of the \(O(n^{2s-2})\) possible pairs of disjoint sets \(X'\) and \(Y'\), which are each independent sets of size at most \(s-1\) such that \(X'\cup Y'\) is anti-complete to \(\{x,y\}\). We will find a largest induced bipartite subgraph with partition classes X and Y such that \(\{x\} \cup X' \subseteq X\) and \(\{y\} \cup Y' \subseteq Y\) and every vertex in \(X \setminus X'\) is adjacent to y and every vertex in \(Y \setminus Y'\) is adjacent to x. That is, we must find a largest independent set in both \(N(x) \setminus N(\{y\} \cup Y')\) and \(N(y) \setminus N(\{x\} \cup X')\); see Fig. 3 for an illustration. This can be done in polynomial time, again by applying Theorem 1.

Fig. 3
figure 3

An illustration of Step 1 of the algorithm in the proof of Theorem 7. Full and dotted lines indicate when two sets are complete or anti-complete to each other, respectively. The absence of a full or dotted lines indicates that edges may or may not exist between two sets

Step 2

Compute a largest induced bipartite subgraph B such that B has a connected component with at most \(c(s)-1\)vertices.

We consider each of the \(O(n^{c(s)-1})\) possible choices of a non-empty set L of at most \(c(s)-1\) vertices and discard those that do not induce a bipartite graph. We will find the largest B that has G[L] as a connected component. Let \(U=N(L)\), and let \(G'=G-(L\cup U)\). As \(G'\) is \(((s- 1)P_1+ P_3)\)-free, we can find a largest induced bipartite subgraph \(B'\) of \(G'\) in polynomial time and \(B' + G[L]\) is a largest induced bipartite subgraph among those that have G[L] as a connected component. \(\square \)

Theorem 8

For every \(s\ge 0\), Connected Odd Cycle Transversal Extension can be solved in polynomial time on \((sP_1+ P_3)\)-free graphs.

Proof

Let \(s \ge 0\) be an integer, let \(G=(V,E)\) be a connected \((sP_1+ P_3)\)-free graph and let W be a subset of V. We must describe how to find a smallest connected odd cycle transversal of G that contains W. We will solve the complementary problem: how to find a largest induced bipartite graph of G that does not include any vertex of W and whose complement is connected. We will say that an induced bipartite graph B is good if it has these two properties. Our algorithm consists of three steps, which can each be performed in polynomial time and which together cover all the possible cases.

Step 1

Compute a largest good induced bipartite subgraph B such that B has a bipartition \(\{X,Y\}\)in which one set, say X, has size \(|X| \le s\). (Note that this includes the case when every connected component of B has at most two vertices and B has at most s connected components.)

We consider \(O(n^s)\) choices of an independent set X of at most s vertices of G that does not intersect W. We wish to find Y, the largest possible independent set in \(G - (W \cup X)\) such that \(G-(X \cup Y)\) is connected. By Theorem 2, we can do this in polynomial time by computing a minimum connected vertex cover of \(G-X\) that contains W and taking its complement (in \(G-X\)).

Step 2

Compute a largest good induced bipartite subgraph B such that B has at least s connected components and each connected component has at most two vertices.

Note that \(2 \le c(s)-1\). The algorithm mimics Step 3 of the algorithm in the proof of Theorem 6, but checks for a good bipartite graph instead of a good forest.

Step 3

Compute a largest good induced bipartite subgraph B such that there is a connected component of B that has at least three vertices and B has a bipartition \(\{X,Y\}\)with \(|X| \ge s+1\)and \(|Y|\ge s+1\).

It is in this case that we must do most of the work in proving the theorem, and here we will need ideas beyond those already met in this section.

As B contains a connected component on at least three vertices, it will contain an induced \(P_3\) and so \(|X| \ge 1\) and \(|Y| \ge 1\). We consider \(O(n^{2s+2})\) choices of disjoint independent sets \(X'\) and \(Y'\) that each contain \(s+1\) vertices of G and do not intersect W. If \(G[X' \cup Y']\) contains an induced \(P_3\), our aim is to compute a largest good induced bipartite graph B with bipartition \(\{X,Y\}\) such that \(X'\subseteq X\) and \(Y' \subseteq Y\); otherwise we discard the choice of \(X',Y'\).

We define (see also Fig. 4) a partition of \(V \setminus (X' \cup Y')\):

$$\begin{aligned} U= & {} (N(X')\cap N(Y')) \cup W \\ V_X= & {} N(X') \setminus (Y' \cup N(Y')\cup W) \\ V_{Y}= & {} N(Y') \setminus (X' \cup N(X')\cup W) \\ Z= & {} V \setminus (X' \cup Y' \cup N(X') \cup N(Y')\cup W) \end{aligned}$$

There are a number of steps where our procedure branches as we consider all possible ways of choosing whether or not to add certain vertices to B. Note that assuming our choice of \(X'\) and \(Y'\) is correct, no vertex of U can be in B. If we decide that a vertex will not be in B, we will then add it to U.

Fig. 4
figure 4

The decomposition of G in Step 3. Full and dotted lines indicate when two sets are complete or anti-complete to each other, respectively. The absence of a full or dotted line indicates that edges may or may not exist between two sets. The circles in \(V_X\) and \(V_Y\) represent disjoint unions of complete graphs

Step 3.1.

Reduce Z to the empty set.

Notice that Z does not contain an independent set on more than \(s-1\) vertices otherwise \(G[X' \cup Y' \cup Z]\) would contain an induced \(sP_1+ P_3\). We consider \(O(n^{2s-2})\) choices of disjoint independent sets \(Z_X\) and \(Z_Y\) that are each subsets of Z and each contain at most \(s-1\) vertices. We move the vertices of \(Z_X\) and \(Z_Y\) by adding them to \(X'\) and \(Y'\), respectively. We move the vertices of \(Z \setminus (Z_X \cup Z_Y)\) by adding them to U. If after this process is complete there are vertices in \(V_X \cup V_Y\) with neighbours in both \(X'\) and \(Y'\), we move these vertices by adding them to U. We note that now:

  • Z is the empty set,

  • \(V_X\) still contains vertices with neighbours in \(X'\) but not in \(Y'\),

  • \(V_Y\) still contains vertices with neighbours in \(Y'\) but not in \(X'\), and

  • U contains vertices that will not be in B.

So our task is to decide how best to add vertices of \(V_X\) to \(Y'\) and vertices of \(V_Y\) to \(X'\), but first there is another step: as \(G-B\) must be connected, and G[U] is a subgraph of \(G-B\), we choose some vertices that will not be in B, but will connect together the connected components of G[U]. This will not be possible if the vertices of U belong to more than one connected component of \(G-(X' \cup Y')\). Hence, in that case we discard this choice of \(Z_X,Z_Y\).

Step 3.2.

Make G[U] connected.

We consider \(O(n^{2s^2-2s+3})\) choices of sets R of vertices of \(G-(X' \cup Y')\) such that each contains at most \(2s^2-2s+3\) vertices. If \(G[R \cup U]\) is connected, we move the vertices of R by adding them to U, and so G[U] becomes connected. Note that since all vertices of U are in the same connected component of \(G-(X' \cup Y')\), Lemma 4 implies that at least one such set R can be found.

Step 3.3.

Add vertices from \(V_X\)to \(Y'\)and from \(V_Y\)to \(X'\).

We note that \(G[V_X]\) is \(P_3\)-free, as no vertex of \(V_X\) has a neighbour in \(Y'\), \(|Y'|\ge s\), and G is \((sP_1+ P_3)\)-free. By symmetry, \(G[V_Y]\) is \(P_3\)-free. Thus both \(G[V_X]\) and \(G[V_Y]\) are disjoint unions of complete graphs. Note that B can contain at most one vertex from each of these complete graphs. We consider two subcases.

Step 3.3.a.

Compute a largest good induced bipartite subgraph B with bipartition \(\{X,Y\}\)such that \(X' \subseteq X\), \(Y' \subseteq Y\)and \(G-B\)contains no edges between \(V_X\)and \(V_Y\).

As \(G-B\) must be connected, each clique of \(V_X\) and \(V_Y\) that contains at least two vertices must contain a vertex adjacent to U (otherwise such a set B cannot exist). Thus we can form X from \(X'\) by adding to \(X'\) one vertex from each clique of \(V_Y\) and form Y by adding to \(Y'\) one vertex from each clique of \(V_X\) in such a way that \(G-B\) is connected. (If we do this, it is possible that \(G-B\) will contain an edge from \(V_X\) to \(V_Y\), but then this solution is at least as large as one where such edges are avoided.)

Step 3.3.b.

Compute a largest good induced bipartite subgraph B with bipartition \(\{X,Y\}\)such that \(X' \subseteq X\), \(Y' \subseteq Y\)and \(G-B\)has an edge xy where \(x \in V_X\), \(y \in V_Y\).

We consider \(O(n^2)\) choices of an edge xy, \(x \in V_X\), \(y \in V_Y\). Let \(v_X \in X'\) be a neighbour of x and note that \(v_X\), x and y induce a \(P_3\) in G. Therefore x must be complete to all but at most \(s-1\) cliques of \(V_Y\). By symmetry, y must be complete to all but at most \(s-1\) cliques of \(V_X\). A clique in \(V_X\) or \(V_Y\) is bad if it is not complete to y or x, respectively. Note that the cliques containing x and y may be bad. We move x and y to U.

We consider \(O(n^{2s-2})\) choices of a set S of at most \(2s-2\) vertices that each belong to a distinct bad clique and move each to \(X'\) or \(Y'\) if they are in \(V_Y\) or \(V_X\) respectively. We move the other vertices of the bad cliques to U. If the vertices of U are not in the same connected component of \(G-(X' \cup Y')\), we discard this choice of S. We consider \(O(n^{2s^2-2s+3})\) choices of sets \(R'\) of vertices of \(G-(X' \cup Y')\) such that each contains at most \(2s^2-2s+3\) vertices. If \(G[R' \cup U]\) is connected we move the vertices of \(R'\) to U, so G[U] becomes connected. Since the vertices of U are in the same connected component of \(G-(X' \cup Y')\), Lemma 4 implies that at least one such set \(R'\) can be found.

Note that some cliques might have been completely removed from \(V_X\) and \(V_Y\) by the choice of \(R'\). It only remains to pick one vertex from each remaining clique of \(V_X\) and \(V_Y\), and add these vertices to \(Y'\) or \(X'\), respectively to finally obtain B. As all vertices in these cliques are adjacent to x or y we know that \(G-B\) will be connected. \(\square \)

5 The Case H = P6

In this section we prove that Odd Cycle Transversal and Connected Odd Cycle Transversal are NP-hard on \((P_2+ P_5,P_6)\)-free graphs. We do this by modifying the construction used in [29] for proving that these two problems are NP-complete on \(P_{13}\)-free segment graphs.

Theorem 9

Odd Cycle Transversal and Connected Odd Cycle Transversal are NP-complete on \((P_2+ P_5,P_6)\)-free graphs.

Proof

Both problems are readily seen to belong to NP. To prove NP-hardness we reduce from Vertex Cover, which is known to be NP-complete [16]. Let (Gk) be an instance of Vertex Cover. Let n and m be the number of vertices and edges, respectively, in G. Let \(v_1,\ldots ,v_n\) be the vertices of G. We construct a graph \(G^*\) from G as follows.

  1. 1.

    For \(i \in \{1,\ldots ,n\}\) create vertices \(a_i,b_i,c_i,x_i\) and \(y_i\). Let ABCX and Y be the sets of, respectively, \(a_i\), \(b_i\), \(c_i\), \(x_i\) and \(y_i\) vertices.

  2. 2.

    For \(i,j \in \{1,\ldots ,n\}\), add the edges \(x_iy_j\) and \(b_iy_j\) (so we make Y complete to both X and B).

  3. 3.

    For each \(i \in \{1,\ldots ,n\}\), add edges \(x_ia_i,x_ib_i,a_ib_i,b_ic_i,c_iy_i\) (a vertex gadget, see also Fig. 5a and note that \(b_i\) is adjacent to \(y_i\) by the previous step).

  4. 4.

    For each edge \(v_iv_j\) in G with \(i<j\), add a vertex \(d_{i,j}\) adjacent to both \(x_i\) and \(y_j\) (an edge gadget, see also Fig. 5b). Let D be the set of \(d_{i,j}\) vertices.

Fig. 5
figure 5

The two gadgets used in the proof of Theorem 9

We first claim that the following statements are equivalent:

  1. (i)

    G has a vertex cover of size at most k;

  2. (ii)

    \(G^*\) has an odd cycle transversal of size at most \(n+ k\);

  3. (iii)

    \(G^*\) has a connected odd cycle transversal of size at most \(n+ k\).

The implication (iii) \(\Rightarrow \) (ii) is trivial. Below we prove (i) \(\Rightarrow \) (iii) and (ii) \(\Rightarrow \) (i).

(i) \(\Rightarrow \) (iii). Suppose that G has a vertex cover Q of size at most k. We define the set

$$\begin{aligned} S = \bigcup _{v_i \in Q} \{x_i,y_i\} \cup \bigcup _{v_i \notin Q} \{b_i\} \end{aligned}$$

and observe that \(|S|=2|Q|+(n-|Q|)=n+|Q| \le n+k\) and that S is connected. We claim that S is an odd cycle transversal of \(G^*\). This can be seen as follows. The only induced odd cycles in \(G^*\) are the three triangles in each vertex gadget and the triangle in each edge gadget. By construction of S, for every \(i\in \{1,\ldots ,n\}\), either S contains both \(x_i\) and \(y_i\) or S contains \(b_i\), thus every triangle in every vertex gadget intersects S. Furthermore, since Q is a vertex cover of G, for every edge gadget \(\{x_i,y_j,d_{i,j}\}\), either \(x_i \in S\) or \(y_j \in S\). Therefore S intersects every odd cycle in \(G^*\).

(ii) \(\Rightarrow \) (i). Suppose that \(G^*\) has an odd cycle transversal S of size at most \(n+k\). Consider an edge gadget on \(\{x_i,y_j,d_{i,j}\}\). If \(d_{i,j} \in S\) then \(S':=(S \setminus \{d_{i,j}\}) \cup \{x_i\}\) is an odd cycle transversal of G with \(|S'| \le |S|\). We may therefore assume that S contains no vertices of D. For \(i \in \{1,\ldots ,n\}\), the vertex \(b_i\) intersects all odd cycles in the vertex gadget on \(\{a_i,b_i,c_i,x_i,y_i\}\). If \(b_i \notin S\) then \(|S \cap \{a_i,b_i,c_i,x_i,y_i\}| \ge 2\) since S intersects all induced odd cycles of the vertex gadget. Note that \(\{x_i,y_i\}\) intersects all odd cycles of the vertex gadget. Therefore, if \(|S \cap \{a_i,b_i,c_i,x_i,y_i\}| \ge 2\), then \(S':=(S \setminus \{a_i,b_i,c_i\}) \cup \{x_i,y_i\}\) is an odd cycle transversal of \(G^*\) with \(|S'| \le |S|\). We may therefore assume that for every \(i \in \{1,\ldots ,n\}\), either \(b_i \in S\) or \(\{x_i,y_i\} \subseteq S\) and there are no other vertices in S. Let \(B_S=B\cap S\), \(X_S=S\cap X\) and \(Y_S= S\cap Y\). Then \(|S|=|B_S|+|S_X|+|S_Y|=n+|S_X|\). Let \(Q=\bigcup _{x_i \in S}\{v_i\}\). Then \(|Q|=|S_X|=|S|-n\le n+k-n = k\).

We claim that Q is a vertex cover of G. This can be seen as follows. Consider an edge \(v_iv_j\) of G (without loss of generality assume \(i<j\)). Then \(|\{x_i,y_j,d_{i,j}\} \cap S| \ge 1\), as S is an odd cycle transversal of \(G^*\). By assumption on S, \(d_{i,j} \notin S\) and if \(y_j \in S\) then \(x_j \in S\). It follows that \(x_i \in S\) or \(x_j \in S\) and so \(v_i \in Q\) or \(v_j \in Q\). We conclude that Q is a vertex cover of G of size at most k.

It only remains to show that \(G^*\) is \((P_2+ P_5,P_6)\)-free. Suppose, for contradiction, that \(H \in \{P_2+ P_5,P_6\}\) is an induced subgraph of \(G^*\). Every vertex in \(A \cup C \cup D\) has degree 2 and its two neighbours are adjacent. Therefore no vertex in \(V(H) \cap (A \cup C \cup D)\) is an internal vertex of a path of H. That is, if \(x \in V(H) \cap (A \cup C \cup D)\) then x has degree 1 in H. Furthermore, \(A \cup C \cup D\) is an independent set in \(G^*\). Hence, if \(H=P_2+ P_5\), then at most one vertex of the \(P_2\) connected component of H can be in \(A \cup C \cup D\). We conclude that \(G^*[V(H) \cap (B \cup X \cup Y)]\) contains an induced subgraph \(H'\) on four vertices that is isomorphic to \(P_1+ P_3\) if \(H=P_2+P_5\) or \(P_4\) if \(H=P_6\). Since Y is an independent set and \(B \cup X\) is a perfect matching, \(H'\) must contain at least one vertex of \(B \cup X\) and at least one vertex of Y. As Y is complete to \(B \cup X\), we find that \(H'\) contains either \(C_4\) or \(K_{1,3}\) as a (not necessarily induced) subgraph, a contradiction. This completes the proof. \(\square \)

The proof of Theorem 9 gives a slightly stronger result if we assume the Exponential Time Hypothesis (ETH). The ETH is one of standard assumptions in complexity theory which, along with the sparsification lemma, implies that 3-Sat with n variables and m clauses cannot be solved in \(2^{o(n+m)}\) time [22, 23]. The number of vertices in the graph \(G^*\) constructed in the proof of Theorem 9 is \(5n+ m\). Thus an algorithm solving (Connected) Odd Cycle Transversal on \((P_2+ P_5,P_6)\)-free graphs with n vertices in time \(2^{o(n)}\) could be used to solve Vertex Cover on graphs with n vertices and m edges in \(2^{o(n+m)}\) time. However, such a fast algorithm for Vertex Cover does not exist unless the ETH fails [11]. Thus we get the following statement.

Corollary 1

Odd Cycle Transversal and Connected Odd Cycle Transversal cannot be solved in \(2^{o(n)}\)time on \((P_2+ P_5,P_6)\)-free graphs with n vertices, unless the ETH fails.

6 Conclusions

We proved polynomial-time solvability of Feedback Vertex Set and Odd Cycle Transversal on H-free graphs when \(H=sP_1+ P_3\) and polynomial-time solvability of their connected variants on H-free graphs, when \(H=P_4\) or \(H=sP_1+ P_3\); see also Table 1, where we place these results in the context of known results for these problems on H-free graphs. We also showed that Odd Cycle Transversal and Connected Odd Cycle Transversal are NP-complete on \((P_2+ P_5,P_6)\)-free graphs.

Natural cases for future work are the cases when \(H=sP_1+ P_4\) for \(s\ge 1\) and \(H=P_5\) for all four problems (in particular the case when \(H=P_5\) is the only open case for Odd Cycle Transversal and Connected Odd Cycle Transversal restricted to \(P_r\)-free graphs). Note that Lemma 2 does not hold on \((sP_1+ P_4)\)-free graphs: the disjoint union of any number of arbitrarily large stars is even \(P_4\)-free.

Recall that Vertex Cover and Connected Vertex Cover are polynomial-time solvable even on \((sP_1+ P_6)\)-free graphs [20] and \((sP_1+ P_5)\)-free graphs [24], respectively, for every \(s\ge 0\). In contrast to the case for Odd Cycle Transversal and Connected Odd Cycle Transversal, it is not known whether there is an integer r for which any of the problems Vertex Cover, Feedback Vertex Set or their connected variants is NP-complete on \(P_r\)-free graphs. Determining whether such an r exists is an interesting open problem.

We note that a similar complexity study has also been undertaken for the independent variants of the problems Feedback Vertex Set and Odd Cycle Transversal.Footnote 3 In particular, Independent Feedback Vertex Set and Independent Odd Cycle Transversal are polynomial-time solvable on \(P_5\)-free graphs [3], but their complexity status is unknown on \(P_6\)-free graphs. It is not known whether there is an integer r such that Independent Feedback Vertex Set or Independent Odd Cycle Transversal is NP-complete on \(P_r\)-free graphs.

We conclude that in order to make any further progress, we must better understand the structure of \(P_r\)-free graphs. This topic has been well studied in recent years, see also for example [17, 19]. However, more research and new approaches will be needed.