## On Cycle Transversals and Their Connected Variants in the Absence of a Small Linear Forest /star

Konrad K. Dabrowski , Carl Feghali , Matthew Johnson , 1 2 1 Giacomo Paesani , Daniël Paulusma , and Paweł Rzążewski 1 1 3

- 1 Department of Computer Science, Durham University, UK

{konrad.dabrowski,matthew.johnson2,giacomo.paesani,daniel.paulusma}@durham.ac.uk

2 Department of Informatics, University of Bergen, Norway carl.feghali@uib.no 3 Faculty of Mathematics and Information Science, Warsaw University of Technology,

Warsaw, Poland p.rzazewski@mini.pw.edu.pl

Abstract. A graph is H -free if it contains no induced subgraph isomorphic to H . We prove new complexity results for the two classical cycle transversal problems Feedback Vertex Set and Odd Cycle Transversal by showing that they can be solved in polynomial time on ( sP 1 + P 3 ) -free graphs for every integer s ≥ 1 . We show the same result for the variants Connected Feedback Vertex Set and Connected Odd Cycle Transversal . We also prove that the latter two problems are polynomial-time solvable on cographs; this was already known for Feedback Vertex Set and Odd Cycle Transversal . We complement these results by proving that Odd Cycle Transversal and Connected Odd Cycle Transversal are NP -complete on ( P 2 + P , P 5 6 ) -free graphs.

## 1 Introduction

Graph transversal problems play a central role in Theoretical Computer Science. To define the notion of a graph transversal, let H be a family of graphs, G = ( V, E ) be a graph and S ⊆ 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 H -transversal of G if G -S is H -free , that is, if G -S contains no induced subgraph isomorphic to a graph of H . In other words, S intersects every induced copy of every graph of 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 H -transversal for, respectively, H = { P 2 } (that is, G -S is edgeless), H = { C , C , . . . 3 4 } (that is, G -S is a forest), or H = { C , C , . . . 3 5 } (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

/star The research in this paper received support from the Leverhulme Trust (RPG-2016258). The last author was supported by Polish National Science Centre grant no. 2018/31/D/ST6/00062. An extended abstract of this paper appeared in the proceedings of FCT 2019 [13].

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 G can be characterized by a (possibly infinite) set F G of forbidden induced subgraphs. If |F G | = 1 , say F = { H } , then G is said to be monogenic , and every graph G ∈ 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 Section 1.1 that we may assume that H is a linear forest. Below we first discuss the known polynomialtime 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 ≥ 1 , Vertex Cover (by combining the results of [1,34]) and Connected Vertex Cover [10] are polynomial-time solvable on sP 2 -free graphs. 4 Moreover, Vertex Cover is also polynomial-time solvable on ( sP 1 + P 6 ) -free graphs, for every s ≥ 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 ≥ 7 and r ≥ 6 , respectively.

Both Feedback Vertex Set and Odd Cycle Transversal are polynomialtime 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 ≥ 5 . For every s ≥ 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]. 5

## 1.3 Our Results

In Section 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 Section 4 we prove that for every s ≥ 1 , these four problems are all polynomial-time solvable on ( sP 1 + P 3 ) -free graphs; see also Table 1. Finally, in Section 5, we show that Odd Cycle Transversal and Connected Odd Cycle Transversal are NP -complete on ( P 2 + P , P 5 6 ) -free graphs, that is, graphs that are both ( P 2 + P 5 ) -free and P 6 -free. 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:

## Connected Vertex Cover Extension

Instance: a graph G = ( V, E ) , a subset W ⊆ V and a positive integer k .

Question: does G have a connected vertex cover S W with W ⊆ S W and

|

S

W

|

≤

k

?

Note that Connected Vertex Cover Extension becomes the original problem if W = ∅ . 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.

4 The graph G + H is the disjoint union of graphs G and H and sG is the disjoint union of s copies of G ; see Section 2.

5 The price of connectivity concept was introduced by Cardinal and Levy [9] for vertex cover; see also, for example, [6,7,8].

|                            | girth   | p    | line graphs   | line graphs   | sP   | 2 -free   | P 4 -free   | sP 1 + P r -free      |
|----------------------------|---------|------|---------------|---------------|------|-----------|-------------|-----------------------|
| Vertex Cover               | NP -c   | [30] | P             | [25,32]       | P    | [1,34]    | P           | P: s ≥ 0 , r = 6 [20] |
| Feedback Vertex Set        | NP -c   | [30] | NP -c         | [33]          | P    | [10]      | P [4]       | P: s ≥ 0 , r = 3 ∗    |
| Odd Cycle Transversal      | NP -c   | [10] | NP -c         | [10]          | P    | [10]      | P [4]       | P: s ≥ 0 , r = 3 ∗    |
| Con. Vertex Cover          | NP -c   | [28] | NP -c         | [28]          | P    | [10]      | P           | P: s ≥ 0 , r = 5 [24] |
| Con. Feedback Vertex Set   | NP -c   | [10] | NP -c         | [10]          | P    | [10]      | P ∗         | P: s ≥ 0 , r = 3 ∗    |
| Con. Odd Cycle Transversal | NP -c   | [10] | NP -c         | [10]          | P    | [10]      | P ∗         | P: s ≥ 0 , r = 3 ∗    |

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 ≥ 3 , on line graphs, and on H -free graphs for various linear forests H . In particular, Feedback Vertex Set can be shown to be NP -complete on graphs of arbitrarily large girth by using Poljak's construction (see [3,26]). We also note that Munro [28] showed that Feedback Vertex Set is NP -complete even on line graphs of planar cubic bipartite graphs. Unreferenced results directly follow from other results in the table, and results marked with ∗ are new results proven in this paper. Our two other new results, namely that Odd Cycle Transversal and Connected Odd Cycle Transversal are NP -complete on ( P 2 + P , P 5 6 ) -free graphs, are not included in the table.

Remark 1. For any connected extension variant of these problems on 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 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 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 ( G,W,k ) 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

/negationslash

/negationslash

Let G = ( V, E ) be a graph. For a set S ⊆ 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 [ \ S ] . A subset D ⊆ V is a dominating set of G if every vertex of V \ 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 G = ( V, { uv | uv ∈ E and u = v } ) . The neighbourhood of a vertex u ∈ V is the set N G ( u ) = { v | uv ∈ E } and for U ⊆ V , we let N G ( U ) = ⋃ u ∈ U N u ( ) \ U . We omit

the subscript when there is no ambiguity. We denote the degree of a vertex u ∈ V by deg( u ) = | N G ( u ) | .

Let G = ( V, E ) be a graph and let S ⊆ 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 ⊆ V with S ∩ T = ∅ . 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 ) ∪ V ( G 2 ) and edge set E G ( 1 ) ∪ 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 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 G in X and all the other vertices of G in Y . /intersectionsq /unionsq

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 ) \ 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 ≥ 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]. 6

Theorem 2 ([24]). For every s ≥ 0 , Connected Vertex Cover Extension can be solved in polynomial time on ( sP 1 + P 5 )-free graphs.

6 See Appendix A, where we include a proof for reviewing purposes.

## 3 The Case H = P 4

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 ⊆ S , S ∩ X = ∅ and S ∩ Y = ∅ .

/negationslash

/negationslash

We perform Step 1 as follows. Consider two vertices u ∈ X and v ∈ Y . We shall describe how to find a smallest connected feedback vertex set of G that contains W ∪{ u, v } . We find a smallest feedback vertex set S ′ in G -( W ∪{ u, v } ) . As G -( W ∪{ u, v } ) is P 4 -free, this takes polynomial time by Proposition 1. Then S ′ ∪ W ∪ { u, v } is a smallest feedback vertex set of G that contains W ∪ { 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 ⊆ X or S ⊆ Y .

For Step 2 we describe only the S ⊆ X case, as the S ⊆ Y case is symmetric. Thus we may assume that W ⊆ 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 \ 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 | ≥ 2 , then | X S \ | ≤ 1 , as otherwise G -S contains a 4 -cycle. Thus, we check, in polynomial time, if there exists a vertex x ∈ X \ W , such that X \ { x } is connected. If so, S = X \ { x } . /intersectionsq /unionsq

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 ∪ { 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 \ 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.) /intersectionsq /unionsq

## 4 The Case H = sP 1 +P 3

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 2 { , s - } 1 . We will use this function c throughout the remainder of this section, starting with the following lemma.

Lemma 2. Let s ≥ 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 2 s -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 ( ) ≥ 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 . /intersectionsq /unionsq

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

Lemma 3. Let s ≥ 0 be an integer. Let T be an ( sP 1 + P 3 ) -free tree. Then T has at most 4 s internal vertices.

Proof. Let U be the set of internal vertices of T . Suppose that | U | ≥ 4 s +1 ≥ 1 . We will show that this leads to a contradiction. As a path with at least 4 s + 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 ) | ≥ 4 s +4 .

Let X and Y be the two bipartition sets of T , and assume without loss of generality that | X | ≥ 2 s +2 . For Z ∈ { 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

$$\text{in } L _ { Y }. \text{ Then } \\ | X | + | U _ { Y } | + | L _ { Y } | - 1 & = | X | + | Y | - 1 \\ & = | V ( T ) | - 1 \\ & = | E ( T ) | \\ & = \sum _ { v \in Y } \deg ( v ) \\ & \geq \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 } |. \\ \shortmid \text{ we have } | X | - 1 \geq | X | | U _ { Y } | - s | U _ { Y } | \text{ and we rearrange to see that }$$

Thus we have | X | -1 ≥ | X U || Y | -s U | Y | and we rearrange to see that

$$| U _ { Y } | \leq \frac { | X | - 1 } { | X | - s } = 1 + \frac { s - 1 } { | X | - s }.$$

Since | X | ≥ 2 s +2 , we have that | U Y | &lt; 2 . First suppose | U Y | = 0 . Then | U X | ≤ 1 and | L X | = 0 , or | U X | = 0 and | L X | ≤ 1 . Both cases contradict the assumption that X has at least 2 s + 2 vertices. Now suppose | U Y | = 1 . Then, by our assumption that | U | ≥ 4 s +1 , we have that | U X | ≥ 4 s and so | L Y | ≥ | U X | ≥ 4 s . Now it is easy to find an induced sP 1 + P 3 (see Fig. 1), and this contradiction completes the proof. /intersectionsq /unionsq

Fig. 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 ∈ U Y . The set L Y is partitioned into independent sets of vertices that have the same neighbour in U X . The vertices y, x, z , together with s vertices of L y not adjacent to x , induced an sP 1 + P 3 in T (which leads to the desired contradiction in the proof).

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00491v1-figure-436aea6b-aead-4311-9fd3-a50f029f55eb.jpg)

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

Lemma 4. Let s ≥ 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 [ ∪ U ] is connected and | R | ≤ 2 s 2 -2 s +3 .

Proof. If G U [ ] is connected, then let R = ∅ . 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 2 s internal vertices (any longer path contains an induced sP 1 + P 3 ), it follows that | R | ≤ 3 + 2 s s ( -1) = 2 s 2 -2 s + 3 . As G R [ ∪ U ] is connected, the lemma is proved. /intersectionsq /unionsq

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

Theorem 5. For every s ≥ 0 , Feedback Vertex Set can be solved in polynomial time on ( sP 1 + P 3 ) -free graphs.

Proof. Let s ≥ 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 ≥ 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 3 F will be a tree with at most 4 s internal vertices. We consider every possible choice U of a non-empty set of at most 4 s vertices. There are O n ( 4 s ) 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 ∪ 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. /intersectionsq /unionsq

Theorem 6. For every s ≥ 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 ≥ 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 \ F is connected. We will say that an induced forest F is good if it has these two properties.

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 4 s internal vertices. We consider O n ( 4 +2( s s -1) ) choices of a non-empty set U of at most 4 s 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 ∪ 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 ∪ U ′ the largest possible set L of vertices that are independent and belong to the set R such that G -( L ∪ U ∪ U ′ ) is connected. This is achieved by taking the complement of the smallest connected vertex cover of G -( U ∪ U ′ ) that contains V \ ( R ∪ U ∪ 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 2 s 2 -2 s +3 vertices of G -( L ∪ U ∪ W ) such that G R [ ∪ U ∪ 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 ∪ U ∪ W . If G -S is a forest, then we are done. Otherwise note that G -( L ∪ S ) is the disjoint union of one or more complete graphs: G -( L ∪ 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 ∪ 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 [ ∪ S ′ ] is connected. Then G -( S ∪ S ′ ) is a largest good induced forest that contains L and no vertex of R ∪ U .

After considering each of the O n ( 2 s 2 -2 +3 s ) 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. /intersectionsq /unionsq

)

Fig. 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.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00491v1-figure-84178a25-7698-4e3b-8fa5-b355911de308.jpg)

Theorem 7. For every s ≥ 0 , Odd Cycle Transversal can be solved in polynomial time on ( sP 1 + P 3 ) -free graphs.

Proof. Let s ≥ 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 ≥ 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 ∈ X and y ∈ 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 ( 2 s -2 ) possible pairs of disjoint sets X ′ and Y ′ , which are each independent sets of size at most s -1 such that X ′ ∪ Y ′ is anti-complete to { x, y } . We will find a largest induced bipartite subgraph with partition classes X and Y such that { x } ∪ X ′ ⊆ X and { y } ∪ Y ′ ⊆ Y and every vertex in X \ X ′ is adjacent to y and every vertex in Y \ Y ′ is adjacent to x . That is, we must find a largest independent

set in both N x ( ) \ N ( { y } ∪ Y ′ ) and N y ( ) \ N ( { x } ∪ X ′ ) ;

see Fig. 3 for an illustration.

This can be done in polynomial time, again by applying Theorem 1.

Fig. 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.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00491v1-figure-6e407f5f-0b37-4019-9143-afb100cd2d4d.jpg)

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 ∪ 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. /intersectionsq /unionsq

Theorem 8. For every s ≥ 0 , Connected Odd Cycle Transversal Extension can be solved in polynomial time on ( sP 1 + P 3 ) -free graphs.

Proof. Let s ≥ 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 | ≤ 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 X ∪ ) such that G -( X ∪ 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 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 | ≥ s +1 and | Y | ≥ 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 | ≥ 1 and | Y | ≥ 1 . We consider O n ( 2 +2 s ) choices of disjoint independent sets X ′ and Y ′ that each contain s +1 vertices of G and do not intersect W . If G X [ ′ ∪ 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 ′ ⊆ X and Y ′ ⊆ Y ; otherwise we discard the choice of X , Y ′ ′ .

We define (see also Fig. 4) a partition of V \ ( X ′ ∪ Y ′ ) :

$$U = ( N ( X ^ { \prime } ) \cap N ( Y ^ { \prime } ) ) \cup W \\ V _ { X } = N ( X ^ { \prime } ) \, \langle \, & ( Y ^ { \prime } \cup N ( Y ^ { \prime } ) \cup W ) \\ V _ { Y } = N ( Y ^ { \prime } ) \, \langle \, & ( X ^ { \prime } \cup N ( X ^ { \prime } ) \cup W ) \\ Z = V \, \langle \, & ( X ^ { \prime } \cup Y ^ { \prime } \cup N ( X ^ { \prime } ) \cup N ( Y ^ { \prime } ) \cup W ) \\ \cdot \quad \, \ell \, \cdot \quad \cdot \quad \cdot \quad \cdot$$

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: 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 lines 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.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00491v1-figure-83c88b5e-e4e7-4f74-aa6d-796554b10207.jpg)

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 [ ′ ∪ Y ′ ∪ Z ] would contain an induced sP 1 + P 3 . We consider O n ( 2 s -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 \ ( Z X ∪ Z Y ) by adding them to U . If after this process is complete there are vertices in V X ∪ 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 ′ ∪ 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 ( 2 s 2 -2 +3 s ) choices of sets R of vertices of G -( X ′ ∪ Y ′ ) such that each contains at most 2 s 2 -2 s +3 vertices. If G R [ ∪ 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 ′ ∪ 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 ′ | ≥ 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.3a. Compute a largest good induced bipartite subgraph B with bipartition { X,Y } such that X ′ ⊆ X Y , ′ ⊆ 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.3b. Compute a largest good induced bipartite subgraph B with bipartition { X,Y } such that X ′ ⊆ X , Y ′ ⊆ Y and G -B has an edge xy where x ∈ V X , y ∈ V Y .

We consider O n ( 2 ) choices of an edge xy , x ∈ V X , y ∈ V Y . Let v X ∈ 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 ( 2 s -2 ) choices of a set S of at most 2 s -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 ′ ∪ Y ′ ) , we discard this choice of S . We consider O n ( 2 s 2 -2 +3 s ) choices of sets R ′ of vertices of G -( X ′ ∪ Y ′ ) such that each contains

at most 2 s 2 -2 s + 3 vertices. If G R [ ′ ∪ 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 ′ ∪ 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. /intersectionsq /unionsq

## 5 The Case H = P 6

In this section we prove that Odd Cycle Transversal and Connected Odd Cycle Transversal are NP -hard on ( P 2 + P , P 5 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 , P 5 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 ( G,k ) be an instance of Vertex Cover . Let n and m be the number of vertices and edges, respectively, in G . Let v , . . . , v 1 n be the vertices of G . We construct a graph G ∗ from G as follows.

- 1. For i ∈ { 1 , . . . , n } create vertices a , b , c , x i i i i and y i . Let A,B,C,X and Y be the sets of, respectively, a i , b i , c i , x i and y i vertices.
- 2. For i, j ∈ { 1 , . . . , n } , add the edges x y i j and b y i j (so we make Y complete to both X and B ).
- 3. For each i ∈ { 1 , . . . , n } , add edges x a , x b , a b , b c , c y i i i i i i i i i i (a vertex gadget , see also Fig. 5(a) and note that b i is adjacent to y i by the previous step).
- 4. For each edge v v i j in G with i &lt; j , add a vertex d i,j adjacent to both x i and y j (an edge gadget , see also Fig. 5(b)). Let D be the set of d i,j vertices.

Fig. 5: The two gadgets used in the proof of Theorem 9.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00491v1-figure-46275395-9af7-4343-a555-4244ae5cb7fb.jpg)

We first claim that the following statements are equivalent:

- (i) G has a vertex cover of size at most k ;
- (ii) G ∗ has an odd cycle transversal of size at most n + k ;
- (iii) G ∗ has a connected odd cycle transversal of size at most n + k .

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

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

$$S = \bigcup _ { v _ { i } \in Q } \{ x _ { i }, y _ { i } \} \cup \bigcup _ { v _ { i } \notin Q } \{ b _ { i } \}$$

and observe that | S | = 2 | Q | +( n -| Q | ) = n + | Q | ≤ 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 ∈ { 1 , . . . , 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 , y i j , d i,j } , either x i ∈ S or y j ∈ S . Therefore S intersects every odd cycle in G ∗ .

(ii) ⇒ (i). Suppose that G ∗ has an odd cycle transversal S of size at most n + k . Consider an edge gadget on { x , y i j , d i,j } . If d i,j ∈ S then S ′ := ( S \{ d i,j } ) ∪{ x i } is an odd cycle transversal of G with | S ′ | ≤ | S | . We may therefore assume that S contains no vertices of D . For i ∈ { 1 , . . . , n } , the vertex b i intersects all odd cycles in the vertex gadget on { a , b , c i i i , x , y i i } . If b i / S ∈ then | S ∩{ a , b , c , x i i i i , y i }| ≥ 2 since S intersects all induced odd cycles of the vertex gadget. Note that { x , y i i } intersects all odd cycles of the vertex gadget. Therefore, if | S ∩{ a , b , c i i i , x , y i i }| ≥ 2 , then S ′ := ( S \ { a , b , c i i i } ) ∪{ x , y i i } is an odd cycle transversal of G ∗ with | S ′ | ≤ | S | . We may therefore assume that for every i ∈ { 1 , . . . , n } , either b i ∈ S or { x , y i i } ⊆ S and there are no other vertices in S . Let B S = B ∩ S , X S = S ∩ X and Y S = S ∩ Y . Then | S | = | B S | + | S X | + | S Y | = n + | S X | . Let Q = ⋃ x i ∈ S { v i } . Then | Q | = | S X | = | S | -n ≤ n + k -n = k .

We claim that Q is a vertex cover of G . This can be seen as follows. Consider an edge v v i j of G (without loss of generality assume i &lt; j ). Then |{ x , y i j , d i,j } ∩ S | ≥ 1 , as S is an odd cycle transversal of G ∗ . By assumption on S , d i,j / S ∈ and if y j ∈ S then x j ∈ S . It follows that x i ∈ S or x j ∈ S and so v i ∈ Q or v j ∈ 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 , P 5 6 ) -free. Suppose, for contradiction, that H ∈ { P 2 + P , P 5 6 } is an induced subgraph of G ∗ . Every vertex in A ∪ C ∪ D has degree 2 and its two neighbours are adjacent. Therefore no vertex in V ( H ) ∩ ( A ∪ C ∪ D ) is an internal vertex of a path of H . That is, if x ∈ V ( H ) ∩ ( A ∪ C ∪ D ) then x has degree 1 in H . Furthermore, A ∪ C ∪ 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 ∪ C ∪ D . We conclude that G V H ∗ [ ( ) ∩ ( B ∪ X ∪ 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 ∪ X is a perfect matching, H ′ must contain at least one vertex of B ∪ X and at least one vertex of Y . As Y is complete to B ∪ 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. /intersectionsq /unionsq

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 5 n + m . Thus an algorithm solving ( Connected ) Odd Cycle Transversal on ( P 2 + P , P 5 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 , P 5 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 , P 5 6 ) -free graphs.

Natural cases for future work are the cases when H = sP 1 + P 4 for s ≥ 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 polynomialtime solvable even on ( sP 1 + P 6 ) -free graphs [20] and ( sP 1 + P 5 ) -free graphs [24], respectively, for every s ≥ 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 . 7 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.

## References

- 1. E. Balas and C. S. Yu. On graphs with polynomially solvable maximum-weight clique problem. Networks , 19(2):247-253, 1989.
- 2. R. Belmonte, P. van 't Hof, M. Kamiński, and D. Paulusma. The price of connectivity for feedback vertex set. Discrete Applied Mathematics , 217:132-143, 2017.
- 3. M. Bonamy, K. K. Dabrowski, C. Feghali, M. Johnson, and D. Paulusma. Independent feedback vertex set for P 5 -free graphs. Algorithmica , 81(4):1342-1369, 2019.
- 4. A. Brandstädt and D. Kratsch. On the restriction of some NP-complete graph problems to permutation graphs. Proc. FCT 1985, LNCS , 199:53-62, 1985.
- 5. A. Brandstädt, V. B. Le, and J. P. Spinrad. Graph Classes: A Survey , volume 3 of SIAM Monographs on Discrete Mathematics and Applications . SIAM, 1999.
- 6. E. Camby. Price of connectivity for the vertex cover problem and the dominating set problem: Conjectures and investigation of critical graphs. Graphs and Combinatorics , 35(1):103-118, 2019.

7 Independent Vertex Cover can be seen as 2 -Colouring , with the additional restriction that one of the colours can be used at most k times. This problem is polynomial-time solvable.

- 7. E. Camby, J. Cardinal, S. Fiorini, and O. Schaudt. The price of connectivity for vertex cover. Discrete Mathematics &amp; Theoretical Computer Science , 16(1):207-224, 2014.
- 8. E. Camby and O. Schaudt. The price of connectivity for dominating set: Upper bounds and complexity. Discrete Applied Mathematics , 177:53-59, 2014.
- 9. J. Cardinal and E. Levy. Connected vertex covers in dense graphs. Theoretical Computer Science , 411(26-28):2581-2590, 2010.
- 10. N. Chiarelli, T. R. Hartinger, M. Johnson, M. Milanič, and D. Paulusma. Minimum connected transversals in graphs: New hardness results and tractable cases using the price of connectivity. Theoretical Computer Science , 705:75-83, 2018.
- 11. M. Cygan, F. V. Fomin, L. Kowalik, D. Lokshtanov, D. Marx, M. Pilipczuk, M. Pilipczuk, and S. Saurabh. Parameterized Algorithms . Springer, 1st edition, 2015.
- 12. B. Escoffier, L. Gourvès, and J. Monnot. Complexity and approximation results for the connected vertex cover problem in graphs and hypergraphs. Journal of Discrete Algorithms , 8(1):36-49, 2010.
- 13. C. Feghali, M. Johnson, G. Paesani, and D. Paulusma. On cycle transversals and their connected variants in the absence of a small linear forest. Proc. FCT 2019, LNCS , 11651:258-273, 2019.
- 14. H. Fernau and D. F. Manlove. Vertex and edge covers with clustering properties: Complexity and algorithms. Journal of Discrete Algorithms , 7(2):149-167, 2009.
- 15. M. R. Garey and D. S. Johnson. The rectilinear Steiner tree problem is NP-complete. SIAM Journal on Applied Mathematics , 32(4):826-834, 1977.
- 16. M. R. Garey, D. S. Johnson, and L. J. Stockmeyer. Some simplified NP-complete graph problems. Theoretical Computer Science , 1(3):237-267, 1976.
- 17. P. A. Golovach, M. Johnson, D. Paulusma, and J. Song. A survey on the computational complexity of colouring graphs with forbidden subgraphs. Journal of Graph Theory , 84(4):331-363, 2017.
- 18. A. Grigoriev and R. Sitters. Connected feedback vertex set in planar graphs. Proc. WG 2009, LNCS , 5911:143-153, 2010.
- 19. C. Groenland, K. Okrasa, P. Rzążewski, A. Scott, P. Seymour, and S. Spirkl. H -colouring P t -free graphs in subexponential time. Discrete Applied Mathematics , in press.
- 20. A. Grzesik, T. Klimošová, M. Pilipczuk, and M. Pilipczuk. Polynomial-time algorithm for maximum weight independent set on P 6 -free graphs. Proc. SODA 2019 , pages 1257-1271, 2019.
- 21. T. R. Hartinger, M. Johnson, M. Milanič, and D. Paulusma. The price of connectivity for cycle transversals. European Journal of Combinatorics , 58:203-224, 2016.
- 22. R. Impagliazzo and R. Paturi. On the complexity of k -SAT. Journal of Computer and System Sciences , 62(2):367-375, 2001.
- 23. R. Impagliazzo, R. Paturi, and F. Zane. Which problems have strongly exponential complexity? Journal of Computer and System Sciences , 63(4):512-530, 2001.
- 24. M. Johnson, G. Paesani, and D. Paulusma. Connected vertex cover for ( sP 1 + P 5 )-free graphs. Algorithmica , in press.
- 25. G. J. Minty. On maximal independent sets of vertices in claw-free graphs. Journal of Combinatorial Theory, Series B , 28(3):284-304, 1980.
- 26. N. Misra, G. Philip, V. Raman, and S. Saurabh. On parameterized independent feedback vertex set. Theoretical Computer Science , 461:65-75, 2012.
- 27. R. Mosca. Stable sets for ( P , K 6 2 3 , ) -free graphs. Discussiones Mathematicae Graph Theory , 32:387-401, 2012.
- 28. A. Munaro. Boundary classes for graph problems involving non-local properties. Theoretical Computer Science , 692:46-71, 2017.
- 29. K. Okrasa and P. Rzążewski. Subexponential algorithms for variants of homomorphism problem in string graphs. Proc. WG 2019, LNCS , 11789, to appear.
- 30. S. Poljak. A note on stable sets and colorings of graphs. Commentationes Mathematicae Universitatis Carolinae , 15:307-309, 1974.
- 31. P. L. K. Priyadarsini and T. Hemalatha. Connected vertex cover in 2-connected planar graph with maximum degree 4 is NP-complete. International Journal of Mathematical, Physical and Engineering Sciences , 2(1):51-54, 2008.
- 32. N. Sbihi. Algorithme de recherche d'un stable de cardinalité maximum dans un graphe sans étoile. Discrete Mathematics , 29(1):53-76, 1980.

- 33. E. Speckenmeyer. Untersuchungen zum Feedback Vertex Set Problem in ungerichteten Graphen . PhD thesis, Universität Paderborn, 1983.
- 34. S. Tsukiyama, M. Ide, H. Ariyoshi, and I. Shirakawa. A new algorithm for generating all the maximal independent sets. SIAM Journal on Computing , 6(3):505-517, 1977.
- 35. S. Ueno, Y. Kajitani, and S. Gotoh. On the nonseparating independent set problem and feedback set problem for graphs with no vertex degree exceeding three. Discrete Mathematics , 72(1-3):355-360, 1988.
- 36. T. Watanabe, S. Kajita, and K. Onaga. Vertex covers and connected vertex covers in 3-connected graphs. Proc. IEEE International Sympoisum on Circuits and Systems 1991 , 2:1017-1020, 1991.

## A The Proof of Theorem 2

This appendix is for reviewing purposes only. We will adapt, in a straightforward way, the proof from [24] for showing that Connected Vertex Cover is polynomialtime solvable on ( sP 1 + P 5 ) -free graphs for every s ≥ 1 .

We need the following definitions and lemmas. Let G = ( V, E ) be a graph. The contraction of an edge uv ∈ E deletes the vertices u and v and replaces them by a new vertex made adjacent to precisely those vertices that were adjacent to u or v in G (without introducing self-loops or multiple edges). Recall that a linear forest is the disjoint union of one or more paths. The following lemma is a straightforward observation.

Lemma 5. Let H be a linear forest and let G be a connected H -free graph. Then the graph obtained from G after contracting an edge is also connected and H -free.

We need the following lemmas given in [24].

Lemma 6 ([24]). Let s ≥ 0 and let G be a connected ( sP 1 + P 5 ) -free graph. Then G has a connected dominating set D that is either a clique or has size at most 2 s 2 + +3 s . Moreover, D can be found in O n ( 2 s 2 + +3 s ) time.

Lemma 7 ([24]). Let J be an independent set in a connected graph G such that J has a vertex y that is adjacent to every vertex of G -J . Let J ′ consist of those vertices of J \ { y } that have two adjacent neighbours in G -J (or equivalently, in G ). Then a subset S of the vertex set of G is a connected vertex cover of G that contains J if and only if S \ J ′ is a connected vertex cover of G -J ′ that contains J \ J ′ .

We also need an auxiliary problem defined in [24]. Let G be a connected graph, let J ⊆ V G be a subset of the vertex set of G and let y be a vertex of J . We call say that a triple ( G,J,y ) is cover-complete if it has the following three properties:

- (a) J is an independent set;
- (b) y is adjacent to every vertex of G -J ;
- (c) the neighbours of each vertex in J \ { y } form an independent set in G -J .

This leads to the following optimization problem:

Connected Vertex Cover Completion

Instance: a cover-complete triple ( G,J,y ) .

Question: find a smallest connected vertex cover S of G such that J ⊆ S .

We also need the following two lemmas.

Lemma 8 ([24]). Let ( G, { y } , y ) be a cover-complete triple, where G is an ( sP 1 + P 5 ) -free graph for some s ≥ 0 . Then it is possible to compute a smallest connected vertex cover of G that contains y in O n ( s +14 ) time.

Lemma 9 ([24]). For every s ≥ 0 , Connected Vertex Cover Completion can be solved in O n ( 2 +19 s ) time for cover-complete triples ( G,J,y ) , where G is an ( sP 1 + P 5 ) -free graph.

We are now ready to prove Theorem 2, which we restate below. The proof mimics the proof of [24] and as mentioned at the start of this section, we include it only for reviewing purposes.

Theorem 2 (restated). For every s ≥ 0 , Connected Vertex Cover Extension can be solved in polynomial time on ( sP 1 + P 5 ) -free graphs.

Proof. Let G be an ( sP 1 + P 5 ) -free graph on n vertices for some s ≥ 0 and let W ⊆ V ( G ) be a subset of vertices of G . We may assume without loss of generality that G is connected. By Lemma 6 we can first compute in O n ( 2 s 2 + +3 s ) time a connected dominating set D that either has size at most 2 s 2 + s +3 or is a clique. We note that, if D is a clique, any vertex cover of G contains all but at most one vertex of D . This leads to a case analysis where we guess the subset D ∗ ⊆ D \ W of vertices not in a smallest connected vertex cover of G that contains W . That is, we choose a set of at most one vertex if D is a clique and a set of at most | D \ W | vertices otherwise, and eventually look at all such sets. As | D \ W | ≤ | D | ≤ 2 s 2 + s +3 if D is not a clique, the number of guesses is O n ( 2 s 2 + +3 s ) . For each guess of D ∗ , we compute a smallest connected vertex cover S D ∗ that contains all vertices of ( D \ D ∗ ) ∪ W and no vertex of D ∗ . Then, at the end, we return one that has minimum size overall. In particular we note that, since D is a connected dominating set of G D , ∪ W is also a connected dominating set of G .

Let D ∗ be a guess. Before we start our case analysis we first prove the following claim.

Claim 1. We may assume, at the expense of an O n ( 16 s 3 +4 ) factor in the running time, that D \ D ∗ is connected.

We prove Claim 1 as follows. Suppose D D \ ∗ is not connected. Recall that G D [ ] is either a complete graph or has size at most 2 s 2 + +3 s . In the first case, G D D [ \ ∗ ] is connected. Hence, the second case applies so D has size at most 2 s 2 + s + 3 . Let v ∈ D \ D ∗ . As G is ( sP 1 + P 5 ) -free, G is also P 5+2 s -free. Hence, for each u ∈ D \ ( D ∗ ∪ { v } ) , every connected vertex cover of G contains a path of at most 5 + 2 s -1 vertices that connects u to v . We will guess all these u -v -paths (using only vertices from G -D ∗ ) and add their vertices to D . As the number of paths is at most 2 s 2 + s + 2 , this branching adds an O n ( (5+2 s -3)(2 s 2 + +2) s ) = O n ( 16 s 3 +4 ) factor to our running time and increases our set D by at most 24 s 3 extra vertices. We have proven Claim 1.

We distinguish two cases.

## Case 1. D ∗ = ∅ .

We compute a minimum vertex cover S ′ of G -( D ∪ W ) in polynomial time by Theorem 1. To be more precise, this takes O n ( s +14 ) time by using the same arguments as in the proof of Lemma 8 (see [24]). Clearly S ′ ∪ D ∪ W is a vertex cover of G . As D is a connected dominating set, S ′ ∪ D ∪ W is even a connected vertex cover of G . Let S ∅ = S ′ ∪ D ∪ W . As S ′ is a minimum vertex cover of G -( D ∪ W ) , S ∅ is a smallest connected vertex cover of G that contains all vertices of D ∪ W . We remember S ∅ . Note that S ∅ is found in O n ( s +14 ) time.

## Case 2. 1 ≤ | D ∗ | ≤ | D | (recall that | D | ≤ 2 s 2 + s +3 ).

Recall that we are looking for a smallest connected vertex cover of G that contains every vertex of ( D \ D ∗ ) ∪ W , but does not contain any vertex of D ∗ . Hence D ∗ must be an independent set, disjoint from W , and G -D ∗ must be connected (if one of

these conditions is false, then we stop considering the guess D ∗ ). Moreover, a vertex cover that contains no vertex of D ∗ must contain all vertices of N G ( D ∗ ) . Hence we can safely contract not only any edge between two vertices of ( D \ D ∗ ) ∪ W , but also any edge between two vertices in N G ( D ∗ ) or between a vertex of ( D \ D ∗ ) ∪ W and a vertex in N G ( D ∗ ) . We perform edge contractions recursively and as long as possible while remembering all the edges that we contract. This takes O n ( ) time. Let G ∗ be the resulting graph.

Note that the set D ∗ still exists in G ∗ , as we did not contract any edges with an endpoint in D ∗ . By Claim 1, the set D \ D ∗ in G corresponds to exactly one vertex of G ∗ . We denote this vertex by y . The set W of G corresponds to an independent set of G ∗ . We denote this set by W ∗ . We observe the following equivalence, which is obtained after uncontracting all the contracted edges.

Claim 2. Every smallest connected vertex cover of G ∗ that contains { y }∪ W ∗ and that does not contain any vertex of D ∗ corresponds to a smallest connected vertex cover of G that contains ( D \ D ∗ ) ∪ W and that does not contain any vertex of D ∗ , and vice versa.

As we obtained G ∗ in O n ( ) time, and we can also uncontract all contracted edges in O n ( ) time, Claim 2 tells us that we may consider G ∗ instead of G . As G is connected and ( sP 1 + P 5 ) -free, G ∗ is also connected and ( sP 1 + P 5 ) -free by Lemma 5.

We write J ∗ = N G ∗ ( D ∗ ) ∪ W ∗ and note that y belongs to N G ∗ ( D ∗ ) ⊆ J ∗ as D is connected in G . We now consider the graph G ∗ -D ∗ . As G -D ∗ is connected, G ∗ -D ∗ is connected. By Claim 2, our new goal is to find a smallest connected vertex cover of G ∗ -D ∗ that contains J ∗ . By our procedure, J ∗ is an independent set of G ∗ -D ∗ . As D dominates G , we find that D \ D ∗ dominates every vertex of G -D ∗ that is not adjacent to a vertex of D ∗ . Hence the vertex y , which corresponds to the set D \ D ∗ , is adjacent to every vertex of ( G ∗ -D ∗ ) -J ∗ in the graph G ∗ -D ∗ .

Let J ⊆ J ∗ consist of y and those vertices in J ∗ whose neighbourhood in G ∗ -D ∗ is an independent set. As y is adjacent to every vertex of ( G ∗ -D ∗ ) -J ∗ in G ∗ -D ∗ , and we can remember the set J ∗ \ J , we can apply Lemma 7 and remove J ∗ \ J . That is, it suffices to find a smallest connected vertex cover of the graph G ′ = ( G ∗ -D ∗ ) -( J ∗ \ J ) that contains J .

As J ∗ is an independent set of G ∗ -D ∗ , we find that J is an independent set of G ′ . By definition, y ∈ J . As y is adjacent to every vertex of ( G ∗ -D ∗ ) -J ∗ in G ∗ -D ∗ , we find that y is adjacent to every vertex in G ′ -J . By definition, the neighbours of each vertex in J \ { y } form an independent set in G ′ -J . Hence the triple ( G , J, y ′ ) is cover-complete. This means that we can apply Lemma 9 to find in O n ( 2 +19 s ) time a smallest connected vertex cover S ′ of G ′ that contains J .

We translate S ′ in constant time into a smallest connected vertex cover S ∗ of G ∗ -D ∗ that contains J ∗ by adding J ∗ \ J to S ′ . We translate S ∗ in O n ( ) time into a smallest connected vertex cover S D ∗ of G that contains ( D \ D ∗ ) ∪ W but no vertex of D ∗ by uncontracting any contracted edges. It takes O n ( 2 +19 s ) time to find the set S D ∗ .

As mentioned, at the end we pick a smallest set of the sets S D ∗ . This set is then a smallest connected vertex cover of G that contains W . As there are O n ( 2 s 2 + +3 s · n 16 s 3 +4 ) such sets, each of which is found in O n ( 2 +19 s ) time, the total running time is O n ( 21 s 3 +26 ) . The correctness of our algorithm follows immediately from the above case analysis and the description of the cases. /intersectionsq /unionsq

Note that the algorithm given in Theorem 2 not only solves the decision problem, but also finds a minimum connected vertex cover of a given ( sP 1 + P 5 ) -free graph in polynomial time.
Konrad K. Dabrowski Carl Feghali Matthew Johnson Giacomo Paesani Daniël Paulusma Paweł Rzążewski
On Cycle Transversals and Their Connected Variants in the Absence of a Small Linear Forest
A graph is $H$-free if it contains no induced subgraph isomorphic to $H$. We
prove new complexity results for the two classical cycle transversal problems
Feedback Vertex Set and Odd Cycle Transversal by showing that they can be
solved in polynomial time on $(sP_1+P_3)$-free graphs for every integer $s\geq
1$. We show the same result for the variants Connected Feedback Vertex Set and
Connected Odd Cycle Transversal. We also prove that the latter two problems are
polynomial-time solvable on cographs; this was already known for Feedback
Vertex Set and Odd Cycle Transversal. We complement these results by proving
that Odd Cycle Transversal and Connected Odd Cycle Transversal are NP-complete
on $(P_2+P_5,P_6)$-free graphs.