finding odd cycle transversals
TRANSCRIPT
Available online at www.sciencedirect.com
Operations Research Letters 32 (2004) 299–301
OperationsResearchLetters
www.elsevier.com/locate/dsw
Finding odd cycle transversals
Bruce Reeda, Kaleigh Smithb, Adrian Vettac;∗
aSchool of Computer Science, McGill University, Room 301, McConnell Engineering Building, 3480 University,Montreal, Qu#ebec, Canada H3A 2A7
bSchool of Computer Science, McGill University, Room 318, McConnell Engineering Building, 3480 University,Montreal, Qu#ebec, Canada H3A 2A7
cDepartment of Mathematics and Statistics and School of Computer Science, McGill University, Room 1118, Burnside Building,805 Sherbrooke, Montreal, Qu#ebec, Canada H3A 2K6
Received 21 September 2003; received in revised form 13 October 2003; accepted 31 October 2003
Abstract
We present an O(mn) algorithm to determine whether a graph G with m edges and n vertices has an odd cycle transversalof order at most k, for any -xed k. We also obtain an algorithm that determines, in the same time, whether a graph has ahalf integral packing of odd cycles of weight k.c© 2003 Elsevier B.V. All rights reserved.
Keywords: Odd cycle transversal; Odd cycle packing; Bipartite graph
1. The algorithm
Finding a minimum transversal (or cover) for theset of odd cycles in a graph G is a fundamental prob-lem in combinatorial optimization. Determining aminimum edge transversal is equivalent to the classicNP-complete problem, maximum cut [1]. Moreover,an easy reduction shows that the minimum vertextransversal problem contains the maximum cut prob-lem as a special case. The vertex version also hasdirect applications in combinatorial biology (see, forexample, [3]). In these applications, the transversalsare typically small.We can, trivially, determine whether a graph has an
odd cycle transversal containing k vertices via bruteforce enumeration in O(mnk) time. In this note, we
∗ Corresponding author.E-mail address: [email protected] (A. Vetta).
present, for each -xed k, an algorithm with thefollowing speci-cations:
Algorithm: ODDCYCLETRANSVERSAL (k)Input: A graph G.Output: Either a set Y of at most k vertices of G
which intersects every odd cycle, or the informationthat no such set exists.Running time: O(4kkmn).
Our algorithm is recursive, we choose an arbitraryvertex v and then call ODDCYCLETRANSVERSAL(k) onthe graphG−v. IfG−v contains no odd cycle transver-sal of magnitude at most k, then neither does G, andwe return this fact. Otherwise, we let X
′be the odd
cycle transversal returned by the recursive call andnote that X = X
′+ v is an odd cycle transversal of G
of size at most k + 1. If |X |6 k then we simply re-turn X . Otherwise the algorithm implements a subrou-tine which, when given an odd cycle transversal with
0167-6377/$ - see front matter c© 2003 Elsevier B.V. All rights reserved.doi:10.1016/j.orl.2003.10.009
300 B. Reed et al. / Operations Research Letters 32 (2004) 299–301
k+1 vertices, determines whether the graph has an oddcycle transversal with k or fewer vertices. The subrou-tine outputs such a transversal if one exists and runs inO(4kkm) time. Solving the resultant recurrence givesthe claimed overall running time for the algorithm. Itremains only to describe the subroutine.
2. Transversals and �ows
Given a graph G= (V; E), an odd cycle transversalX of G, and a partition of G − X into two stable setsS1 and S2, we construct an auxiliary bipartite graphG
′as follows. The vertex set of the auxiliary graph
is V ′ = V − X + {x1; x2 : x∈X }. We maintain aone-to-one correspondence between the edges of Gand the edges of the auxiliary graph by the followingscheme:
(i) For an edge e of G−X there is a correspondingedge in G
′with the same endpoints.
(ii) For an edge e∈G joining a vertex y in Si to avertex x in X the corresponding edge of G
′joins
y to x3−i.(iii) For an edge e∈G joining two vertices x and y
in X then the corresponding edge of G′either
(arbitrarily) joins x1 to y2 or joins y1 to x2.
Observe that G′has a 2-colouring using the stable
sets S1 ∪ {x1 : x∈X } and S2 ∪ {x2 : x∈X }. Given asubset Y of X we say that a partition of Y
′= {y1; y2 :
y∈Y} into two sets YA and YB is valid if, ∀y∈Y ,exactly one of {y1; y2} is in YA. We let S=S1∪S2, andalso use the notation G′[U ] to refer to the subgraph ofG′ induced by the vertex set U ⊆ V ′. Our interest inthe auxiliary graph is then motivated by the followinglemma.
Lemma 1. An odd cycle transversal X is of minimumsize if and only if for any valid partition (YA; YB) ofany subset Y of X there are |Y | vertex disjoint pathsfrom YA to YB in G
′[YA ∪ YB ∪ S].
Proof. (⇒) Take a minimum transversal X whoseremoval produces two stable sets S1 and S2. Let Y ⊆ Xhave a valid partition (YA; YB) with less than |Y | vertexdisjoint paths from YA to YB in G
′[YA ∪ YB ∪ S]. Then
take a cutset W ′ separating YA from YB of magnitude
less than |Y | in G′[YA ∪ YB ∪ S]. We de-ne the set
of vertices W in G corresponding to W ′ as follows.A vertex w is in W if, either w∈W ′, or w∈X and atleast one of its copies w1; w2 is inW ′. It is then easy toshow that W ∪ (X − Y ) is an odd cycle transversal inG. Since |W |6 |W ′|, this contradicts the minimalityof X .(⇐) Take a transversal X and suppose that GX is a
smaller transversal whose removal produces two sta-ble sets GS1 and GS2. Set Y =X − GX , with valid partition(YA; YB) de-ned by
YA = {y1 : y∈Y ∩ GS1} ∪ {y2 : y∈Y ∩ GS2};YB = {y2 : y∈Y ∩ GS1} ∪ {y1 : y∈Y ∩ GS2}:
We claim that there are not |Y | vertex disjoint pathsfrom YA to YB in G
′[YA ∪ YB ∪ S]. To prove this we
will show that GX − X is a cutset of G′[YA ∪ YB ∪ S]
separating YA from YB. Since | GX −X |¡ |Y |, this givesthe claim. Take a minimal path P from YA to YB inG′[(YA ∪ YB ∪ S) − ( GX − X )]. We may assume thatthe endpoints of P are u and v, respectively. More-over, by minimality, none of the internal vertices of Pare in Y ′. By symmetry, we may also assume eitherthat {u; v} ∈Y ∩ GS1 or that u∈Y ∩ GS1 and v∈Y ∩ GS2.Consider now the former case. We have that u = y1for some y∈Y and v=w2 for some w∈Y . Therefore,the path P has odd length. However, by de-nition, Pcontains no copy of a vertex in GX . Hence, P must haveeven length as u; v∈ GS1. We obtain a similar contra-diction in the latter case.
Using this lemma, we obtain our aforementionedsubroutine. Given an odd cycle transversal X of mag-nitude k + 1, we can test for a smaller transversal bysolving a maximum Jow problem for each choice ofsets YA and YB as in the statement of the lemma. Thereare 2|X | = 2k+1 choices for Y and, given Y , there are2|Y |6 2k+1 choices for YA and YB. Since we can solvea maximum Jow problem with demand d on a graphwith m edges in O(dm) time, our subroutine can in-deed be implemented in O(4kkm) time. This gives ourmain result.
Theorem 2. For any >xed k, there is an O(mn) timealgorithm to determine whether a graph contains anodd cycle transversal of order k.
B. Reed et al. / Operations Research Letters 32 (2004) 299–301 301
3. Concluding remarks
It is shown in [2] that, for all k, there is an nksuch that every graph either has a set of 2k odd cy-cles such that each vertex is in at most two of thesecycles, or it has an odd cycle transversal with atmost nk vertices. Furthermore, as described in thelast section of [2], given an odd cycle transversalof order nk , we can test for the existence of such aset of 2k odd cycles in O(mn) time. Using this andODDCYCLETRANSVERSAL(nk) we obtain the followingresult.
Theorem 3. For any >xed k, there is an O(mn) timealgorithm to determine whether a graph contains ahalf integral packing of 2k odd cycles.
Using results of Robertson and Seymour [4] aboutrouting in graphs with large clique minors and thetechniques of [2], we can actually preprocess our input
to the algorithm ODDCYCLETRANSVERSAL(k) so that ithas O(n) edges. This preprocessing takes O(n2) timeand improves the running time of the algorithm tomatch this. We omit the messy argument. Obtaininga linear time algorithm remains an interesting openproblem.
References
[1] R. Karp, Reducibility among combinatorial problems, in:R. Miller, J. Thatcher (Eds.), Complexity of ComputerComputations, Plenum Press, New York, 1972, pp. 85–103.
[2] B. Reed, Mangoes and blueberries, Combinatorica 19 (2)(1999) 267–296.
[3] R. Rizzi, V. Bafna, S. Istrail, G. Lancia, Practical algorithmsand -xed-parameter tractability for the single individual SNPhaplotyping problem, Algorithms in Bioinformatics: SecondInternational Workshop, Lecture Notes in Computer Science,Vol. 2452, Springer, Berlin, 2002, pp. 29–43.
[4] N. Robertson, P. Seymour, Graph Minors. XIII. The disjointpaths problem, J. Combin. Theory Ser. B 63 (1) (1995)65–110.