Computing Weighted Subset Transversals in H -Free Graphs
CComputing Weighted Subset Transversals in H -Free Graphs Nick Brettell
School of Mathematics and Statistics, Victoria University of Wellington, New [email protected]
Matthew Johnson
Department of Computer Science, Durham University, [email protected]
Daniël Paulusma
Department of Computer Science, Durham University, [email protected]
Abstract
For the
Odd Cycle Transversal problem, the task is to find a small set S of vertices in a graphthat intersects every cycle of odd length. The generalization Subset Odd Cycle Transversal requires that S only intersects those odd cycles that include a vertex of a distinguished subset T of the vertex set. If we are also given weights for the vertices of the graph, we can ask insteadthat S has small weight: this is the problem Weighted Subset Odd Cycle Transversal . Weprove an almost-complete complexity dichotomy for this problem when the input is restricted tographs that do not contain a graph H as an induced subgraph. In particular, we show that for(3 P + P )-free graphs (where P r is the path on r vertices) there is a polynomial-time algorithm,but the problem is NP -complete for 5 P -free graphs, that is, graphs of independence number 4.Thus we obtain a dichotomy with respect to the independence number; this is an analogue of thedichotomy for Weighted Subset Feedback Vertex Set recently obtained by Papadopoulos andTzimas. In contrast,
Subset Feedback Vertex Set and
Subset Odd Cycle Transversal have a polynomial-time algorithm for any graph class with bounded independence number. Wealso generalize the polynomial-time result of Papadopoulos and Tzimas for
Weighted SubsetFeedback Vertex Set on 4 P -free graphs to (3 P + P )-free graphs. As a consequence, we showthat the complexity for both of the weighted subset transversal problems restricted to H -free graphsremains open for just three particular graphs H . Theory of computation → Graph algorithms analysis
Keywords and phrases odd cycle transversal, feedback vertex set, H -free graph, dichotomy Funding
The research in this paper received support from the Leverhulme Trust (RPG-2016-258).
For a graph transversal problem, one seeks to find a small set of vertices within a given graphthat intersects every subgraph of a specified kind. Two problems of this type are
FeedbackVertex Set and
Odd Cycle Transversal , where the objective is to find a small set S ofvertices that intersects, respectively, every cycle and every cycle containing an odd number ofvertices. One can also think of these problems in the graph modification paradigm: when S is deleted from the graph, what remains is a forest or a bipartite graph, respectively.For a graph subset transversal problem, one is given both a graph and a subset T of thevertex set and the objective is to find a small set of vertices that intersects every subgraphof a specified kind that also contains a vertex of T . Let us give some definitions beforedescribing a further generalization of these two problems. For a graph G = ( V, E ) and aset T ⊆ V , an (odd) T -cycle is a cycle of G (with an odd number of vertices) that intersects T .A set S T ⊆ V is a T -feedback vertex set or an odd T -cycle transversal of G if S T has at least a r X i v : . [ c s . D S ] J u l Computing Weighted Subset Transversals in H -Free Graphs Figure 1
Two examples of the Petersen graph with the set T indicated by square vertices, wherethe black vertices form an odd T -cycle transversal S T . As all the cycles in the graph are odd, theblack vertices also form a T -feedback vertex set. On the left, S T ∩ T = ∅ , while on the right, S T ⊆ T .This example is from [7]. .one vertex of, respectively, every T -cycle or every odd T -cycle. Examples are displayed inFigure 1. A (non-negative) weighting of G is a function w : V → R + . For v ∈ V , we saythat w ( v ) is the weight of v , and for a subset S ⊆ V , the weight w ( S ) of S is the sum of theweights of the vertices in S . In a weighted subset transversal problem the task is to find atransversal whose weight is less than a prescribed bound. We study the following problems: Weighted Subset Feedback Vertex Set
Instance: a graph G , a subset T ⊆ V ( G ), a non-negative vertex weighting w of G andan integer k ≥ Question: does G have a T -feedback vertex set S T with | w ( S T ) | ≤ k ? Weighted Subset Odd Cycle Transversal
Instance: a graph G , a subset T ⊆ V ( G ), a non-negative vertex weighting w of G andan integer k ≥ Question: does G have an odd T -cycle transversal S T with | w ( S T ) | ≤ k ? These two weighted subset transversal problems are NP -complete even when the weightingfunction is 1 and T = V . Therefore, it is natural to look for tractable cases by restricting theinput to graphs that belong to particular graph classes and, in this way, gain insights intothe structural properties that are the key to the problems’ computational hardness. In thispaper, we continue a systematic study of transversal problems on hereditary graph classes,focusing on the weighted subset variants. Hereditary graph classes can be characterized by a(possibly infinite) set of forbidden induced subgraphs. We begin with the case where thisset has size 1: the class of graphs that, for some graph H , do not contain H as an inducedsubgraph. We say that a graph with this property is H -free . In the remainder of this sectionwe discuss past work, and then state our results, which show that we are close to obtainingcomplexity dichotomies for these two problems on H -free graphs. Past Work.
We first note some NP -completeness results for the special case where w ≡ T = V , which corresponds to the original problems Feedback Vertex Set and
OddCycle Transversal . These results immediately imply NP -completeness for the weightedsubset problems. By Poljak’s construction [24], for every integer g ≥ Feedback VertexSet is NP -complete for graphs of finite girth at least g (the girth of a graph is the length ofits shortest cycle). There is an analogous result for Odd Cycle Transversal [8]. It hasalso been shown that
Feedback Vertex Set [27] and
Odd Cycle Transversal [8] are . Brettell, M. Johnson, and D. Paulusma 3 NP -complete for line graphs and, therefore, also for claw-free graphs. Thus, the two problemsare NP -complete for the class of H -free graphs whenever H contains a cycle or claw. Ofcourse, a graph with no cycle is a forest, and a forest with no claw has no vertex of degreeat least 3. This implies that we need now only focus on the case where H is a collection ofdisjoint paths. We call such a graph a linear forest .There is no linear forest H for which Feedback Vertex Set on H -free graphs is knownto be NP -complete, but Odd Cycle Transversal is NP -complete for ( P + P , P )-freegraphs [11] (see the end of this section for the notation used). It is known that SubsetFeedback Vertex Set [13] and
Subset Odd Cycle Transversal [7], which are thespecial cases with w ≡
1, are NP -complete for 2 P -free graphs; in fact, these results wereproved for split graphs which form a proper subclass of 2 P -free graphs. For the weightedsubset problems, there is just one additional case of NP -completeness currently known,from the interesting recent work of Papadopoulos and Tzimas [23] as part of the followingdichotomy for Weighted Subset Feedback Vertex Set . (cid:73) Theorem 1 ([23]) . Let s ≥ . Then Weighted Subset Feedback Vertex Set on sP -free graphs is polynomial-time solvable if s ≤ and is NP -complete if s ≥ . In contrast, the unweighted version can be solved in polynomial time for sP -free graphs forevery s ≥
1. For many transversal problems, the complexities on the weighted and unweightedversions for H -free graphs align; see, for example Vertex Cover [15],
Connected VertexCover [16] and (Independent) Dominating Set [19]. Thus
Subset Feedback VertexSet is one of the few known problems for which, on certain hereditary graph classes, the(unweighted) problem is polynomial-time solvable, but the weighted variant is NP -complete.The other polynomial-time algorithm for Weighted Subset Feedback Vertex Set on H -free graphs follows from a result of Bergougnoux et al. [3], which shows that theproblem is polynomial-time solvable given a graph together with a decomposition of constantmim-width. Note that for P -free graphs, the mim-width is bounded and a decompositioncan be computed efficiently. To the best of our knowledge, algorithms for Weighted SubsetOdd Cycle Transversal on H -free graphs have not previously been studied.For more background on these problems, other results to date and the many otheraspects that have been studied, we refer to the discussion in [7]; here, we just mention thepolynomial-time results on H -free graphs for the unweighted subset variants of the problems(which do not imply anything for the weighted subset versions). Both Subset FeedbackVertex Set and
Subset Odd Cycle Transversal are polynomial-time solvable on H -free graphs if H = P or H = sP + P [7, 22]. Additionally, Feedback Vertex Set is polynomial-time solvable on P -free graphs [1], and both Feedback Vertex Set and
Odd Cycle Transversal can be solved in polynomial-time on sP -free graphs for every s ≥ Our Results.
We enhance the current understanding of the two weighted subset transversalproblems, presenting new polynomial-time algorithms for
Weighted Subset Odd CycleTransversal and
Weighted Subset Feedback Vertex Set on H -free graphs forcertain H . We highlight again that Subset Odd Cycle Transversal is a problem whoseweighted variant is harder than its unweighted variant. Our main result is the followingalmost-complete dichotomy. We write H ⊆ i G , or G ⊇ i H , to say that H is an inducedsubgraph of G . (cid:73) Theorem 2.
Let H be a graph with H / ∈ { P + P , P + P , P + P } . Then WeightedSubset Odd Cycle Transversal on H -free graphs is polynomial-time solvable if H ⊆ i Computing Weighted Subset Transversals in H -Free Graphs polynomial-time unresolved NP -complete FVS H ⊆ i P , sP + P , or sP for s ≥ H ⊇ i P + P or P + P none OCT H = P or H ⊆ i sP + P or sP for s ≥ H = sP + P for s ≥ H = sP + tP + uP + vP for s, t, u ≥ v ≥ { s, t, u } ≥ v = 1, or H = sP + tP + uP for s, t ≥ u ≥ u ≥ t = 0 H ⊇ i P or P + P SFVS , SOCT H = P or H ⊆ i sP + P for s ≥ H = sP + P for s ≥ H ⊇ i P WSFVT , WSOCT H ⊆ i P , P + P , or3 P + P H ∈ { P + P , P + P , P + P } H ⊇ i P or 2 P Table 1
The computational complexity of
Feedback Vertex Set (FVS),
Odd Cycle Trans-versal (OCT), and their subset (S) and weighted subset (WS) variants, when restricted to H -freegraphs for linear forests H . The problems are each NP -complete for H -free graphs when H is not alinear forest; that is, when H contains a cycle or a claw as an induced subgraph. P + P , P + P , or P , and is NP -complete otherwise. As a consequence, we obtain a dichotomy analogous to Theorem 1. (cid:73)
Corollary 3.
Let s ≥ . Then Weighted Subset Odd Cycle Transversal on sP -freegraphs is polynomial-time solvable if s ≤ and is NP -complete if s ≥ . We prove Theorem 2 in Section 2. For the hardness part it suffices to show hardness for H = 5 P ; this follows from the same reduction used by Papadopoulos and Tzimas [23] toprove Theorem 1. The three tractable cases, where H ∈ { P , P + P , P + P } , are allnew. Out of these cases, H = 3 P + P is the most involved. For this case we use a differenttechnique to that used in [23]. Although we also reduce to the problem of finding a minimumweight vertex cut that separates two given terminals, our technique relies less on explicitdistance-based arguments, and we devise a method for distinguishing cycles according toparity. Our technique also enables us to extend the result of [23] on Weighted SubsetFeedback Vertex Set from 4 P -free graphs to (3 P + P )-free graphs, leading to the samealmost-complete dichotomy for Weighted Subset Feedback Vertex Set . (cid:73) Theorem 4.
Let H be a graph with H / ∈ { P + P , P + P , P + P } . Then WeightedSubset Feedback Vertex Set on H -free graphs is polynomial-time solvable if H ⊆ i P + P , P + P , or P , and is NP -complete otherwise. We refer to Table 1 for an overview of the current knowledge of the problems, includingthe results of this paper. We finish this section by stating further notation and terminology.
Preliminaries
Let G = ( V, E ) be an undirected, finite graph with no self-loops and no multiple edges. If S ⊆ V , then G [ S ] denotes the subgraph of G induced by S , and G − S is the graph G [ V \ S ].The path on r vertices is denoted P r . We say that S is independent if G [ S ] has no edges,and that S is a clique and G [ S ] is complete if every pair of vertices in S is joined by an edge.If G and G are vertex-disjoint graphs, then the union operation + creates the disjointunion G + G having vertex set V ( G ) ∪ V ( G ) and edge set E ( G ) ∪ E ( G ). By sG , wedenote the disjoint union of s copies of G . Thus sP denotes the graph whose vertices form . Brettell, M. Johnson, and D. Paulusma 5 an independent set of size s . A (connected) component of G is a maximal connected subgraphof G . The neighbourhood of a vertex u ∈ V is the set N G ( u ) = { v | uv ∈ E } . For U ⊆ V , welet N G ( U ) = S u ∈ U N ( u ) \ U . We omit subscripts when there is no ambiguity.Let T ⊆ V . Recall that a cycle is a T -cycle if it contains a vertex of T . A subgraph of G is a T -forest if it has no T -cycles. A subgraph of G is T -bipartite if it has no odd T -cycles.Note that S T is a T -feedback vertex set if and only if G [ V \ S T ] is a T -forest, and S T is anodd T -cycle transversal if and only if G [ V \ S T ] is T -bipartite. In this section we prove Theorem 2. The most involved case is where H = 3 P + P , whichwe show to be polynomial-time solvable. In our proof for this case we reduce to a classicalgraph problem, namely: Weighted Vertex Cut
Instance: a graph G = ( V, E ), two distinct terminals t and t , and a non-negativevertex weighting w . Task: determine a set S ⊆ V \ { t , t } of minimum weight such that t and t are indifferent connected components of G − S . Using standard network flow techniques,
Weighted Vertex Cut is well known to bepolynomial-time solvable. The
Node Multiway k -Cut problem is a natural generalizationof this problem: instead of two terminals, we are given k terminals that need to be pairwiseseparated from each other by removing a set of non-terminal vertices of minimum weight.Papadopoulos and Tzimas [23] proved that (Unweighted) Node Multiway -Cut is NP -complete even for 4 P -free graphs. They use the same hardness reduction (from VertexCover for 3-partite graphs) for proving that
Weighted Subset Feedback Vertex Set is NP -complete for 5 P -free graphs. Their reduction also immediately gives us the followingresult, as all the relevant T -cycles in the constructed Weighted Subset Feedback VertexSet instance are odd. We provide the full proof for completeness. (cid:73)
Lemma 5.
Weighted Subset Odd Cycle Transversal is NP -complete for P -freegraphs. Proof. A vertex cover of a graph G = ( V, E ) is a set S ⊆ V such that G − S is an independentset. The corresponding decision problem is defined as follows: Vertex Cover
Instance: a graph G and an integer k ≥ Question: does G have a vertex cover U with | U | ≤ k ? To prove the lemma, we reduce from
Vertex Cover on 3-partite graphs, which is NP -complete [14]. Let ( G, k ) be a
Vertex Cover instance where G is a 3-partite graph suchthat ( X , X , X ) is a partition of V ( G ) into independent sets. We construct an instance( G , T, w, k ) of Weighted Subset Odd Cycle Transversal as follows. First, let G bethe graph obtained from G by making each of X , X , and X into cliques, then introducing4 new vertices r , r , r , and t where the neighbourhood of r i is X i ∪ { t } for each i ∈ { , , } ,and the neighbourhood of t is { r , r , r } . We define the weighting w on V ( G ) as follows:let w ( v ) = 1 for each v ∈ V ( G ), let w ( r i ) = | V ( G ) | for each i ∈ { , , } , and w ( t ) = | V ( G ) | .Finally, set T = { t } . Observe that X i ∪ { r i } is a clique for each i ∈ { , , } . Thus, G Computing Weighted Subset Transversals in H -Free Graphs is 5 P -free: an independent set of G contains at most one vertex from X i ∪ { r i } for each i ∈ { , , } , and the only other vertex not in one of these three sets is t .Suppose that G has a vertex cover U of size at most k . We claim that U is an odd T -cycletransversal of G with w ( U ) ≤ k . Clearly w ( U ) ≤ k , since w ( u ) = 1 for each u ∈ U ⊆ V ( G ).It remains to show that U is an odd T -cycle transversal. Towards a contradiction, supposethat G − U contains an odd T -cycle C . Since T = { t } , the cycle C contains an edge incidentto t . Without loss of generality, we may assume that C contains the edge tr . Observe that V ( G ) \ U is an independent set of G , so each edge of G − U is either incident to (at least)one of r , r , r and s , or both endpoints are in X i for some i ∈ { , , } . Now every pathin G − U from v to v for v ∈ X ∪ { r } and v ∈ V ( G ) \ ( X ∪ { r } ) passes through thevertex t . So tr is a bridge, implying it is not contained in a cycle, a contradiction. Wededuce that U is an odd T -cycle transversal.Now suppose that G has an odd T -cycle transversal of weight at most k . Let U be aminimum-weight odd T -cycle transversal of G . In particular, w ( U ) ≤ k . Observe that forany v ∈ X ∪ X ∪ X , the set S = ( X ∪ X ∪ X ) \ { v } is an odd T -cycle transversal,since G [ { r , r , r , t, v } ] is a tree. Since w ( S ) = | V ( G ) | − U is a minimum-weight odd T -cycle transversal, U does not contain r , r , r , or t . That is, U ⊆ V ( G ). Clearly | U | ≤ k .We claim that U is a vertex cover of G . Suppose not. Then, without loss of generality, thereis an edge x x ∈ E ( G ) such that x ∈ X , x ∈ X , and x , x / ∈ U . But then sr x x r s is an odd T -cycle of G − U , a contradiction. We deduce that U is a vertex cover of G of sizeat most k , which completes the proof. (cid:74) To prove the case where H = 3 P + P , we will need the polynomial-time algorithm ofChiarelli et al. [8] for Odd Cycle Transversal on sP -free graphs (for any s ≥ (cid:73) Lemma 6 ([2]) . For every constant s ≥ , the number of maximal independent sets of an sP -free graph on n vertices is at most n s + 1 . (cid:73) Lemma 7 ([28]) . For every constant s ≥ , it is possible to enumerate all maximalindependent sets of a graph G on n vertices and m edges with a delay of O ( nm ) . (cid:73) Lemma 8.
For every integer s ≥ , Weighted Odd Cycle Transversal is polynomial-time solvable for sP -free graphs. Proof.
Let S be a minimum-weight odd cycle transversal of an sP -free graph G = ( V, E ).Let B S = V \ S . Then G [ B S ] is a bipartite graph. We choose a bipartition ( X, Y ) of F S suchthat X has maximum size (so every vertex in Y has at least one neighbour in X ). Then X is a maximal independent set of G , as otherwise there exists a vertex u ∈ S not adjacentto any vertex of X , and thus S \ { u } is an odd cycle transversal of G with larger weight,contradicting the fact that S has minimum weight. Moreover, by a similar argument, Y is amaximal independent set of G − X .We describe a procedure to find all minimal odd cycle transversals of G , and, as theminimum size transversals of G will be amongst them this provides an algorithm for OddCycle Transversal . We enumerate all maximal independent sets of G , and for eachmaximal independent set X , we enumerate all maximal independent sets of G − X . For eachsuch set Y , we note that V ( G ) \ ( X ∪ Y ) is an odd cycle transversal of G . By the arguments . Brettell, M. Johnson, and D. Paulusma 7 S T B T T R ∩ T = ∅ R \ TO = ∅ R Figure 2
The decomposition of V from the proof of Lemma 9 when S T is a mixed solution. Thesets O and R are the odd and even vertices of B T , respectively. above, we will find every minimal odd cycle transversal in this way, and, by Lemmas 6 and 7,this takes polynomial time. (cid:74) We are now ready to prove our main contribution. (cid:73)
Lemma 9.
Weighted Subset Odd Cycle Transversal is polynomial-time solvablefor (3 P + P ) -free graphs. Proof.
Let G = ( V, E ) be a (3 P + P )-free graph with a vertex weighting w , and let T ⊆ V .We describe a polynomial-time algorithm for the optimization version of the problem oninput ( G, T, w ). Let S T ⊆ V such that S T is a minimum-weight odd cycle transversal of G ,and let B T = V \ S T , so G [ B T ] is a maximum weight T -bipartite graph.We introduce the following notions for a T -bipartite graph G [ B T ]. If u ∈ B T belongs toat least one odd cycle of G [ B T ], then u is an odd vertex of B T . Otherwise, if u ∈ B T is notin any odd cycle of G [ B T ], we say that u is an even vertex of B T . Note that by definitionevery vertex in T ∩ B T is even. We say that a solution S T is non-mixed if B T = V \ S T either consists of only even vertices or does not contain a vertex of T ; otherwise we say that S T is a mixed solution.We begin by computing a non-mixed solution S T of minimum weight. There are twopossibilities. First, if B T has only even vertices, then S T is an odd cycle transversal of G .We can compute a minimum-weight odd cycle transversal in polynomial time by Lemma 8(take s = 4). Second, if B T does not contain a vertex of T , then S T = T (as w is non-negative). We take the minimum-weight solution of the two possibilities, and record it as theminimum-weight non-mixed solution. Note that we found this solution in polynomial time.It remains to compute a mixed solution S T of minimum weight and compare its weightwith the weight of the non-mixed solution found above. We let O = O ( S T ) denote the set ofodd vertices of B T and R = R ( S T ) denote the set of even vertices of B T . By the definitionof a mixed solution, O and R ∩ T are both nonempty (see Figure 2). As O is nonempty, G [ O ] has at least one connected component. We first prove a useful claim that bounds thenumber of connected components of G [ O ]. Claim 1. For every mixed solution S T , the graph G [ O ] has at most two connected components. We prove Claim 1 as follows. For contradiction, assume that G [ O ] has at least three connectedcomponents D , D , D . As each D i contains an odd cycle, each D i has an edge. Hence,each D i must be a complete graph; otherwise one D i , say D has two non-adjacent vertices,which would induce together with a vertex of D and an edge of D , a 3 P + P . Computing Weighted Subset Transversals in H -Free Graphs ROu u v v K L
Figure 3
The structure of B T corresponding to a 2-clique solution. The subgraphs K and L areeach cliques on an odd number of vertices that is at least 3. Recall that, as S T is mixed, R is nonempty. Let u ∈ R . Then u does not belong to any D i . Moreover, u can be adjacent to at most one vertex of each D i ; otherwise u and two ofits neighbours in D i would form a triangle (as D i is complete) and u would not be even. Aseach D i is a complete graph on at least three vertices, we can pick two non-neighbours of u in D , which form an edge, a non-neighbour of u in D and a non-neighbour of u in D .These four vertices, together with u , induce a 3 P + P , a contradiction. This completes theproof of Claim 1. (cid:5) As O is nonempty for every mixed solution S T , Claim 1 lets us distinguish between twocases: either G [ O ] is connected or G [ O ] consists of two connected components. We computea mixed solution of minimum weight for each type. Case 1. G [ O ] is connected.We first consider the case where the graph G [ B T ] is of the following form: R consists of twoadjacent vertices u and u and O is the disjoint union of two complete graphs K and L onan odd number of vertices plus a single additional edge, such that the following holds: u is adjacent to exactly one vertex v in K and to no vertex of L ; u is adjacent to exactly one vertex v in L and to no vertex of K ; v and v are adjacent.Note that G [ B T ] is T -bipartite. We call the corresponding mixed solution a (see Figure 3). The algorithm now determines in polynomial time a 2-clique solution ofminimum weight as follows. It considers all O ( n ) possible choices for the vertices u , u , v , and v , discarding those cases where the four vertices do not induce a 4-cycle in theorder u , u , v , v . Otherwise, let ( G , w ) be the weighted graph obtained from ( G, w ) afterdeleting T and N ( T ) \ { v , v } . The algorithm will then solve Weighted Vertex Cut (recall that this problem is polynomial-time solvable) on G , w and with terminals v and v .Let S be the output. Then, as G is 3 P + P -free, V ( G ) − S consists of two cliques K with v ∈ K and L with v ∈ L . We let O = K ∪ L and R = { u , u } . This gives us the 2-cliquesolution S T = V \ ( R ∪ O ). From all the O ( n ) 2-clique solutions computed in this way, pickone that has minimum weight. Note that this solution is found in polynomial time.In the remainder of Case 1, we will compute a mixed solution S T of minimum weight thatis not a 2-clique solution but for which G [ O ] is still connected. We start by proving thefollowing claim. . Brettell, M. Johnson, and D. Paulusma 9 Claim 2. For every mixed solution S T , every independent set in G [ R ] has size at most . We prove Claim 2 as follows. Suppose that R contains an independent set I = { u , . . . , u } of five vertices. As O is nonempty, G [ B T ] has an odd cycle C . Let v , v , v be consecutivevertices of C in that order. As G is (3 P + P )-free, v v ∈ E and { u , u , u } is independent,one of v , v is adjacent to one of u , u , u , say v is adjacent to u . Then v must beadjacent to at least two vertices of { u , u , u , u } ; otherwise three non-neighbours of v in { u , u , u , u } , together with the edge u v , would induce a 3 P + P . Hence, we mayassume without loss of generality that v is adjacent to u and u .Let i ∈ { , , } . As u i is adjacent to v and C is odd, u i cannot be adjacent to v or v ; otherwise u i would belong to an odd cycle, so u i would not be even, contradicting that u i ∈ R . Hence, { u , u , u , v , v } induces a 3 P + P , a contradiction. This completes theproof of Claim 2. (cid:5) By Claim 2 and the fact that G [ R ] is bipartite by definition, we find that | R | ≤
8. Weconsider all O ( n ) possibilities for R . For each choice of R , we compute a solution S T ofminimum weight such that B T contains R .We let F , . . . , F p be the set of connected components of G [ R ]. Note that p ≥ p ≤ O is a connector if it has a neighbour in F i for at least one F i . We make the following claim. Claim 3. For every mixed solution S T that is not a -clique solution for which G [ O ] isconnected, O does not contain two connectors with a neighbour in the same F i . We prove Claim 3 as follows. For contradiction, assume O contains two distinct connectors v and v , each with a neighbour in the same F i , say, F . Let u , u ∈ V ( F ) be these twoneighbours and note that u = u is possible. Let Q be a path from u to u in F (seeFigure 4). We make an important claim: Any edge that is on a path P from v to v in G [ O ] does not belong to an odd cycle in G [ B T ] . The reason is that otherwise there also exists a path P from v to v in G [ O ] that has adifferent parity than P and either the cycle u v P v u Qu or the cycle u v P v u Qu isodd. This would mean that u and u are not even.By definition, v and v belong to at least one odd cycle, which we denote by C and C ,respectively. Then v is the only neighbour of u on C ; otherwise u would belong to anodd cycle of G [ B T ]. Moreover, u has no neighbour on C , except v if u = u ; otherwise u would again belong to an odd cycle (as u and u are connected via the path Q in F ).By the same argument u has no neighbour on C except v and no neighbour on C , except v if u = u . We also note that V ( C ) ∩ V ( C ) = ∅ and that there is no edge between avertex of C and a vertex of C except possibly the edge v v ; otherwise there would be apath from v to v in G [ O ] with an edge that belongs to an odd cycle (namely C or C ), acontradiction with what we derived above.Now suppose that one of C , C , say C , has more than three vertices. Then, as C is odd, | V ( C ) | ≥ x, y, z in V ( C ) \ { v } that induce a P + P . We alsopick a non-neighbour t of u in C , which is not adjacent to u either. Then { t, u , x, y, z } induces a 3 P + P in G , a contradiction. Hence, C and C each are triangles, say withvertices v , w , x and v , w , x , respectively.Now suppose G [ O ] contains a path P from v to v on at least three vertices. Let s ∈ V ( P ) \ { v , v } . Then s does not belong to { w , x , w , x } and cannot be adjacent toany vertex of { w , x , w , x } either; otherwise there would exist a path from v to v in H -Free Graphs F Ou u v v Q Pw x w x s Figure 4
An illustration of the case where G [ O ] is connected and two of its distinct vertices v and v are joined to vertices u and u in the same component F of R . The vertices v and v arejoined by a path P in G [ O ], and Q joins u and u in F (recall that u , u might not be distinct inwhich case Q has no edges). We argue first that no edge of any path from v to v (so including P )belongs to an odd cycle in G [ O ]. We later establish that v and v belong to disjoint 3-cycles in G [ O ] and argue that P must be a single edge since if there is a vertex s / ∈ { v , v } on P the dashededges cannot exist, but then the white vertices induce a 3 P + P . G [ O ] that has an edge that belongs to an odd cycle. However, now { s, u , w , w , x } inducesa 3 P + P , a contradiction (see also Figure 4). We conclude that as G [ O ] is connected, v and v must be adjacent.So far, we found that O consists of two triangles on vertex sets { v , w , x } and { v , w , x } ,respectively, with v v as the only edge between them. As v is adjacent to v , we find that u = u ; otherwise { u , v , v } would induce a triangle, which is not possible as u ∈ R .Recall that u is not adjacent to any vertex of V ( C ) ∪ V ( C ) except v , and similarly, u isnot adjacent to any vertex of V ( C ) ∪ V ( C ) except v . Then u must be adjacent to u , asotherwise { u , u , w , w , x } would induce a 3 P + P .Let z ∈ O \ ( V ( C ) ∪ V ( C )). Suppose u is adjacent to z . First assume z is adjacent to w or x , say w . Then u zw x v u is an odd cycle. Hence, this is not possible. Now assume z is adjacent to w or x , say w . Then u zw v u u is an odd cycle. This is not possibleeither. Hence, z is not adjacent to any vertex of { w , x , w , x } . Moreover, z is not adjacentto u , as otherwise { u , u , z } induces a triangle in G [ B T ]. However, { u , w , z, w , x } nowinduces a 3 P + P . Hence, u is not adjacent to z . In other words, v is the only neighbourof u on O . By the same arguments, v is the only neighbour of u on O .Let K be a maximal clique of O that contains C and let L be a maximal clique of O that contains C . Note that K and L are vertex-disjoint, as for example, w ∈ K and w ∈ L are not adjacent. We claim that O = K ∪ L . For contradiction, assume that r is avertex of O that does not belong to K or L . As u and u are adjacent vertices that haveno neighbours in O \ { v , v } , the (3 P + P )-freeness of G implies that G [ O \ { v , v } ] is3 P -free. As K \ { v } and L \ { v } induce the disjoint union of two complete graphs on atleast two vertices, this means that r is adjacent to every vertex of K \ { v } or to every vertexof L \ { v } , say r is adjacent to every vertex of K \ { v } . Then r has no neighbour r in L \ { v } , as otherwise the cycle v u u v r rw v is an odd cycle in G [ B T ] that contains u (and u ). Moreover, as K is maximal and r is adjacent to every vertex of K \ { v } , we find . Brettell, M. Johnson, and D. Paulusma 11 that r and v are not adjacent. Recall also that u has v as its only neighbour in O , hence u is not adjacent to r . This means that { r, v , u , w , x } induces a 3 P + P , which is notpossible. We conclude that O = K ∪ L .We now consider the graph F in more detail. Suppose F contains another vertex u / ∈ { u , u } . As F is connected and bipartite (as V ( F ) ⊆ R ), we may assume withoutloss of generality that u is adjacent to u but not to u . If u has a neighbour K , then G [ B T ] contains an odd cycle that uses u , u and one vertex of K (if the neighbour of u in K is v ) or three vertices of K (if the neighbour of u in K is not v ). Hence, u has noneighbour in K . This means that { u , u , w , w , x } induces a 3 P + P , so u cannot exist.Hence, F consists only of the two adjacent vertices u and u .Now suppose that p ≥
2, that is, F is nonempty. We let u ∈ V ( F ). As u ∈ R ,we find that u is adjacent to at most one vertex of C and to at most one vertex of C .Hence, we may without loss of generality assume that u is not adjacent to w and w . Then { u , w , w , u , u } induce a 3 P + P . We conclude that R = { u , u } . However, now S T isa 2-clique solution of G , a contradiction. This completes the proof of Claim 3. (cid:5) By Claim 3, the set O has at most p ≤ R of vertices that must be even for the solution we are looking for. The algorithm nowconsiders all O ( n ) possible choices for a set D of at most four connectors. We first checkthat G [ D ∪ R ] is T -bipartite and that there are no two vertices in D with a neighbour inthe same F i ; if either of these two conditions is not satisfied, then we discard our choiceof D . Otherwise, we put the vertices of D in O , together with any vertex that is not in T and that is not adjacent to any vertex of the set R that we consider. Then, as G [ D ∪ R ] isbipartite and no two vertices in D are adjacent to the same component F i , the graph R ∪ O is T -bipartite, and we remember its weight.We note that in the above, we may have computed a set O that is disconnected or thatcontains even vertices. So our algorithm might compute some solutions more than once.However, we can compute each solution in Case 1 in polynomial time, and the total numberof solutions we compute in Case 1 is O ( n ) · ( O ( n ) + O ( n )) = O ( n ), which is polynomialas well. Hence, out of all the 2-clique solutions and other mixed solutions we found, we cansafely pick a solution S T = V T \ ( R ∪ O ) with minimum weight as the output for Case 1. Case 2. G [ O ] consists of two connected components.We first prove a useful claim. Claim 4. For every solution S T , if G [ O ] has two connected components, then R is a clique ofsize at most . We prove Claim 4 as follows. For contradiction, suppose R contains two non-adjacent vertices u and u . Let D and D be the two connected components of G [ O ]. Then D contains anodd cycle C on vertices v , . . . , v r for some r ≥ D contains an odd cycle C on vertices w , . . . , w s for some s ≥ u and u are adjacent to at most one vertex of C , as otherwise they lie on anodd cycle in G [ B T ], which would contradict the fact that they are even vertices. Hence, as r ≥
3, we may assume that v is not adjacent to u nor to u (see Figure 5). Hence, at leastone of u and u has a neighbour in { w , w } , otherwise { u , u , v , w , w } would induce a3 P + P . Say u is adjacent to w . By the same argument, one of u , u has a neighbour in { w , w } . As u already has a neighbour in C , we find that u cannot be adjacent to w or w , otherwise u would be in an odd cycle of G [ B T ], contradicting u ∈ R . Hence, u isadjacent to either w or w . So u and u each have a neighbour on C and these neighboursare not the same. H -Free Graphs C C ROu u v v v w w w Figure 5
In Claim 4, we assume that O has two components, so contain odd cycles C and C whose vertices we label v , v , . . . and w , w , . . . . If R contains distinct non-adjacent vertices u and u , we can assume neither is adjacent to v . As these three vertices, illustrated in white, induce a3 P , and since there are no edges between C and C , there must be an edge from each of u and u to distinct vertices in C . By a symmetric argument, u and u are adjacent to C , and this impliesa contradictory odd cycle can be found containing u and u . By the same reasoning, but with the roles of C and C reversed, we find that u and u also have (different) neighbours in C . However, we now find that there exists an odd cycleusing u , u and appropriate paths P C and P C between their neighbours on C and C ,respectively. We conclude that R is a clique. As G [ R ] is bipartite, this means that | R | ≤ (cid:5) By Claim 4, the set R is a clique of size at most 2. We consider all possible O ( n ) options ofchoosing the vertices of R . For each choice of R , we proceed as follows. We say that a vertexin O is a connector if it has a neighbour in R . We make the following claim. Claim 5. Let S T be a solution such that G [ O ] consists of two connected components D and D . Then D and D each have at most one connector. We prove Claim 5 as follows. For contradiction, suppose that one of D and D , say D , hastwo connectors v and v . Note that v and v have at most one neighbour in R , as R is aclique. We let u be the neighbour of v in R and u be the neighbour of v in R ; note that u = u is possible.Any edge that is on a path P from v to v in D does not belong to an odd cycle;otherwise there also exists a path P from v to v in G [ O ] that has a different parity than P and either the cycle u v P v u u or the cycle u v P v u u is odd, which would mean that u and u are not even vertices.By definition, v and v belong to at least one odd cycle, which we denote by C and C , respectively. Then V ( C ) ∩ V ( C ) = ∅ and moreover there is no edge between a vertexof C and a vertex of C ; otherwise there would be a path from v to v in G [ O ] with anedge that belongs to an odd cycle (namely C or C ), a contradiction with what we derivedabove. Note also that u has no neighbours in V ( C ) other than v ; otherwise G [ B T ] wouldcontain an odd cycle containing u . Moreover, u has no neighbours in V ( C ) either, except v if u = u ; otherwise G [ B T ] would contain an odd cycle containing u and u . Let w and x be two adjacent vertices of C that are not adjacent to u . Let w be a vertex of C not adjacent to u . Then, we found that { u , w , w , x } induces a 2 P + P (see Figure 6).We continue by considering D , the other connected component of G [ O ]. By definition, D has an odd cycle C . As | R | ≤ R can have at most one neighbouron an odd cycle in G [ B T ], we find that C contains a vertex v not adjacent to any vertex . Brettell, M. Johnson, and D. Paulusma 13 R OD D u u C C C v v w x w v Figure 6
In Claim 5, R is a clique with vertices u and u (which might not be distinct) and O has two components D and D . If D contains distinct vertices v and v that are each adjacent to R then each belong to distinct, non-adjacent odd cycles C and C in G [ D ]. Considering also anodd cycle C in G [ D ], we can find vertices, illustrated in white, that induce a 3 P + P . of R , so v is not adjacent to u . As v and the vertices of { w , w , x } belong to differentconnected components of G [ O ], we find that v is not adjacent to any vertex of { w , w , x } either. However, now { u , v , w , w , x } induces a 3 P + P , a contradiction. This provesClaim 5. (cid:5) For each considered clique R with | R | ≤
2, our algorithm considers all O ( n ) possible optionsof choosing at most one connector for D and at most one connector for D . We discardthe choice if the subgraph of G induced by R and the chosen connectors is not T -bipartite.Otherwise we continue as follows.In the case where our algorithm chooses at most one connector v , we let O consist of v and all vertices that do not belong to T and that do not have a neighbour in R . Then G [ R ∪ O ] is T -bipartite and we store S T = V \ ( R ∪ O ). Note that O might not induce twoconnected components consisting of odd vertices, so we may duplicate some work. However, R ∪ O induces a T -bipartite graph and we found O in polynomial time, and this is what isrelevant (together with the fact that we only use polynomial time).In the case where the algorithm chooses two connectors v and v we do as follows. Weremove any vertex from T and any neighbour of R other than v and v . Let ( G , w ) be theresulting weighted graph. We then solve Weighted Vertex Cut in polynomial time on G , w and with v and v as terminals. Let S be the output. We let O = V ( G ) − S . Note that G [ O ] consists of two connected components, but it might contain even vertices. However, G [ R ∪ O ] is T -bipartite, and we found O in polynomial time, and this is what is relevant.We remember the solution S T = V \ ( R ∪ O ).In the end we remember from all the solutions we computed one with minimum weightas the output for Case 2. Note that the number of solutions is O ( n ) · O ( n ) = O ( n ) andwe found each solution in polynomial time. Hence, processing Case 2 takes polynomial time. Correctness and Running Time.
The correctness of the algorithm follows from thecorrectness of the two case descriptions, which describe all possible mixed solutions byClaim 1. Since the algorithm processes each of the two cases in polynomial time, it computesa mixed solution of minimum weight in polynomial time. We already deduced that computinga non-mixed solution of minimum weight takes polynomial time as well. Hence, the total H -Free Graphs running time of the algorithm is polynomial. This completes the proof of Lemma 9. (cid:74) We also prove that
Weighted Subset Odd Cycle Transversal is polynomial-timesolvable for P -free graphs. The result follows immediately by an obvious adaptation of theproof of the unweighted variant. For completeness, we give the proof in Appendix A. (cid:73) Lemma 10.
Weighted Subset Odd Cycle Transversal is polynomial-time solvablefor P -free graphs. We can also prove that
Weighted Subset Odd Cycle Transversal is polynomial-time solvable for ( P + P )-free graphs, but for the proof we first need some further definitions,results and a problem that we will reduce to.A subgraph H of G is a co-component of G if H is a connected component of G . The closed neighbourhood of u is N G ( u ) ∪ { u } , which we denote by N [ u ]. We say that a set X ⊆ V ( G ) meets a subgraph H of G if X ∩ V ( H ) = ∅ . We say that I T ⊆ V ( G ) is a T -independent set of G if each vertex of I T ∩ T is an isolated vertex in G [ I T ]. Note that I T is a T -independent set if and only if V ( G ) \ I T is a T -vertex cover. Weighted Subset Independent Set
Instance: a graph G , a subset T ⊆ V ( G ), a non-negative vertex weighting w and aninteger k ≥ Question: does G have a T -independent set I T with | w ( I T ) | ≥ k ? (cid:73) Lemma 11.
Weighted Subset Independent Set is polynomial-time solvable for P -free graphs. Proof.
Let G be a 3 P -free graph, and let T ⊆ V ( G ). Suppose I T is a T -independent set of G . Observe that | I T ∩ T | ≤
2: if I T contained three vertices of T , then they would form anindependent set of size 3, contradicting that G is 3 P -free. Moreover, if | I T ∩ T | = 2, then | I T | = 2, since I T is T -independent and G is 3 P -free.Suppose | I T ∩ T | = 1. We claim that in this case I T consists of a single vertex t ∈ T anda clique C ⊆ V ( G ) \ T , where t is anti-complete to C . Let I T ∩ T = { t } , say. Since I T is T -independent, I T \ { t } ⊆ V ( G ) \ N [ t ]. Since G is 3 P -free, V ( G ) \ N [ t ] is a clique, thusproving the claim.So there are three cases: Case 1: I T ∩ T = ∅ . Case 2: | I T ∩ T | = 1, in which case I T = { t }∪ C where t ∈ T and C is a clique of V ( G ) \ T such that t is anti-complete to C . Moreover, since I T is T -independent, C ⊆ V ( G ) \ N [ t ]. Case 3: | I T ∩ T | = 2, in which case | I T | = 2.We compute a collection of O ( n ) T -independent sets, and then output a set of maximumweight. We compute the collection of T -independent sets as follows: Case 1:
Set I T = V ( G ) \ T . Case 2:
For each vertex t ∈ T , let U = V ( G ) \ N [ t ] and set I T = { t } ∪ ( U \ T ). Case 3:
For every pair of distinct vertices t and t in T , if t and t are non-adjacent,set I T = { t , t } .By the foregoing, this collection will contain a maximum-weight independent set. So amongthese O ( n ) T -independent sets I T , we output one of maximum weight. (cid:74) . Brettell, M. Johnson, and D. Paulusma 15 We will need the following characterization of paw-free graphs due to Olariu [21]. Here,the paw is the graph obtained from a triangle after adding a new vertex that we makeadjacent to only one vertex of the triangle. Note that the paw is the complement of P + P and is denoted P + P . (cid:73) Lemma 12 ([21]) . Every connected ( P + P ) -free graph is either triangle-free or ( P + P ) -free. We are now ready to prove our result for ( P + P )-free graphs. (cid:73) Lemma 13.
Weighted Subset Odd Cycle Transversal is polynomial-time solvablefor ( P + P ) -free graphs. Proof.
Let G be a ( P + P )-free graph. We present a polynomial-time algorithm for theoptimization problem, where we seek to find S T ⊆ V ( G ) such that S T is a minimum-weight odd T -cycle transversal. Note that for such an S T , the set B T = V ( G ) \ S T is amaximum-weight set such that G [ B T ] is a T -bipartite graph.In G , each connected component D is ( P + P )-free. By Lemma 12, D is either triangle-free or ( P + P )-free in G ; that is, D is 3 P -free or P -free in G . Let D , D , . . . , D ‘ be theco-components of G .Let B T ⊆ V ( G ) such that G [ B T ] is a T -bipartite graph. For now, we do not requirethat B T has maximum weight. We start by considering some properties of such a set B T .Observe that G − T is a T -bipartite graph, so we may have B T ∩ T = ∅ . Claim 1. If B T ∩ T = ∅ , then B T ⊆ V ( D i ) ∪ V ( D j ) for i, j ∈ { , , . . . , ‘ } . Suppose u ∈ B T ∩ T . Without loss of generality, let u ∈ V ( D ). The claim holds if B T ⊆ V ( D ), so suppose v ∈ B T \ V ( D ). Then v ∈ V ( D j ) for some j ∈ { , . . . , ‘ } . If B T also contains a vertex v ∈ D j for some j ∈ { , . . . , ‘ } \ { j } , then { u, v, v } induces a trianglein G , since D , D j , and D j are co-components. As this triangle contains u ∈ T , it is an odd T -cycle of G [ B T ], a contradiction. (cid:5) Note that Claim 1 implies that B T meets at most two co-components of G when B T ∩ T = ∅ .The next two claims consider the case when B T meets precisely two co-components of G . Claim 2. Suppose B T ∩ T = ∅ and there exist distinct i, j ∈ { , . . . , ‘ } such that B T ∩ V ( D i ) = ∅ and B T ∩ V ( D j ) = ∅ . If B T ∩ V ( D i ) contains a vertex of T , then B T ∩ V ( D j ) is an independentset. Suppose not. Then, without loss of generality, G [ B T ∩ V ( D )] contains an edge u v , and B T ∩ V ( D ) contains a vertex t ∈ T . But then { u , v , t } induces a triangle of G , since V ( D ) is complete to V ( D ), so G [ B T ] contains a contradictory odd T -cycle. (cid:5) Claim 3. Suppose B T ∩ T = ∅ and there exist distinct i, j ∈ { , . . . , ‘ } such that B T ∩ V ( D i ) = ∅ and B T ∩ V ( D j ) = ∅ . Either B T ∩ V ( D i ) and B T ∩ V ( D j ) are independent sets of G , or | B T ∩ V ( D i ) | = 1 and B T ∩ V ( D i ) ∩ T = ∅ , and B T ∩ V ( D j ) is a T -independent set, upto swapping i and j . Suppose B T meets D and D , but G [ B T ∩ V ( D )] contains an edge u v . Then, by Claim 2, B T ∩ V ( D ) is disjoint from T . But B T ∩ T = ∅ , so B T ∩ V ( D ) contains some t ∈ T . Again byClaim 2, B T ∩ V ( D ) is independent. It remains to show that B T ∩ V ( D ) is a T -independentset and that | B T ∩ V ( D ) | = 1. Suppose B T ∩ V ( D ) contains an edge tw , where t ∈ T .Then for any vertex w ∈ B T ∩ V ( D ), we have that { t, w , w } induces a triangle, so G [ B T ]has a contradictory odd T -cycle. We deduce that each vertex of T in B T ∩ V ( D ) is isolatedin G [ B T ∩ V ( D )]. Now suppose there exist distinct w , w ∈ B T ∩ V ( D ). Then tw u v w t is an odd T -cycle, a contradiction. So | B T ∩ V ( D i ) | = 1. (cid:5) H -Free Graphs We now describe the polynomial-time algorithm. Our strategy is to compute, in polynomialtime, a collection of O ( n ) sets B T such that G [ B T ] is T -bipartite, where a maximum-weight B T is guaranteed to be in this collection. It then suffices to output a set from this collectionof maximum weight.First, we compute the co-components D , D , . . . , D ‘ of G . For each of the ‘ = O ( n )co-components, we can recognise whether it is P -free in linear time. If it is not, then itis also not P -free, so it is 3 P -free, by Lemma 12. If it is, then we can compute if it hasan independent set of size at least three in linear time. Thus we determine whether theco-component is 3 P -free, or P -free.Now, for each co-component D , we solve Weighted Subset Odd Cycle Transversal for D . Note that we can do this in polynomial by Lemma 9 if D is 3 P -free; otherwise, byLemma 10 if D is P -free.Now we consider each pair { D , D } of distinct co-components. Note there are O ( n )pairs to consider. For each pair we will compute three sets B T such that G [ B T ] is T -bipartite. We compute a maximum-weight independent set I of D , and a maximum-weightindependent set I of D , where the weightings are inherited from the weighting w of G .Set B T = I ∪ I . Note that G [ I ∪ I ] is a complete bipartite graph, so it is certainly T -bipartite. We can compute these independent sets in polynomial time when restrictedto 3 P - or P -free graphs (for example, see [18]). We select a maximum-weight vertex v from V ( D ) \ T , and compute a maximum-weight T -independent set I of D . When D is 3 P -free, we can solve this in polynomial-timeby Lemma 11. On the other hand, when D is P -free, we solve the complementaryproblem, in polynomial time, by Lemma 20. Set B T = I ∪ { v } . Note that G [ B T ] is T -bipartite, since every vertex of T has degree 1 in G [ B T ] (its only neighbour is v ). This case is the symmetric counterpart to the previous: choose a maximum-weightvertex v of V ( D ) \ T , compute a maximum-weight T -independent set I of D , and set B T = I ∪ { v } .Finally, take the maximum-weight B T among the (at most) 3 (cid:0) ‘ (cid:1) + ‘ + 1 possibilitiesdescribed, where the final possibility is that B T = V ( G ) \ S T .To prove correctness of this algorithm, suppose B T is a maximum-weight set such that G [ B T ] is T -bipartite. If B T ⊆ V ( G ) \ T , then certainly the algorithm will either output V ( G ) \ T or another solution with weight equal to w ( B T ). So we may assume that B T ∩ T = ∅ .Now, by Claim 1, B T meets one or two co-components of G . If it meets exactly one co-component D , then B T is a maximum-weight set such that D [ B T ] is T -bipartite, which willbe found by the algorithm in the first phase. If it meets two co-components D and D , thenthe correctness of the algorithm follows from Claim 3. This concludes the proof. (cid:74) Theorem 2 now follows from Lemmas 5, 9, 10 and 13, together with the results of [8]that the
Odd Cycle Transversal problem (that is,
Weighted Subset Odd CycleTransversal where T = ∅ and w ≡
1) is NP -complete on H -free graphs whenever H has acycle or a claw. (cid:73) Theorem 2 (restated).
Let H be a graph with H / ∈ { P + P , P + P , P + P } . Then Weighted Subset Odd Cycle Transversal on H -free graphs is polynomial-time solvableif H ⊆ i P + P , P + P , or P , and is NP -complete otherwise. . Brettell, M. Johnson, and D. Paulusma 17 We use the following results of Schwikowski and Speckenmeyer, and Chiarelli et al., respect-ively, as lemmas. (cid:73)
Lemma 14 ([26]) . It is possible to enumerate all minimal feedback vertex sets of a graph G on n vertices and m edges with a delay of O ( n + n m ) . (cid:73) Lemma 15 ([8]) . For every constant s ≥ there is a constant c s such that the number ofminimal feedback vertex sets of an sP -free graph G on n vertices is O ( n c s ) . Our next lemma is proven in the same way as for the unweighted variant [8]. (cid:73)
Lemma 16.
For every integer s ≥ , Weighted Feedback Vertex Set is polynomial-time solvable for sP -free graphs. Proof.
Let G be an sP -free graph. By the combination of Lemmas 14 and 15, we canenumerate all minimal feedback vertex sets of G in polynomial time. Thus, as a feedbackvertex set of minimum weight is minimal, the result follows. (cid:74) The proof of the next lemma follows the same approach as the proof of Lemma 9 thoughis less involved. (cid:73)
Lemma 17.
Weighted Subset Feedback Vertex Set is polynomial-time solvable for (3 P + P ) -free graphs. Proof.
Let G = ( V, E ) be a (3 P + P )-free graph with a vertex weighting w , and let T ⊆ V .We describe a polynomial-time algorithm for the optimization version of the problem oninput ( G, T, w ). Let S T ⊆ V such that S T is a minimum weight feedback vertex set of G ,and let F T = V \ S T , so G [ F T ] is a maximum weight T -forest.We introduce the following notions for a T -forest G [ F T ]. If u ∈ F T belongs to at leastone cycle of G [ F T ], then u is a cycle vertex of F T . Otherwise, if u ∈ F T is not in any cycleof G [ F T ], we say that u is an forest vertex of F T . Note that by definition every vertex in T ∩ F T is a forest vertex. We say that a solution S T is non-mixed if F T = V \ S T eitherconsists of only forest vertices or does not contain a vertex of T ; otherwise we say that S T isa mixed solution.We first compute a non-mixed solution of minimum weight. If F T has no cycle vertices,then F T is a feedback vertex set of G . We can compute a minimum weight feedback vertexset in polynomial time by Lemma 16 (take s = 4). If F T has no forest vertices, then everyvertex of T must belong to S T . In that case, S T = T . We remember a smallest one as theminimum-weight non-mixed solution. Note that we found this solution in polynomial time.It remains to compute a mixed solution S T of minimum weight and compare its weightwith the weight of the non-mixed solution found above. We let O = O ( S T ) denote theset of cycle vertices of F T and R = R ( S T ) denote the set of forest vertices of F T . By thedefinition of a mixed solution, O and R ∩ T are both nonempty. As O is nonempty, G [ O ] hasat least one connected component. We first prove a useful claim that bounds the number ofconnected components of G [ O ]. Claim 1. For every mixed solution S T , the graph G [ O ] has at most two connected components. For contradiction, assume that G [ O ] has at least three connected components D , D , D .As each D i contains a cycle, each D i has an edge. Hence, each D i must be a complete graph;otherwise one D i , say D has two non-adjacent vertices, which would induce together with avertex of D and an edge of D , a 3 P + P . H -Free Graphs Recall that, as S T is mixed, R is nonempty. Let u ∈ R . Then u does not belong toany D i . Moreover, u can be adjacent to at most one vertex of each D i ; otherwise u and twoof its neighbours of D i would form a triangle (as D i is complete) and u would not be even.As each D i is a complete graph on at least three vertices, we can pick two non-neighboursof u in D , which form an edge, a non-neighbour of u in D and a non-neighbour of u in D .These four vertices induce, together with u , a 3 P + P , a contradiction. This completes theproof of Claim 1. (cid:5) As O is nonempty for every mixed solution S T , Claim 1 lets us distinguish between twocases: either G [ O ] is connected or G [ O ] consists of two connected components. We computea mixed solution of minimum weight for both types. Case 1. G [ O ] is connected.We start by proving the following claim. Claim 2. For every mixed solution S T , the size of a maximum independent set in G [ R ] is . Suppose that R contains an independent set I = { u , . . . , u } of five vertices. As O isnonempty, G [ F T ] has a cycle C . Let v , v , v be consecutive vertices of C in that order. As G is (3 P + P )-free, v v ∈ E and { u , u , u } is independent, one of v , v is adjacent toone of u , u , u ; say v is adjacent to u . Then v must be adjacent to at least two verticesof { u , u , u , u } ; otherwise three non-neighbours of v in { u , u , u , u } , together with theedge u v , would induce a 3 P + P . Hence, we may assume without loss of generality that v is adjacent to u and u .Let i ∈ { , , } . As u i is adjacent to v and C is a cycle, u i cannot be adjacent to v or v ; otherwise u would belong to a cycle, so u would not be a forest vertex. Hence, { u , u , u , v , v } induces a 3 P + P , a contradiction. This completes the proof of Claim 2. (cid:5) By Claim 2 and the fact that G [ R ] is bipartite by definition, we find that | R | ≤
8. Weconsider all O ( n ) possibilities for R . For each choice of R , we compute a solution S T ofminimum weight such that F T contains R .We let F , . . . , F p be the set of connected components of G [ R ]. Note that p ≥ p ≤ O is a connector if it has a neighbour in F i for at least one F i . For every mixed solution S T for which G [ O ] is connected, O doesnot contain two distinct connectors v and v that have a neighbour u and u , respectively(possibly u = u ) in the same F i ; otherwise we can take the cycle u v P v u Qu , where P is a path from v to v in O , and Q is a path from u to u in R implying that u is not aforest vertex..The algorithm now considers all O ( n ) possible options of choosing a set D of at mostfour connectors. We first check whether G [ D ∪ R ] is a T -forest. If not, then we discard ourchoice of D . Else, we put the vertices of D in O together with any vertex that is not in T and that is not adjacent to any vertex of the set R that we consider. Then, as G [ D ∪ R ] is a T -forest and by our choice of D , the graph R ∪ O is a T -forest, and we remember the weightof S T = V \ ( R ∪ O ).We note that in the above, we may have computed a set O that is disconnected orthat contains even vertices. So our algorithm might compute some solutions more thanonce. However, we can compute each solution in Case 1 in polynomial time, and the totalnumber of solutions we compute in Case 1 is O ( n ) · O ( n ) = O ( n ), which is polynomialas well. Hence, out of all the mixed solutions we found so far, we can safely pick a solution S T = V T \ ( R ∪ O ) with minimum weight, as the output for Case 1. . Brettell, M. Johnson, and D. Paulusma 19 Case 2. G [ O ] consists of two connected components.We first prove a useful claim. Claim 3. For every solution S T , if G [ O ] has two connected components, then R is a clique ofsize at most . For contradiction, suppose R contains two non-adjacent vertices u and u . Let D and D be the two connected components of G [ O ]. Then D contains a cycle C on vertices v , . . . , v r for some r ≥ D contains a cycle C on vertices w , . . . , w s for some s ≥ u and u are adjacent to at most one vertex of C , as otherwise they lie on acycle in G [ F T ]. Hence, as r ≥
3, we may assume that v is neither adjacent to u nor to u .Hence, at least one of u , u has a neighbour in { w , w } , say u is adjacent to w ; otherwise { u , u , v , w , w } would induce a 3 P + P . By the same argument, one of u , u musthave a neighbour in { w , w } . As u already has a neighbour on C , we find that u cannotbe adjacent to w or w ; otherwise u would be on a cycle in G [ F T ]. Hence, u must beadjacent to either w or w . So u and u each have a neighbour on C and these neighboursare not the same.By the same reasoning, but with the roles of C and C reversed, we find that u and u also have (different) neighbours on C . However, we now find that there exists a cycleusing u , u and appropriate paths P C and P C between their neighbours on C and C ,respectively. We conclude that R is a clique. As G [ R ] is bipartite, this means that | R | ≤ (cid:5) By Claim 3, the set R is a clique of size at most 2. We consider all possible O ( n ) optionsof choosing the vertices of R . For each choice, we will compute a solution S T of minimumweight, such that F T = V \ S T consists of R and a set O of cycle vertices that induces asubgraph of G with exactly two connected components. We say that a vertex in O is a connector if it has a neighbour in R . Then for every solution S T such that G [ O ] consists oftwo connected components D and D , both D and D each have at most one connector;otherwise there would be a cycle passing through R .For each considered clique R with | R | ≤
2, our algorithm considers all O ( n ) possibleoptions of choosing at most one connector for D and at most one connector for D . Wediscard the choice if the subgraph of G induced by R and the chosen connectors is not a T -forest. Otherwise we continue as follows.In the case where our algorithm chooses at most one connector v , we let O consist of v and all vertices that do not belong to T and that do not have a neighbour in R . Then G [ R ∪ O ] is a T -forest and we store S T = V \ ( R ∪ O ). Note that O might not induce twoconnected components consisting of cycle vertices, so we may duplicate some work. However, R ∪ O induces a T -forest, and we found O in polynomial time, and this is what is relevant(together with the fact that we only use polynomial time).In the case where our algorithm chooses two connectors v and v we do as follows. Weremove any vertex from T and any neighbour of R other than v and v . Let ( G , w ) be theresulting weighted graph. We then solve Weighted Vertex Cut in polynomial time on G , w and with v and v as terminals. Let S be the output. We let O = V ( G ) − S . Note that G [ O ] consists of two connected components, but it might contain forest vertices. However, G [ R ∪ O ] is a T -forest, and we found O in polynomial time, and this is what is relevant. Weremember the solution S T = V \ ( R ∪ O ).In the end we remember from all the solutions we computed one with minimum weightas the output for Case 2. Note that the number of solutions is O ( n ) · O ( n ) = O ( n ) andwe found each solution in polynomial time. Hence, processing Case 2 takes polynomial time. H -Free Graphs Correctness and Running Time.
The correctness of our algorithm follows from thecorrectness of the two case descriptions, which due to Claim 1 describe all the possible waysa solution can be mixed. Since our algorithm needs polynomial time to process each of thetwo cases, it computes a mixed solution of minimum weight in polynomial time. We alreadydeduced that computing a non-mixed solution of minimum weight takes polynomial time aswell. Hence, the total running time of our algorithm is polynomial. This completes the proofof Lemma 17. (cid:74)
The proof of the next lemma follows the proof of Lemma 13 and we also use the definitionsused in that proof. (cid:73)
Lemma 18.
Weighted Subset Feedback Vertex Set is polynomial-time solvable for ( P + P ) -free graphs. Proof.
Let G be a ( P + P )-free graph. We present a polynomial-time algorithm for theoptimization problem, where we seek to find S T ⊆ V ( G ) such that S T is a minimum-weight T -feedback vertex set. Note that for such an S T , the set F T = V ( G ) \ S T is a maximum-weightset such that G [ F T ] is a T -bipartite graph.In G , each connected component D is ( P + P )-free. By Lemma 12, D is either triangle-free or ( P + P )-free in G ; that is, D is 3 P -free or P -free in G . Let D , D , . . . , D ‘ be theco-components of G .Let F T ⊆ V ( G ) such that G [ F T ] is a T -bipartite graph. For now, we do not require that F T has maximum weight. We start by considering some properties of such a set F T . Observethat G − T is a T -bipartite graph, so we may have F T ∩ T = ∅ . Claim 1. If F T ∩ T = ∅ , then F T ⊆ V ( D i ) ∪ V ( D j ) for i, j ∈ { , , . . . , ‘ } . Suppose u ∈ F T ∩ T . Without loss of generality, let u ∈ V ( D ). The claim holds if F T ⊆ V ( D ), so suppose v ∈ F T \ V ( D ). Then v ∈ V ( D j ) for some j ∈ { , . . . , ‘ } . If F T also contains a vertex v ∈ D j for some j ∈ { , . . . , ‘ } \ { j } , then { u, v, v } induces a trianglein G , since D , D j , and D j are co-components. As this triangle contains u ∈ T , it is a T -cycle of G [ F T ], a contradiction. (cid:5) Note that Claim 1 implies that F T meets at most two co-components of G when F T ∩ T = ∅ .The next two claims consider the case when F T meets precisely two co-components of G . Claim 2. Suppose F T ∩ T = ∅ and there exist distinct i, j ∈ { , . . . , ‘ } such that F T ∩ V ( D i ) = ∅ and F T ∩ V ( D j ) = ∅ . If F T ∩ V ( D i ) contains a vertex of T , then F T ∩ V ( D j ) is an independentset. Suppose not. Then, without loss of generality, G [ F T ∩ V ( D )] contains an edge u v , and F T ∩ V ( D ) contains a vertex t ∈ T . But then { u , v , t } induces a triangle of G , since V ( D )is complete to V ( D ), so G [ F T ] contains a contradictory T -cycle. (cid:5) Claim 3. Suppose F T ∩ T = ∅ and there exist distinct i, j ∈ { , . . . , ‘ } such that F T ∩ V ( D i ) = ∅ and F T ∩ V ( D j ) = ∅ . Either F T ∩ V ( D i ) and F T ∩ V ( D j ) are independent sets of G , and | F T ∩ V ( D h ) | = 1 for some h ∈ { i, j } ; or | F T ∩ V ( D i ) | = 1 and F T ∩ V ( D i ) ∩ T = ∅ , and F T ∩ V ( D j ) is a T -independent set, upto swapping i and j . Suppose F T meets D and D , but G [ F T ∩ V ( D )] contains an edge u v . Then, by Claim 2, F T ∩ V ( D ) is disjoint from T . But F T ∩ T = ∅ , so F T ∩ V ( D ) contains some t ∈ T . Again byClaim 2, F T ∩ V ( D ) is independent. We claim that F T ∩ V ( D ) is a T -independent set andthat | F T ∩ V ( D ) | = 1, so that (2) holds. Suppose F T ∩ V ( D ) contains an edge tw , where t ∈ T . Then for any vertex w ∈ F T ∩ V ( D ), we have that { t, w , w } induces a triangle, . Brettell, M. Johnson, and D. Paulusma 21 so G [ F T ] has a contradictory T -cycle. We deduce that each vertex of T in F T ∩ V ( D ) isisolated in G [ F T ∩ V ( D )]. Now suppose there exist distinct w , w ∈ F T ∩ V ( D ). Then tw u v w t is an T -cycle, a contradiction. So | F T ∩ V ( D ) | = 1. Thus (2) holds.Now suppose F T meets D and D , but F T ∩ V ( D h ) is an independent set of G for h ∈ { , } . We may also assume, without loss of generality, that T ∩ F T ∩ V ( D ) = ∅ , since F T ∩ T = ∅ . Towards a contradiction, suppose | F T ∩ V ( D ) | , | F T ∩ V ( D ) | ≥
2. Then thereexist distinct v , t ∈ F T ∩ V ( D ) such that t ∈ T , and there exist distinct v , v ∈ F T ∩ V ( D ).But now t v v v t is a T -cycle of G [ F T ], a contradiction. We deduce that | F T ∩ V ( D h ) | = 1for some h ∈ { i, j } , as required. (cid:5) We now describe the polynomial-time algorithm. Our strategy is to compute, in polynomialtime, a collection of O ( n ) sets F T such that G [ F T ] is a T -forest, where a maximum-weight F T is guaranteed to be in this collection. It then suffices to output a set from this collectionof maximum weight.First, we compute the co-components D , D , . . . , D ‘ of G . For each of the ‘ = O ( n )co-components, we can recognise whether it is P -free in linear time. If it is not, then itis also not P -free, so it is 3 P -free, by Lemma 12. If it is, then we can compute if it hasan independent set of size at least three in linear time. Thus we determine whether theco-component is 3 P -free, or P -free.Now, for each co-component D , we solve Weighted Subset Feedback Vertex Set for D . Note that we can do this in polynomial by Lemma 17 if D is 3 P -free; otherwise, byLemma 18 if D is P -free.Now we consider each pair { D , D } of distinct co-components. Note there are O ( n )pairs to consider. For each pair we will compute four sets F T such that G [ F T ] is a T -forest. We select a maximum-weight vertex v from V ( D ), and compute a maximum-weightindependent set I of D , where the weightings are inherited from the weighting w of G . Set F T = { v } ∪ I . Note that G [ F T ] is a tree, so it is certainly a T -forest. We cancompute these independent sets in polynomial time when restricted to 3 P - or P -freegraphs (for example, see [18]). The symmetric counterpart to the previous case: we select a maximum-weight vertex v from V ( D ), and compute a maximum-weight independent set I of D , and set F T = { v } ∪ I . We select a maximum-weight vertex v from V ( D ) \ T , and compute a maximum-weight T -independent set I of D . When D is 3 P -free, we can solve this in polynomial-timeby Lemma 11. On the other hand, when D is P -free, we solve the complementaryproblem, in polynomial time, by Lemma 20. Set F T = I ∪ { v } . Note that G [ F T ] is a T -forest, since every vertex of T has degree 1 in G [ F T ] (its only neighbour is v ). This case is the symmetric counterpart to the previous one: select a maximum-weightvertex v of V ( D ) \ T , compute a maximum-weight T -independent set I of D , and set F T = I ∪ { v } .Finally, take the maximum-weight F T among the (at most) 4 (cid:0) ‘ (cid:1) + ‘ + 1 possibilitiesdescribed, where the final possibility is that F T = V ( G ) \ S T .To prove correctness of this algorithm, suppose F T is a maximum-weight set such that G [ F T ] is a T -forest. If F T ⊆ V ( G ) \ T , then certainly the algorithm will either output V ( G ) \ T or another solution with weight equal to w ( F T ). So we may assume that F T ∩ T = ∅ . Now, byClaim 1, F T meets one or two co-components of G . If it meets exactly one co-component D ,then F T is a maximum-weight set such that D [ F T ] is a T -forest, which will be found by thealgorithm in the first phase. If it meets two co-components D and D , then the correctnessof the algorithm follows from Claim 3. This concludes the proof. (cid:74) H -Free Graphs Bergougnoux et al. [3] recently proved that
Weighted Subset Feedback Vertex Set is polynomial-time solvable for every class for which a decomposition of bounded mim-widthcan be found in polynomial time. In particular, this implies that this problem is polynomial-time solvable for P -free graphs. Theorem 4 now follows from this result, Theorem 1, andLemmas 17 and 18, together with the results showing that the Feedback Vertex Set problem (that is,
Weighted Subset Feedback Vertex Set with T = ∅ and w ≡
1) is NP -complete on H -free graphs whenever H has a cycle [24] or a claw [27]. (cid:73) Theorem 4 (restated).
Let H be a graph with H / ∈ { P + P , P + P , P + P } . Then Weighted Subset Feedback Vertex Set on H -free graphs is polynomial-time solvableif H ⊆ i P + P , P + P , or P , and is NP -complete otherwise. We have considered
Weighted Subset Odd Cycle Transversal and obtained analmost-complete classification of the problem on H -free graphs leaving only three open cases,namely when H is one of 2 P + P , P + P , or 2 P + P . We also proved several newresults for Weighted Subset Feedback Vertex Set for H -free graphs, and our currentunderstanding of the complexity of both problems for H -free graphs is now identical. Inparticular, we have shown that Odd Cycle Transversal is an example of a problem thatfor some hereditary classes is tractable, but the weighted variant is hard.We note that the cases where H ∈ { P + P , P + P } are open for Odd CycleTransversal and
Feedback Vertex Set as well, and refer to Table 1 for all theunresolved cases of the problems in our setting. As a final remark, one of the most naturaltransversal problems is
Vertex Cover , which can be solved in polynomial time on bothclaw-free graphs [25] and P -free graphs [1]. The complexity of (Weighted) Subset VertexCover is unknown for claw-free graphs and even for P -free graphs.We note finally that that there are other similar transversal problems that have beenstudied, but their complexities on H -free graphs have not been considered: (Subset) EvenCycle Transversal [17, 20], for example. Versions of the transversal problems that wehave considered that have the additional constraint that the transversal must induce either aconnected graph or an independent set have also been studied for H -free graphs [5, 8, 12, 16].An interesting direction for further research is to consider the subset variant of these problems,and, more generally, to understand the relationships amongst the computational complexitiesof all these problems. References Tara Abrishami, Maria Chudnovsky, Marcin Pilipczuk, Paweł Rzążewski, and Paul Seymour.Induced subgraphs of bounded treewidth and the container method.
CoRR , abs/2003.05185,2020. Egon Balas and Chang Sung Yu. On graphs with polynomially solvable maximum-weightclique problem.
Networks , 19:247–253, 1989. Benjamin Bergougnoux, Charis Papadopoulos, and Jan Arne Telle. Node multiway cut andsubset feedback vertex set on graphs of bounded mim-width.
Proc. WG 2020, LNCS , toappear. Hans L. Bodlaender and Rolf H. Möhring. The pathwidth and treewidth of cographs.
SIAMJournal on Discrete Mathematics , 6:181–188, 1993. Marthe Bonamy, Konrad K. Dabrowski, Carl Feghali, Matthew Johnson, and Daniël Paulusma.Independent feedback vertex set for P -free graphs. Algorithmica , 81:1342–1369, 2019. . Brettell, M. Johnson, and D. Paulusma 23 Andreas Brandstädt, Van Bang Le, and Jeremy P. Spinrad.
Graph Classes: A Survey , volume 3of
SIAM Monographs on Discrete Mathematics and Applications . SIAM, 1999. Nick Brettell, Matthew Johnson, Giacomo Paesani, and Daniël Paulusma. Computing subsettransversals in H -free graphs. Proc. WG 2020, LNCS , to appear. Nina Chiarelli, Tatiana R. Hartinger, Matthew Johnson, Martin Milanič, and Daniël Paulusma.Minimum connected transversals in graphs: New hardness results and tractable cases usingthe price of connectivity.
Theoretical Computer Science , 705:75–83, 2018. Derek G. Corneil, H. Lerchs, and L. Stewart Burlingham. Complement reducible graphs.
Discrete Applied Mathematics , 3:163–174, 1981. Derek G. Corneil, Yehoshua Perl, and Lorna K. Stewart. A linear recognition algorithm forcographs.
SIAM Journal on Computing , 14:926–934, 1985. Konrad K. Dabrowski, Carl Feghali, Matthew Johnson, Giacomo Paesani, Daniël Paulusma,and Paweł Rzążewski. On cycle transversals and their connected variants in the absence of asmall linear forest.
Algorithmica , to appear. Konrad K. Dabrowski, Matthew Johnson, Giacomo Paesani, Daniël Paulusma, and ViktorZamaraev. On the price of independence for vertex cover, feedback vertex set and odd cycletransversal.
Proc. MFCS 2018, LIPIcs , 117:63:1–63:15, 2018. Fedor V. Fomin, Pinar Heggernes, Dieter Kratsch, Charis Papadopoulos, and Yngve Villanger.Enumerating minimal subset feedback vertex sets.
Algorithmica , 69:216–231, 2014. Michael R. Garey and David S. Johnson.
Computers and Intractability; A Guide to the Theoryof NP-Completeness . W. H. Freeman & Co., New York, NY, USA, 1979. Andrzej Grzesik, Tereza Klimošová, Marcin Pilipczuk, and MichałPilipczuk. Polynomial-timealgorithm for maximum weight independent set on P -free graphs. Proc. SODA 2019 , pages1257–1271, 2019. Matthew Johnson, Giacomo Paesani, and Daniël Paulusma. Connected vertex cover for( sP + P )-free graphs. Algorithmica , 82:20–40, 2020. Naonori Kakimura, Ken-ichi Kawarabayashi, and Yusuke Kobayashi. Erdős-Pósa propertyand its algorithmic applications: parity constraints, subset feedback set, and subset packing.
Proc. SODA 2012 , pages 1726–1736, 2012. Daniel Lokshtanov, Martin Vatshelle, and Yngve Villanger. Independent set in P -free graphsin polynomial time. Proc. SODA 2014 , pages 570–581, 2014. Vadim Lozin, Dmitriy Malyshev, Raffaele Mosca, and Viktor Zamaraev. Independent domina-tion versus weighted independent domination.
Information Processing Letters , 156:105914,2020. Pranabendu Misra, Venkatesh Raman, M. S. Ramanujan, and Saket Saurabh. Parameterizedalgorithms for even cycle transversal.
Proc. WG 2012 , pages 172–183, 2012. Stephan Olariu. Paw-free graphs.
Information Processing Letters , 28(1):53–54, 1988. Charis Papadopoulos and Spyridon Tzimas. Polynomial-time algorithms for the subset feedbackvertex set problem on interval graphs and permutation graphs.
Discrete Applied Mathematics ,258:204–221, 2019. Charis Papadopoulos and Spyridon Tzimas. Subset feedback vertex set on graphs of boundedindependent set size.
Theoretical Computer Science , 814:177–188, 2020. Svatopluk Poljak. A note on stable sets and colorings of graphs.
Commentationes MathematicaeUniversitatis Carolinae , 15:307–309, 1974. Najiba Sbihi. Algorithme de recherche d’un stable de cardinalite maximum dans un graphesans etoile.
Discret. Math. , 29:53–76, 1980. Benno Schwikowski and Ewald Speckenmeyer. On enumerating all minimal solutions offeedback problems.
Discrete Applied Mathematics , 117:253–265, 2002. Ewald Speckenmeyer.
Untersuchungen zum Feedback Vertex Set Problem in ungerichtetenGraphen . PhD thesis, Universität Paderborn, 1983. H -Free Graphs Shuji Tsukiyama, Mikio Ide, Hiromu Ariyoshi, and Isao Shirakawa. A new algorithm forgenerating all the maximal independent sets.
SIAM Journal on Computing , 6(3):505–517,1977.
A The Proof of Lemma 10
We mimic the proof of the unweighted variant of
Subset Feedback Vertex Set from [7].We first need some further preliminaries.Let G and G be two vertex-disjoint graphs. The union operation + creates the disjointunion G + G of G and G (recall that G + G is the graph with vertex set V ( G ) ∪ V ( G )and edge set E ( G ) ∪ E ( G )). The join operation adds an edge between every vertex of G and every vertex of G . The graph G is a cograph if G can be generated from independentvertices by a sequence of join and union operations. A graph is a cograph if and only if itis P -free (see, for example, [6]). It is also well known [9] that a graph G is a cograph ifand only if G allows a unique tree decomposition called the cotree T G of G , which has thefollowing properties:1. The root r of T G corresponds to the graph G r = G .2. Each leaf x of T G corresponds to exactly one vertex of G , and vice versa. Hence x corresponds to a unique single-vertex graph G x .3. Each internal node x of T G has at least two children, is labelled ⊕ or ⊗ , and correspondsto an induced subgraph G x of G defined as follows:if x is a ⊕ -node, then G x is the disjoint union of all graphs G y where y is a child of x ;if x is a ⊗ -node, then G x is the join of all graphs G y where y is a child of x .4. Labels of internal nodes on the (unique) path from any leaf to r alternate between ⊕ and ⊗ .Note that T G has O ( n ) vertices. We modify T G into a modified cotree T G in which eachinternal node has exactly two children but (4) no longer holds. The following well-knownprocedure (see for example [4]) achieves this. If an internal node x of T G has more than twochildren y and y , remove the edges xy and xy and add a new vertex x with edges xx , x y and x y . If x is a ⊕ -node, then x is a ⊕ -node. If x is a ⊗ -node, then x is a ⊗ -node.Applying this rule exhaustively yields T G . As T G has O ( n ) vertices, constructing T G from T G takes linear time. This leads to the following result, due to Corneil, Perl and Stewart,who proved it for cotrees. (cid:73) Lemma 19 ([10]) . Let G be a graph with n vertices and m edges. Then deciding whether ornot G is a cograph, and constructing a modified cotree T G (if it exists) takes time O ( n + m ) . We require a result for the weighted subset variant of
Vertex Cover , which we nowformally define. For a graph G = ( V, E ) and a set T ⊆ V , a set S T ⊆ V is a T -vertex cover if S T has at least contains one vertex incident to every edge that is incident to a vertex of T . Weighted Subset Vertex Cover
Instance: a graph G , a subset T ⊆ V ( G ), a non-negative vertex weighting w and aninteger k ≥ Question: does G have a T -vertex cover S T with | w ( S T ) | ≤ k ? The following result is proven in the same way as the unweighted variant of
Subset VertexCover in [7]. . Brettell, M. Johnson, and D. Paulusma 25 (cid:73)
Lemma 20.
Weighted Subset Vertex Cover can be solved in polynomial time for P -free graphs. Proof.
Let G be a cograph with n vertices and m edges. First construct a modified cotree T G and then consider each node of T G starting at the leaves of T G and ending at the root r . Let x be a node of T G . We let S x denote a minimum weight ( T ∩ V ( G x ))-vertex cover of G x .If x is a leaf, then G x is a 1-vertex graph. Hence, we can let S x = ∅ . Now suppose that x is a ⊕ -node. Let y and z be the two children of x . Then, as G x is the disjoint union of G y and G z , we can let S x = S y ∪ S z . Finally suppose that x is a ⊗ -node. Let y and z be thetwo children of x . As G x is the join of G y and G z we observe the following: if V ( G x ) \ S x contains a vertex of T ∩ V ( G y ), then V ( G z ) ⊆ S x . Similarly, if V ( G x ) \ S x contains a vertexof T ∩ V ( G z ), then V ( G y ) ⊆ S x . Hence, we let S x be a set with minimum weight from S y ∪ V ( G z ), S z ∪ V ( G y ) and T ∩ V ( G x ).Constructing T G takes O ( n + m ) time by Lemma 19. As T G has O ( n ) nodes and processinga node takes O (1) time, the total running time is O ( n + m ). (cid:74) We are now ready to give the proof of Lemma 10. (cid:73)
Lemma 10 (restated).
Weighted Subset Odd Cycle Transversal is polynomial-time solvable for P -free graphs. Proof.
Let G be a cograph with n vertices and m edges. First construct the modifiedcotree T G and then consider each node of T G starting at the leaves of T G and ending inits root r . Let x be a node of T G . We let S x denote a minimum odd ( T ∩ V ( G x ))-cycletransversal of G x .If x is a leaf, then G x is a 1-vertex graph. Hence, we can let S x = ∅ . Now suppose that x is a ⊕ -node. Let y and z be the two children of x . Then, as G x is the disjoint union of G y and G z , we let S x = S y ∪ S z .Finally suppose that x is a ⊗ -node. Let y and z be the two children of x . Let T y = T ∩ V ( G y ) and T z = T ∩ V ( G z ). Let B x = V ( G x ) \ S x . As G x is the join of G y and G z weobserve the following. If B x ∩ V ( G y ) contains two adjacent vertices, at least one of whichbelongs to T x , then B x ∩ V ( G z ) = ∅ (as otherwise G [ B x ] has a triangle containing a vertexof T ) and thus V ( G z ) ⊆ S x . In this case we may assume that S x = S y ∪ V ( G z ). Similarly,if B x ∩ V ( G z ) contains two adjacent vertices, at least one of which belongs to T x , then B x ∩ V ( G y ) = ∅ and thus V ( G y ) ⊆ S x . In this case we may assume that S x = S z ∪ V ( G y ).It remains to examine the case where both the vertices of T y that belong to B x ∩ V ( G y )are isolated vertices in G x [ B x ∩ V ( G y )] and the vertices of T z that belong to B x ∩ V ( G z ) areisolated vertices in G x [ B x ∩ V ( G z )]. This is exactly the case when S x ∩ V ( G y ) is a T y -vertexcover of G y and S x ∩ V ( G z ) is a T z -vertex cover of G z . We can compute these two vertexcovers in polynomial time using Lemma 20 and compare the weight of their union with theweights of T ∩ V ( G x ), S y ∪ V ( G z ), and S z ∪ V ( G y ). Let S x be a smallest set amongst thesefour sets.Constructing T G takes O ( n + m ) time by Lemma 19. As T G has O ( n ) nodes and processinga node takes O ( n + m ) time (due to the application of Lemma 20), the total running time is O ( n + mn ).).