parameterized tractability of multiway cut with parity ...daniello/papers/pmwc_icalp.pdf ·...

34
Parameterized Tractability of Multiway Cut with Parity Constraints Daniel Lokshtanov 1 and M. S. Ramanujan 2 1 University of California, San Diego, USA. [email protected] 2 The Institute of Mathematical Sciences, Chennai, India. [email protected] Abstract. In this paper, we study a parity based generalization of the classi- cal MULTIWAY CUT problem. Formally, we study the PARITY MULTIWAY CUT problem, where the input is a graph G, vertex subsets Te and To (T = Te To) called terminals, a positive integer k and the objective is to test whether there exists a k-sized vertex subset S such that S intersects all odd paths from v To to T \{v} and all even paths from v Te to T \{v}. When Te = To, this is precisely the classical MULTIWAY CUT problem. If To = then this is the EVEN MULTIWAY CUT problem and if Te = then this is the ODD MULTI - WAY CUT problem. We remark that even the problem of deciding whether there is a set of at most k vertices that intersects all odd paths between a pair of ver- tices s and t is NP-complete. Our primary motivation for studying this problem is the recently initiated parameterized study of parity versions of graphs minors (Kawarabayashi, Reed and Wollan, FOCS 2011) and separation problems similar to MULTIWAY CUT. The area of design of parameterized algorithms for graph separation problems has seen a lot of recent activity, which includes algorithms for MULTI -CUT on undirected graphs (Marx and Razgon, STOC 2011, Bousquet, Daligault and Thomass´ e, STOC 2011), k-WAY CUT (Kawarabayashi and Thorup, FOCS 2011), and MULTIWAY CUT on directed graphs (Chitnis, Hajiaghayi and Marx, SODA 2012). A second motivation is that this problem serves as a good example to illustrate the application of a generalization of important separators which we introduce, and can be applied even when most of the recently develped tools fail to apply. We believe that this could be a useful tool for several other sep- aration problems as well. We obtain this generalization by dividing the graph into slices with small boundaries and applying a divide and conquer paradigm over these slices. We show that PARITY MULTIWAY CUT is fixed parameter tractable (FPT) by giving an algorithm that runs in time f (k)n O(1) . More precisely, we show that instances of this problem with solutions of size O(log log n) can be solved in polynomial time. Along with this new notion of generalized important separators, our algorithm also combines several ideas used in previous parameter- ized algorithms for graph separation problems including the notion of important separators and randomized selection of important sets to simplify the input in- stance. 1 Introduction A fundamental min-max theorem about connectivity in graphs is Menger’s Theorem, which states that the maximum number of vertex disjoint paths between two vertices s

Upload: hacong

Post on 16-Mar-2018

223 views

Category:

Documents


2 download

TRANSCRIPT

Parameterized Tractability of Multiway Cut with ParityConstraints

Daniel Lokshtanov1 and M. S. Ramanujan2

1 University of California, San Diego, [email protected]

2 The Institute of Mathematical Sciences, Chennai, [email protected]

Abstract. In this paper, we study a parity based generalization of the classi-cal MULTIWAY CUT problem. Formally, we study the PARITY MULTIWAY CUT

problem, where the input is a graph G, vertex subsets Te and To (T = Te ∪ To)called terminals, a positive integer k and the objective is to test whether thereexists a k-sized vertex subset S such that S intersects all odd paths from v ∈ To

to T \ {v} and all even paths from v ∈ Te to T \ {v}. When Te = To, thisis precisely the classical MULTIWAY CUT problem. If To = ∅ then this is theEVEN MULTIWAY CUT problem and if Te = ∅ then this is the ODD MULTI-WAY CUT problem. We remark that even the problem of deciding whether thereis a set of at most k vertices that intersects all odd paths between a pair of ver-tices s and t is NP-complete. Our primary motivation for studying this problemis the recently initiated parameterized study of parity versions of graphs minors(Kawarabayashi, Reed and Wollan, FOCS 2011) and separation problems similarto MULTIWAY CUT. The area of design of parameterized algorithms for graphseparation problems has seen a lot of recent activity, which includes algorithmsfor MULTI-CUT on undirected graphs (Marx and Razgon, STOC 2011, Bousquet,Daligault and Thomasse, STOC 2011), k-WAY CUT (Kawarabayashi and Thorup,FOCS 2011), and MULTIWAY CUT on directed graphs (Chitnis, Hajiaghayi andMarx, SODA 2012). A second motivation is that this problem serves as a goodexample to illustrate the application of a generalization of important separatorswhich we introduce, and can be applied even when most of the recently develpedtools fail to apply. We believe that this could be a useful tool for several other sep-aration problems as well. We obtain this generalization by dividing the graph intoslices with small boundaries and applying a divide and conquer paradigm overthese slices. We show that PARITY MULTIWAY CUT is fixed parameter tractable(FPT) by giving an algorithm that runs in time f(k)nO(1). More precisely, weshow that instances of this problem with solutions of size O(log log n) can besolved in polynomial time. Along with this new notion of generalized importantseparators, our algorithm also combines several ideas used in previous parameter-ized algorithms for graph separation problems including the notion of importantseparators and randomized selection of important sets to simplify the input in-stance.

1 Introduction

A fundamental min-max theorem about connectivity in graphs is Menger’s Theorem,which states that the maximum number of vertex disjoint paths between two vertices s

and t, is equal to the minimum number of vertices whose removal separates these twovertices. Indeed, a maximum set of vertex disjoint paths between s, t and a minimumsize set of vertices separating these two vertices can be computed in polynomial time.A known generalization of this theorem, commonly known as Mader’s T -path Theo-rem [21] states that, given a graphG and a subset T of vertices, there are either k vertexdisjoint paths with only the end points in T (such paths are called T -paths and if theirlength is odd (even), then odd (even) T -paths), or there is a vertex set of size at most 2kwhich intersects every T -path. Although computing a maximum set of vertex disjointT -paths can be done in polynomial time by using matching techniques, the decisionversion of the dual problem of finding a minimum set of vertices that intersects everyT -path is NP-complete for |T | > 2. Formally, this problem is the classical MULTIWAYCUT problem, where the input is a graph G, a subset of vertices T called terminals,a positive integer k and the objective is to test whether there exists a k-sized vertexsubset that intersects every T -path. This is a very well studied problem in terms of ap-proximation, as well as parameterized algorithms [2, 9, 22]. In this paper we study ageneralization of this classical MULTIWAY CUT problem to a parity version. Formally,we study the PARITY MULTIWAY CUT problem which is defined as follows.

PARITY MULTIWAY CUT (PMWC)Instance: A graph G = (V,E), vertex subsets Te and To (T = Te ∪ To), integer k.

Parameter: kQuestion: Is there a vertex set S of size at most k which intersects

1. all odd paths from a vertex v ∈ To to some other vertex u ∈ T \ {v},2. all even paths from a vertex v ∈ Te to some other vertex u ∈ T \ {v}?

When Te = To, this is precisely the classical MULTIWAY CUT problem. If To = ∅ thenthis is the EVEN MULTIWAY CUT (EMWC) problem and if Te = ∅ then this is theODD MULTIWAY CUT (OMWC) problem.

Our main motivation for studying this particular generalization is the recently initi-ated parameterized study of parity versions of graphs minors by Kawarabayashi, Reedand Wollan [15] and separation problems similar to MULTIWAY CUT [1, 4, 23]. Thearea of design of parameterized algorithms for graph separation problems has seen a lotof recent activity, which includes algorithms for MULTI-CUT on undirected graphs [23,1], k-WAY CUT [16] and MULTIWAY CUT on directed graphs [4]. Furthermore, recently,Geelen, Gerards, Reed, Seymour and Vetta [10] proved an odd variant of Mader’s T -path Theorem. They showed that, given a graph G and a subset T of vertices, there areeither k vertex disjoint odd T -paths, or there is a vertex set of size at most 2k whichintersects every odd T -path. This result has already turned out to be useful in graphtheory [10, 18], as well as in the design of parameterized algorithms [11, 13, 14]. Thisresult was crucial in settling the parameterized complexity of finding k vertex disjointodd length cycles in a graph [14]. Observe that, this odd variant of Mader’s T -pathTheorem naturally gives rise to the OMWC problem, a special case of PMWC.

The goal of parameterized complexity is to find ways of solving NP-hard problemsmore efficiently than by brute force. Here, the aim is to restrict the combinatorial explo-sion of computational difficulty to a parameter that is hopefully much smaller than the

2

input size. Formally, a parameterization of a problem is the assignment of an integerk to each input instance and we say that a parameterized problem is fixed-parametertractable (FPT) if there is an algorithm that solves the problem in time f(k) · |I|O(1),where |I| is the size of the input instance and f is an arbitrary computable functiondepending only on the parameter k. For more background, the reader is referred to themonographs [7, 8, 25].

Unlike MULTIWAY CUT, the PMWC is already NP-complete for the case when|T | = 2. Indeed, consider the following reduction from VERTEX COVER to PMWC.Given an instance (G = (V,E), k) of VERTEX COVER, add two new vertices t1 and t2,make them both adjacent to every vertex in V , and set To = {t1, t2} and Te = ∅. Callthis new graphG′. It is easy to see thatG has a vertex cover of size at most k if and onlyif G′ has k-sized vertex subset that intersects every odd To−path. In fact, our argumentshows that OMWC is NP-complete for the case when |T | = 2. One can similarly showthat EMWC is NP-complete for the case when |T | = 2.

Marx [22] was the first to consider cut problems in the context of parameterizedcomplexity. He gave an algorithm for MULTIWAY CUT with running timeO(4k

3nO(1))

with the current fastest algorithm running in time O(2knO(1)) [5]. Even the recentdevelopments in techniques to solve graph separation problems [23] and parity basedgraph problems [17], do not seem to apply to PMWC, a natural companion of theseproblems. In this paper, we introduce a new notion of generalized important separators,which along with the tools used to solve parameterized cut problems like MULTIWAYCUT and MULTI-CUT, allows us to design an FPT algorithm for PMWC. In general,this notion seems to allow us to bring a number of problems under a single umbrella,and in particular we demonstrate its application to PMWC. The main result of thispaper is the following.

Theorem 1. PMWC can be solved in time 22O(k)nO(1) time.

Our algorithm combines several ideas used in previous parameterized algorithms forgraph separation problems including the notion of important separators and randomizedselection of important sets to simplify the input instance. Furthermore, we introduce ageneralization of important separators, which we believe could be a useful tool for sev-eral other separation problems. The algorithm for PMWC has three phases, in the firstphase using a well-known technique of iterative compression, we bound the number ofeven terminals by a linear function of k. In the second phase we remove even termi-nals using the notion of generalized important separators that we define in this paperand obtain f(k) instances of OMWC. We obtain the generalized important separatorsby dividing the graph into slices with small boundaries and applying a divide and con-quer paradigm over these slices. In the final phase we solve these instances of OMWCby designing an FPT algorithm for OMWC. More precisely we obtain the followingresult.

Lemma 1. OMWC can be solved in time 22O(k)nO(1) time.

We note that OMWC can be shown to be FPT be a simple reduction to the SUBSETOCT problem which was shown to be FPT in [17]. However, such an algorithm forOMWC would have a much worse dependence on the parameter k when compared to

3

the algorithm we present in this paper. We also point out that in the case of the EMWCproblem with two terminals, we may subdivide the edges incident on one of them, thusconverting all even paths between these terminals into odd paths and vice versa. Thisreduction shows that OMWC is equivalent to EMWC in the case of two terminalsand hence Lemma 1 immediately gives an FPT algorithm for EMWC in the case oftwo terminals. We also consider the edge version of PMWC, the EDGE PARITY MUL-TIWAY CUT (EPMWC) problem, where the input is a graph G, a subset of verticesT = Te ∪ To, a positive integer k and the objective is to determine whether there existsa k-sized edge subset that intersects every even path from a vertex v ∈ Te to T \ {v}and every odd path from a vertex v ∈ To to T \ {v}. We show that this problem is alsoFPT by establishing a parameter preserving reduction from EPMWC to PMWC.

Related Work. Parity problems hold a lot of promise and remain hitherto unexploredfrom the perspective of parameterized complexity, with exceptions that are few and farbetween. The first parameterized algorithm for ODD CYCLE TRANSVERSAL, finding ak sized vertex subset that intersect all odd cycles only appeared in 2004 [28]. Recently,Kawarabayashi and Reed [13] obtained an almost linear time parameterized algorithmfor ODD CYCLE TRANSVERSAL, albeit with a much worse dependence on solutionsize than in [28]. Kawarabayashi and Reed [14] settled the parameterized complexityof ODD CYCLE PACKING, finding k vertex disjoint odd cycles in a graph, by show-ing it to be FPT. The Parameterized Complexity of ODD CYCLE PACKING was a longstanding open problem and is much more general problem than the famous DISJOINTPATHS problem, finding vertex disjoint paths between given pairs of vertices. Recently,Kawarabayashi, Reed and Wollan [15] initiated the parameterized study of parity ver-sions of graphs minors and gave an algorithm to find odd minors. Other studies includefinding odd subdivision, parity paths passing through specific vertices [12, 11]. On thecut side, as we mentioned before, the area was initiated by the paper of Marx [22].The notions used in this paper has been useful in settling parameterized complexityof variety of problems including DIRECTED FEEDBACK VERTEX SET [3], ALMOST2 SAT [27] and ABOVE GUARANTEE VERTEX COVER [27, 26]. Recently, Marx andRazgon [23] and Bousquet, Daligault and Thomasse [1] independently showed thatMULTI-CUT, finding k vertices to disconnect given pairs of terminals is FPT. Con-tinuing this line of study, Chitnis, Hajiaghayi and Marx studied MULTIWAY CUT ondirected graphs and showed it to be FPT [4].

2 Preliminaries

Given a path P , we refer to the number of edges in P as the length of P and denote itby |P |. We call a path an odd (even) path if the length of the path is odd (respectivelyeven). We refer to the parity of |P | as the parity of the path P . If P is a path from somevertex in a set X to some vertex in a set Y , we say that P is an X-Y path. If A containsa single vertex x, we say that P is an x-Y path. Given a graph G = (V,E) and T ⊆ V ,paths with only the end points in T are called T -paths and if their length is odd (even),then odd (even) T -paths. Given a vertex set S, we denote by P ∩ S, the set of verticesin S which intersect P . Given two paths P1 = v1, . . . , vl and P2 = u1, . . . , ur, such

4

that one end point of P1 (say vl) is the same vertex as some endpoint of P2 (say u1) andno other vertices of the two paths coincide, we define the concatenated path P1 +P2 asv1, . . . , vl, u2, . . . , ur. Given a walkW = v1, . . . , vl from t1 = v1 to t2 = vl, we definea closed loop (or loop) of W , as a closed walk W ′ = vi, vi+1, . . . , vj , vp, vp+1, . . . , vrwhere vi = vr and vj = vp, vi+1, . . . , vj−1 and vp+1, . . . , vr−1 are either vertex dis-joint simple paths which are subpaths of W , or are the same exact path which is asubpath of W . By deleting a closed loop W ′ = vi, . . . , vr from W , we obtain the walkW ′′ = v1, . . . , vi, vr+1, . . . , vl. Note that deleting an even closed loop does not affectthe parity of the walk, while deleting an odd closed loop flips the parity of the walk.Hence, loops of the second type (for eg. v1, v2, v1), where the two internal subpaths co-incide exactly can be removed without changing the parity of the walk since such loopsare by definition, even. Hence, in our discussions, we will assume that such loops donot occur, that is, if W ′ = vi, vi+1, . . . , vj , vp, vp+1, . . . , vr is a loop, then it is a cycle.Given a set Sc of clauses and a set Sv of variables of a 2 SAT formula F , we denoteby F \ Sc the formula obtained from F by deleting the clauses in Sc, we denote byF \ Sv the formula obtained from F be deleting the clauses which involve a variablein Sv . We denote by FSc

, the restriction of F to the clauses in Sc. In the ALMOST 2SAT(VARIABLE) problem, we are given a 2 SAT formula F , and a postive integer kand the problem is to check if there is a k-sized set of variables of F , whose deletionmakes F satisfiable.In an instance (G,Te ∪ To, k) of PMWC, the vertices in Te are called even terminalsand those in To are called odd terminals. Vertices in Te \ To are called purely eventerminals and those in To \ Te are called purely odd terminals.

3 Structural Claims

In this section we first prove some general claims that will be used in several proofslater. Following this, we define the notion of isolated and semi-isolated componentswhich we use to impose a certain useful structure on the input instance.

Lemma 2. Let G = (V,E) be a graph and let t1 and t2 be two vertices in G. Let Wbe a walk from t1 to t2. If there is no odd closed loop in W , then there is a path from t1to t2 which has the same parity as W . If there is an odd closed loop in W , then thereis a vertex u in the closed loop which has paths of both parities to t1 and paths of bothparities to t2.

Proof. Let W = v1, . . . , vl where v1 = t1 and vl = t2. Suppose that every closed loopin W is even. We prove the first statement of the lemma by induction on the number ofclosed loops in the walk W . In the base case, the number of closed loops is 0. In thiscase, the lemma is vacuously true. Now, suppose that the number of closed loops in Wis some s > 0 and assume that the statement of the lemma holds for all walks with lessthan s closed loops. Consider a closed loop W ′ in W . Since this is even, deleting it willresult in another walk W ′′ which has the same parity as W , and has less than s closedloops. By the induction hypothesis, there is a path from t1 to t2 with the same parity asW ′′. This proves the first statement of the lemma.

5

Suppose W ′ = vi, vi+1, . . . , vj , vp, vp+1, . . . , vr is an odd closed loop of W whereP1 = vi+1, . . . , vj−1 and P2 = vp+1, . . . , vr−1 are vertex disjoint simple paths whichare subpaths of W , and vi = vr and vj = vp. We assume without loss of generalitythat there is no other closed loop in walk, since we can just delete such loops if theydid exist. Since W ′ is an odd loop, at least one of P1 or P2 must have length at least 2.Without loss of generality, we assume that P1 has length at least 2. Consider the vertexvi+1. We claim that it has paths of both parity to t1 and t2. Indeed, consider the pathP3 = vi+1, vi, . . . , v1 and the path P4 = vi+1, . . . , vj , vp−1, . . . , v1. Clearly, they arepaths of opposite parities from vi+1 to t1. Similarly, we have paths of both parities tot2. This completes the proof of the second statement of the lemma.

Lemma 3. Let G = (V,E) be a graph, and let t1 and t2 be two distinct vertices of G.Suppose that every t1-t2 path in G has the same parity, and every vertex of G lies on at1-t2 path. Then, any vertex of G cannot have paths of both parity to t1 and it cannothave paths of both parity to t2.

Proof. Let v be a vertex lying on an t1-t2 path P . Let P1 be the subpath of P from t1to v and let P2 be the subpath of P from v to t2. We prove by double induction on |P1|and |P2| that v cannot have paths of both parity to t1. It is analogous to show that vcannot have paths of both parity to t2.

In the base case, first, let |P2| = 0. This implies that v = t2 and the statement ofthe lemma holds. Now, consider the base case for |P1|, that is |P1| = 0. This impliesthat v = t1 and the statement of the lemma holds. Now, assume that |P2|, |P1| > 0and that the claim holds for all smaller values of |P2| and it also holds for all smallervalues of |P1|. Let P3 be a path from v to t1 which has parity opposite to that of P1.If P3 is disjoint from P1 and P2, P3 + P2 is an odd path from t1 to t2, which is acontradiction. Hence, assume that P3 intersects P1 or P2 . Suppose P3 intersects P2

first when traversing from v to t1 and let v′ be the first vertex along P3 which occursin P2 when traversing P3 from v to t1. Let P ′3 be the subpath of P3 from v to v′, letP ′′3 be the subpath of P3 from v′ to t1, let P ′2 be the subpath of P2 from v to v′ and letP ′′2 be the subpath of P2 from v′ to t2. If P ′3 and P ′2 have differing parities, the pathsP1 +P ′3 +P ′′2 and P1 +P ′2 +P ′′2 are t1-t2 paths with differing parities, a contradiction.Hence, P ′3 and P ′2 must have the same parity. But now, v′ has two paths P ′2 + P1 andP ′′3 , to t1, which have different parities, and the subpath of P2 from v′ to t2, which isP ′′2 , has length strictly less than |P2|. But, by induction hypothesis, v′ cannot have pathsof both parity to t1, which is a contradiction. Now, suppose that P3 intersects P1 firstand let v′ be the first vertex along P3 which occurs in P2 when traversing P3 from vto t1. Let P ′3 be the subpath of P3 from v′ to v, let P ′′3 be the subpath of P3 from t1 tov′, let P ′1 be the subpath of P1 from v′ to v and let P ′′1 be the subpath of P1 from t1to v′. If P ′3 and P ′1 have differing parities, the paths P ′′1 + P ′3 + P2 and P ′′1 + P ′1 + P2

are t1-t2 paths with different parities, a contradiction. Hence, P ′3 and P ′1 must have thesame parity. But now, v′ has two paths P ′′3 and P ′1 + P2 to t1, which have differentparities and the subpath of P1 from v′ to t1, which is P ′1, has length strictly less than|P1|. But, by induction hypothesis, v′ cannot have paths of both parity to t1, which is acontradiction. This completes the proof of the lemma.

We also prove the following lemma.

6

Lemma 4. Let G = (V,E) be a graph and T be a vertex set such that every T -pathhas even parity and for every w ∈ V (G) there is a T -path containing w. Then, forevery w ∈ V , all w − T paths have the same parity.

Proof. The lemma follows by applying arguments similar to those in Lemma 3 forevery vertex w in G and for every pair t1, t2 of terminals in T such that v lies on a t1-t2path in the subgraph.

3.1 Isolated and semi-isolated components

Definition 1. Consider an instance (G,T = Te ∪ To, k) of PMWC and let S be asolution to this instance (see Fig. 1). The set of vertices not reachable from T inG\S iscalled the isolated part of S, and the set of vertices reachable from T in G \ S is calledthe non-isolated part of S. For any connected component C in the subgraph induced onthe non-isolated part, the semi-isolated part of C is the set C ′ ⊂ C of vertices whichdo not lie on a T ′-path in this subgraph, where T ′ = T ∩ C. The semi-isolated part ofS is the union of the semi-isolated part of every component in G \ S. Any connectedcomponent in the graph induced on isolated (respectively semi-isolated) part of S iscalled an isolated (similarly semi-isolated) component of S, with the reference to Sdropped if it is clear from the context.

Observation 2 Let (G,T = Te ∪ To, k) be an instance of PMWC and let S be asolution to this instance. Consider any connected component C in the graph inducedon the non-isolated part of S, let T ′ = T ∩C and let C ′ be the semi-isolated part of C.Then, the graph G[C \ C ′] is connected.

Proof. Consider a Steiner tree in G[C] connecting the vertices in T ′. Since the verticesof T ′ are connected in G[C], such a tree exists. This tree H will be a subgraph ofG[C \ C ′] since every vertex on this tree lies on some T ′−path. Now, any vertex u inG[C \ C ′] is be reachable from T ′ (in G[C \ C ′]). Since any two vertices of T ′ areconnected in H , G[C \ C ′] is connected as well.

Definition 2. Let (G,T = Te∪To, k) be an instance of PMWC and let S be a solutionto this instance. Consider any connected componentC in the non-isolated part of S andlet C ′ be the semi-isolated part of C. Then, the subgraph G[C \ C ′] is called a maincomponent of S.

Observation 3 Let (G,T = Te ∪ To, k) be an instance of PMWC and let S be asolution to this instance.(a) Any connected component of G \ S with at least two terminals contains terminalsfrom exactly one of To \ Te or Te \ To.(b) Any connected component of G \ S contains at most 2 vertices from Te.

Proof. (a) Let C be a component of G \ S containing two terminals t1 and t2 such thatt1 ∈ To and t2 ∈ Te. Then, there is a path between t1 and t2 in G \ S. If this path isodd, then it contradicts the intersection of S with every t1-T \{t1} path and if it is even,then it contradicts the intersection of S with every t2-T \ {t2} path.

7

Fig. 1. An illustration of a solution S where X isthe isolated part of S, C3 is a non-isolated com-ponent, C′3 is the semi-isolated part of C3 andC4

3 is a main component.Fig. 2. An illustration of the two subcases of case(b) in Lemma 5.

(b) Let C be a component of G \ S containing a set T ′ ⊆ Te. Consider a steiner treeon the set T ′ in G \ S. Since the steiner tree is a connected bipartite graph, if |T ′| > 2,there must be two vertices of T ′ which lie in the same partition and hence have an evenpath between them in this tree. But this is a contradiction since this even path is disjointfrom S.

Lemma 5. Let (G,T = Te∪To, k) be an instance of PMWC and let S be a solution tothis instance. Then, any component in the semi-isolated part of S has a single neighborin the corresponding main component.

Proof. Consider a semi-isolated component C ′ and let C be it’s corresponding maincomponent. Since the vertices of C ′ are in the same connected component as those ofC in the graph G \ S, C ′ has at least one neighbor in C. We will now show that C ′

cannot have more than one neighbor in C.Suppose that this is not the case and let v1 and v2 be two distinct vertices in C

which are adjacent to vertices in C ′. We note that in the cases when both v1 and v2are terminals, there is a path between two terminals which intersects the semi-isolatedcomponentC ′, which is not possible by definition. Now, consider the case when exactlyone of the two vertices, say v1 is a terminal. But, v2 lies on a path between two terminals,say w1 and w2 where w1 or w2 could be v1. Consider this path and conside the twosubpaths of this path from v2 tow1 and from v2 tow2. Atleast one of these two subpathsis disjoint from v1. Hence, subpath, along with the edges from C ′ to v1 and v2 resultsin a T -path which intersects a semi-isolated component, a contradiction.

Hence, we consider the remaining case where v1,v2 /∈ T . Let P be a T -path fromt1 to t2 which contains v1. We know that such a path exists since v1 lies in a main

8

component. Let P1 be the subpath of P from t1 to v1 and let P2 be the subpath of Pfrom v1 to t2. Let P3 be a path from v2 to t3 ∈ T (t3 can be the same as t1 or t2).We know that such a path exists since v2 is in a main component. We now consider thefollowing two cases.

(a) P3 does not intersect P2 or P1. Then clearly, there are paths from t1 to t3 and t2to t3 which intersect the semi-isolated component C ′, and are disjoint from thesolution, which is a contradiction since no vertex in C ′ can lie on a T -path disjointfrom the solution.

(b) P3 intersects P2 or P1. Suppose P3 intersects P2 first (see Fig. 2) when traversingfrom v2 to t3 and let the vertex at which this intersection occurs be u. Let P ′3 bethe subpath of P3 from v2 to u and let P ′2 be the subpath of P2 from u to t2.Additionally, let P be a path from v1 to v2 such that the internal vertices of P lie inC ′. Since C ′ is a connected component, we know that such a path exists. But now,P1 + P + P ′3 + P ′2 is a t1-t2 path disjoint from S and intersecting C ′. This is acontradiction since no vertex in C ′ can lie on a T -path in G \ S.Now, suppose that P3 intersects P1 first at the vertex u. Let P ′3 be the subpath ofP3 from v2 to u, let P ′1 be the subpath of P1 from u to t1 and let P be a path fromv1 to v2 such that the internal vertices of P lie in C ′. But now, P2 + P + P ′3 + P ′1is a t2-t1 path disjoint from S and intersecting C ′. This is a contradiction since novertex in C ′ can lie on a T -path in G \ S.

This concludes the proof of the lemma.

Definition 3. Let C ′ be a semi-isolated component of S. We refer to the neighbor of C ′

in the corresponding main component as the pivot of C ′ and we denote it by χ(C ′).

4 PMWC parameterized by the solution size

The algorithm for PMWC has three phases, in the first phase using the well-knowntechnique of iterative compression, we bound the number of even terminals by 7k. Inthe second phase we remove even terminals using the notion of generalized importantseparators that we define in this section and obtain f(k) instances of OMWC. In thissection we outline the first two phases of the algorithm and in the next section we givethe details of the final phase – an FPT algorithm for OMWC.

4.1 Bounding the number of even terminals

We now describe a way to separate and remove the even terminals from the instance.We will first describe a way to reduce the given instance of PMWC to multiple (buta bounded number of) instances, each with a bounded number of even terminals, suchthat solving these instances will lead to a solution for the input instance. To this endwe will use the technique of iterative compression. In this technique, we assume that asolution of size k + 1 is part of the input, and attempt to compress it to a solution ofsize k. The method adopted usually is to begin with a subgraph that trivially admits a(k + 1)-sized solution and then expand it iteratively.

9

Given an instance (G = (V,E), T = Te ∪To, k) of PMWC, where V = {v1, . . . , vn},we define a graph Gi = G[Vi] where Vi = {v1, . . . , vi}. We iterate through the in-stances (Gi, Ti = (Te ∩ Vi) ∪ (To ∩ Vi), k) starting from i = k + 1 and for the ith

instance, with the help of a known solution Si of size at most k + 1 we try to find a so-lution Si of size at most k. Formally, the compression problem we address is following.

PMWC COMPRESSION

Instance: (G = (V,E), T= Te ∪ To, k, S) where G is an undirected graph, Te, To arevertex sets, k a postive integer and S, a PMWC of size at most k + 1.

Parameter: kQuestion: Does there exist a PMWC of size at most k for this instance?

We will reduce the PMWC problem to n− k instances of the PMWC COMPRESSIONproblem as follows. Let Ii = (Gi, (Te ∩ Vi) ∪ (To ∩ Vi), Si, k) be the ith instanceof PMWC COMPRESSION. Clearly, the set Vk+1 is a solution of size at most k + 1for the instance Ik+1. It is also easy to see that if Si−1 is a solution of size at most kfor instance Ii−1, then the set Si−1 ∪ {vi} is a solution of size at most k + 1 for theinstance Ii. We use these two observations to start off the iteration with the instance(Gk+1, (Te ∩ Vk+1) ∪ (To ∩ Vk+1), k, Sk+1 = Vk+1) and try to compute a solutionof size at most k for this instance. If there is such a solution Sk+1, we set Sk+2 =Sk+1 ∪ {vk+1} and try to compute a solution of size at most k for the instance Ik+2

and so on. If, during any iteration, the corresponding instance does not have a solutionof the required size, it implies that the original instance is also a NO instance. Finallythe solution for the original input instance will be Sn. Since there can be at most niterations, the total time taken is bounded by n times the time required to solve thePMWC COMPRESSION problem.

We will now describe a way to bound the number of even terminals in an instanceof PMWC COMPRESSION. Let (G,T = Te ∪ To, k, S) be an instance of PMWCCOMPRESSION. Fix a hypothetical solution S for this instance. We first guess the setY = S ∩ S. There are 2k+1 such possibilities. For each guess of Y , we delete it fromthe instance, and also delete vertices which are no longer relevant for the instance. Thisresults in an instance of PMWC which has a solution N = S \ Y and we are requiredto find a solution of size at most k − |Y | which is disjoint from N . Now, we show thatif the resulting instance has such a solution, then it must be the case that the number ofeven terminals in this instance is bounded.

Suppose that the resulting instance indeed has such a solution. Fix such a solutionS′. We call a component ofG\N affected if it contains some vertex of S′ and unaffectedotherwise. Clearly, there can be at most k affected components. Now, consider the un-affected components which contain even terminals. We claim that the number of suchcomponents cannot be more that 2k. Suppose this was not the case. Then there mustexist three unaffected components which contain even terminals and share a neighborin N . But this implies that there will be an even path between atleast two of these ter-minals which is disjoint from the new solution S′, a contradiction. Hence, the numberof components of N which contain even terminals is at most 3k. By Observation 3,any component can contain at most 2 even terminals. Since N contains at most k even

10

terminals, the number of even terminals in the instance is bounded by 7k. Hence, if thenumber of terminals in the instance after removing the guess Y exceeds 7k, we canreject this guess right away. Note that, even if we compute a solution of the requiredsize which is not disjoint from the set N , we can use it to continue the iteration. Hence,once we have an instance with a bounded number of even terminals, we ignore the factthat there is a solution disjoint from N and just compute any solution of the requiredsize for the corresponding PMWC instance. Since we only need to deal with PMWCinstances arising from instances of PMWC COMPRESSION, henceforth we will assumethat the given instance of PMWC contains at most 7k even terminals.

4.2 Removing even terminals

We initially perform the following preprocessing step on the given instance (G,T =Te ∪ To, k) of PMWC. For every purely odd terminal ti ∈ T \ Te, we add 2(k + 1)new vertices Ti = {t1i , . . . , t

k+1i } and Ti = {t1i , . . . , t

k+1i } and make ti adjacent to

every vertex in Ti. Finally, we add all possible edges between the sets Ti and Ti. Wenow define a new set of purely odd terminals T ′o =

⋃ti∈T\Te

Ti. That is, for every ti in

T \ Te, we replace ti with the k + 1 vertices tji in the set of purely odd terminals. Wewill now show that the resulting instance is indeed equivalent to the input instance.

Lemma 6. Given an instance (G,T = Te∪To, k) of PMWC, let (G′, T ′ = Te∪T ′o, k)be the instance obtained as a result of the terminal transformation described above (seeFig. 3). Then, (G,T, k) is a YES instance if and only if (G′, T ′, k) is a YES instance.

Fig. 3. Illustration of the terminal transformation.

Proof. Suppose that S is a solution for the instance (G,T = Te ∪To, k). We claim thatS is also a solution for the instance (G′, T ′ = Te ∪T ′o, k). Any T ′-path P in G′ \S canbe converted to a T -path of the same parity and between the corresponding terminals inG \ S by removing (if necessary) the first two and/or the last two edges of P . Hence,a path of forbidden parity in G′ \ S implies a path of forbidden parity in G \ S, acontradiction.

Conversely, suppose that S′ is a solution for the instance (G′, T ′, k). Observe that,due to our construction, we can assume without loss of generality that the solution S′

11

comprises only vertices of G. We now claim that S′ is also a solution for the instance(G,T, k). Suppose this is not the case, and let P be a t1-t2 path of forbidden parity inG \ S′. If this path was between two even terminals, then this path would exist in G′

as well, and hence would intersect S′. Hence, one of the end points of this path mustbe a purely odd terminal ti. But in this case, we also have a path of the same parityfrom tji to t2 in the graph G′ \ S′ for every j. Similarly, if necessary, we can extend theother end point by two edges to obtain a path of forbidden parity in G′ \ S′, which is acontradiction. This completes the proof of the lemma.

Due to Lemma 6, henceforth, we will assume that the given input instance is alreadyof the form described above. This also allows us to assume that the solution will bedisjoint from the set of purely odd terminals. We will now describe a procedure toreduce this instance of PMWC to an instance with no even terminals, thereby resultingin an instance of OMWC.

We fix a hypothetical solution for the PMWC instance and work with this solution.We first guess the intersection of the hypothetical solution with the set of even terminalsand delete these vertices from the graph. Let S be the subset of the solution left afterthis step, that is S is a solution for the remaining instance. We then guess the way Spartitions the even terminals into different connected components in the graph G \ S.There are at most 2|Te| possible intersections and |Te||Te| = 2O(k log k) partitions forthe even terminals. Hence, the total number of possible guesses is 2O(k log k). We saythat S conflicts with a partition if there is a component of G \ S containing terminalsfrom two distinct sets of the partition. For each guess of the partition, we attempt to finda solution which partitions the even terminals in a way which does not conflict with theguess. We fix one such guess of the partition, say P and work with this partition forthe rest of the section. In addition, note that, we can now assume that the solution S isdisjoint from the entire set of terminals. This is because we have already guessed (anddeleted) the intersection with even terminals, and it is already disjoint from the purelyodd terminals.

4.3 Important separators

The notion of important separators was formally introduced in [22] to handle the MUL-TIWAY CUT problem and the same concept was used implicitly in [2] to give an im-proved algorithm for the same problem. In this subsection, we recall some definitionsrelated to important separators and a few lemmas which will be required for our algo-rithm.

Definition 4. Let G = (V,E) be an undirected graph, let X,S ⊆ V be vertex subsets.We denote by RG(X,S) the set of vertices of G reachable from X in the graph G \ Sand we denote by NRG(X,S) the set of vertices of G\S which are not reachable fromX in the graph G \ S. We drop the subscript G if it is clear from the context.

Definition 5. LetG = (V,E) be an undirected graph and letX,Y ⊂ V be two disjointvertex sets. A subset S ⊆ V \ (X ∪ Y ) is called an X-Y separator in G if RG(X,S)∩Y = ∅ or in other words there is no path from X to Y in the graph G \S. We denote byλG(X,Y ) the size of the smallest X-Y separator in G. An X-Y separator S1 is said

12

to cover an X-Y separator S with respect to X if R(X,S1) ⊃ R(X,S) and S1 is saidto dominate S if it covers S and |S1| ≤ |S|. If the set X is clear from the context, wejust say that S1 dominates S. An X-Y separator is said to be inclusion wise minimal ifnone of its proper subsets is an X-Y separator.

Definition 6. Two X-Y separators S and S1 are said to be incomparable if neithercovers the other.

Observation 4 Let S1 and S2 be two incomparableX-Y separators. Then,R(X,S1)∩S2 6= ∅ and R(X,S2) ∩ S1 6= ∅. That is, there is a vertex of S1 reachable from X inthe graph G \ S2 and a vertex of S2 reachable from X in the graph G \ S1. Also,NR(X,S1) ∩ S2 6= ∅ and NR(X,S2) ∩ S1 6= ∅. That is, there is a vertex of S1

separated fromX in the graphG\S2 and a vertex of S2 separated fromX in the graphG \ S1.

Definition 7. Let G = (V,E) be an undirected graph, X,Y ⊂ V be vertex sets andS ⊆ V be an X-Y separator in G. We say that S is an important X-Y separator if itis inclusionwise minimal and there does not exist another X-Y separator S1 such thatS1 dominates S with respect to X .

Lemma 7. ([22]) Let G = (V,E) be an undirected graph, X,Y ⊂ V be disjointvertex sets. There exists a unique important X-Y separator S∗ of size λG(X,Y ) and itcan be computed in polynomial time.

Lemma 8. ([2]) The number of important X-Y separators of size at most k is at most4k and these can be enumerated in time O(4knO(1)).

4.4 Important separator sequences and a generalization of important separators

In this subsection we will define the notion of an important separator sequence and use itin the context of PMWC to define generalized important separators with the propertieswe require.

Definition 8. Let G = (V,E) be a graph and let X,Y ⊆ V be disjoint vertex sets. Wedefine an important X-Y separator of order i, Si to be the unique smallest importantX-Si−1 separator in G, where S0 = Y .

By Lemma 7, for every i, an important X-Y separator of order i is unique and can becomputed in polynomial time.

Definition 9. We define a smallest X-Y separator sequence I to be a set I = {Si|1 ≤i ≤ l}, where Si is an important X-Y separator of order i, for every 1 ≤ i, j ≤ l,|Si| = |Sj |, and λ(X,Sl) > λ(X,Y ), that is there is no X-Sl cut of size |Sl| (seeFig. 4).

Observation 5 Given two X-Y separators S1 and S2, we say that S1 � S2 if S2

covers S1 with respect to X . Then, (I,�) forms a total order where I is a smallestX-Y separator sequence.

13

Note that a smallest X-Y separator sequence is unique and can be computed in poly-nomial time. Observation 5 is the reason we refer to the set I as a sequence.

Lemma 9. Let P1 and P2 be two separators in I such that P1 � P2 and there is no P3

in I such that P1 � P3 � P2. Then, the size of a minimum X-Y separator which liesin the set NR(X,P1) ∩R(X,P2) is at least |P1|+ 1.

Proof. Suppose that this is not the case and let S be an X-Y separator of size |P1|which lies in the set NR(X,P1) ∩ R(X,P2). By the statement of the lemma, S /∈ I.Let i be such that P2 = Si−1 and P1 = Si, that is, P1 is the unique smallest importantX-P2 separator. But, since P1 � S � P2, and S lies in the set NR(X,P1)∩R(X,P2)it contradicts the fact that P1 is an important X-P2 separator.

The key consequence of the definition of the smallest separator sequence is that it de-fines a natural partition of the graph into slices with small boundaries. Using this, wemay restrict our search to local parts of the graph, in which case finding separators withcertain properties becomes easier. We will now describe how this concept is applied inthe context the PMWC problem.

Definition 10. Given sets X and Y and a minimal X-Y separator S, let l be the sizeof a minimum EMWC of the set X in the graph G \ S. We say that a minimal X-Yseparator S′ well dominates S (with respect to X) if S′ dominates S with respect to Xand the size of a minimum EMWC of X in the graph G \ S′ is at most l.

Note that any X-Y separator well dominates itself. Now, let T1 be any set in the parti-tion P , and let S be a minimal part of S separating T1 from T \ T1. Recall that T1 is aset of even terminals and by Observation 3, we can assume that T1 contains at most 2even terminals. We will first show that for any separator which well dominates S, thereis a solution for the PMWC instance containing this separator. Following that, we willdescribe an algorithm to compute a T1-T \ T1 separator that well dominates S.

Lemma 10. Let (G,T = Te ∪ To, k) be an instance of PMWC, let S be a solutionfor this instance, and T1 be a set in P , with T2 = T \ T1. Let S be a minimal part ofS separating T1 and T2. Let S1 be a T1-T2 separator which well dominates S. Then,there is also a solution for the instance which contains S1.

Proof. Let K be a minimum EMWC of T1 in the graphG\S and let K1 be a minimumEMWC of T1 in the graph G \ S1. We know that |S| ≥ |S1| and |K| ≥ |K1|. Now,consider the set S′ = (S \ (S ∪ K))∪ (S1∪ K1). We claim that S′ is also a solution forthe given instance. It is clear that the size of S′ is at most that of S. Hence, it remainsto show that S′ is indeed a PMWC for the given instance.

Suppose that this is not the case and let ti and tj be two terminals such that there isa path P of forbidden parity between ti and tj in the graph G \ S′. Then, there must bea vertex v ∈ S ∪ K such that the path P intersects v. Since S1 dominates S, this vertexmust be reachable from T1 in the graph G \ S. But, S1 is a T1-T2 separator. Hence, if tior tj is in T2, then the path P must intersect S1 and hence intersects S′, a contradiction.Therefore, it must be the case that ti and tj are precisely the vertices in T1. Now, sincethis path P lies entirely inside the component containing T1 in the graphG\ S1, it must

14

Fig. 4. Illustration of a smallest separator sequence

Fig. 5. Illustration of case 1 of the branching.

be the case that this path intersects K1 and this in turn implies that the path P intersectsS′, a contradiction. This completes the proof of the lemma.

Lemma 11. Let (G,T = Te ∪ To, k) be an instance of PMWC with a solution S, Pbe a partition of Te such that S does not conflict with P . Let T1 be a set in P and T2

be the set T \ T1. Let X be a minimal part of S separating T1 from T2. Then, there isan algorithm which runs in time 22O(k)

nO(1) and returns a set of at most 2O(k3) T1-T2 separators of which at least one separator well dominates X (X is also called thetarget separator for this instance).

Proof. For a given subset of vertices, the algorithm computes (if there is one) a T1-T2

separator of size at most k, which is contained in the given subset, and well dominatesX . Initially, and also when the subset is not explicitly given, we allow this subset to bethe entire vertex set of the current graph, and as we prune our search, we will definethe subset accordingly. We first fix a hypothetical minimum EMWC of T1 in the graphG \X , say K and guess the size of this set, say l.Description of algorithm. We first check if there is a T1-T2 separator of size at most kwithin the given subset Z. If not, we return NO. If there is no path from T1 to T2, thenwe return ∅. Furthermore, if k ≤ 10, then we find a T1-T2 separator well dominatingX by enumerating all T1-T2 separators of size at most k which lie inside Z. Otherwise,we compute the smallest T1-T2 separator sequence, I comprising only of the verticesof Z. We call a T1-T2 separator S′ good if the size of the minimum EMWC of T1 inthe graph G \ S′ is at most l and we call it bad otherwise. The following observationplays a crucial role in allowing us to ignore (potentially) large parts of the graph duringour search.

15

Fig. 6. Illustration of case 2 of the branching.

Fig. 7. Illustration of case 3 of the branching.

Observation 6 If a T1-T2 separator is good, all T1-T2 separators covered by this sep-arator are also good and if a T1-T2 separator is bad, all T1-T2 separators which coverthis separator are bad.

For each T1-T2 separator in I, we now determine whether the separator is good or bad.Since |T1| ≤ 2, by Lemma 1, this step takes 22O(k)

nO(1) time. Let P1 be the maximalelement of I which is good and let P2 be the minimal element of I, which is bad.That is, P1 is good and every separator in I \ {P1} which covers P1 is bad, P2 is badand every separator in I \ {P2} covered by P2 is good. If all the separators in I aregood, then P2 is defined as T2 and if all separators in I are bad, then P1 is defined asT1. We will create a number of sub-instances, recurse on each of these instances andfinally return the union of the sets returned by these recursive calls. The sub-instancesare created by exhaustive branching according to the following case analysis on the“relative position” of the target separator with P1 and P2.1. P1 covers the target separator X (see Fig. 5) or P1 = X . In this case, P1 itselfis a separator which well dominates the target separator and we have indeed found aseparator of the required kind. Hence, we return P1.2. The target separator X covers P1, but is itself covered by P2 (see Fig. 6). Let S1 bethe intersection of X with P1 and S2 be the intersection of X with P2. We first guessthe set S1. If this set is non empty, then we delete it from the graph G, and recursivelycompute a T1-T2 separator of size at most k − |S1| in the graph G \ S1, which lies inthe set NRG(T1, P1), and well dominates X \ S1 in the graph G \ S1. If the set S1 isempty and P2 6= T2, then we guess the set S2. If this set is non empty, then we deleteit from the graph and recursively compute a set containing a T1-T2 separator of size atmost k − |S2| in the graph G \ S2, which lies in the set NRG(T1, P1) ∩ RG(T1, P2),which also well dominates X \ S2 in the graph G \ S2. Finally, if the set S2 is also

16

empty, then we recursively compute a set containing a T1-T2 separator of size at mostk which is contained in the set NRG(T1, P1) ∩ RG(T1, P2) and well dominates X inthe graph G, and return this set.3. The target separatorX is incomparable with P1 (see Fig. 7). Let S1 be the intersectionofX with P1, P r1 be the intersection of P1 withRG(T1, X), Pnr1 be the rest of P1. Also,let Xr be the intersection of X with RG(T1, P1) and let Xnr be the rest of X . Since Xis incomparable with P1, by Observation 4, P r1 , Xr, Pnr1 and Xnr are non empty. Wefirst guess the set S1. If it is non empty, then we delete it from the graph and recursivelycompute a set containing a T1-T2 separator of size at most k− |S1| in the graph G \ S1

which well dominates X \ S1. If it is empty, then we guess the sets P r1 and Pnr1 andalso the sizes of the sets Xr and Xnr.We now construct a graph G′ as follows. Initially, we set G′ as the subgraph of Ginduced on the set RG(T1, P1). For every vertex in P r1 , we guess if it is in the set K,in which case, we delete it from the graph G′. From the remaining vertices of P r1 , forevery pair of vertices, we guess if there is an odd (respectively even) path betweenthem in the graph G \ S, with the internal vertices disjoint from the vertices of G′

and add an edge (respectively subdivided edge) between these vertices. We note thatit is possible to add both an edge and a subdivided edge between a pair of vertices.This completes the construction of G′. Now, we recursively compute a set containinga T1-Pnr1 separator in the graph G′, which well dominates Xr in this graph. Once wecompute this set, for each separator X ′ in the set, we delete it from the graph G and inthe resulting graph, recursively compute a set containing a T1-T2 separator which liesin the setNRG(T1, P1) and well dominatesXnr inG\X ′. Finally, we construct a newset by pairing up each separator from the first set, with the corresponding separators inthe second set, and return this new set.4. The target separator is incomparable with P2. This case is analogous to case 3.

We note that the target separator is distinct from P2 and cannot cover P2, due toObservation 6 and hence this case need not be taken into consideration.

Correctness. For each instance I for which the algorithm is called, we define a measureµ(I) = 2k− λ where k is an upper bound on the size of the separator we are searchingfor in I , and λ is the size of the smallest such separator. We prove the correctness of thealgorithm by induction on the measure µ(I).In the base case, if λ > k, then algorithm returns NO, which is clearly correct. Addi-tionally, if λ = 0, then the algorithm simply returns ∅ as the separator, which is alsocorrect. Finally, in the case when k ≤ 10, the required separator is found by a bruteforce search and hence is correct as well. We now assume that the algorithm is cor-rect on all instances with measure less than µ. Now, consider an instance I such thatµ(I) = µ.1. If case 1 is true, then the algorithm is clearly correct in returning P1.2. Suppose case 2 is true. Consider the instance I ′ obtained by deleting non empty S1.We now search for a T1-T2 separator of size at most k − |S1| in the graph G \ S1.Since P1 was a minimum T1-T2 cut, by Menger’s theorem, the graph G \ S1 will have|P1| − |S1| vertex disjoint T1-T2 paths and hence the size of the smallest T1-T2 separa-tor in the graph G \ S1 is |P1| − |S1|. Hence, µ(I ′) = µ− |S1|. Since S1 is non empty,by induction hypothesis, the algorithm is correct on the instance I ′ and hence indeed

17

computes a T1-T2 separator which well dominates X \ S1. Hence, adding the set S1 tothis separator gives us a T1-T2 separator of size at most k which well dominatesX . Thecase when S2 is non empty is analgous.Now, consider the case when both S1 and S2 are empty. By Lemma 9, any T1-T2 sep-arator which lies in the set NR(T1, P1) ∩ R(T1, P2) must have size at least |P1| + 1.Hence, µ(I ′) ≤ µ−1. By induction hypothesis, the algorithm returns a T1-T2 separatorof size at most k which well dominates X , which proves the correctness of this case.3. Suppose case 3 is true. The case when a non empty S1 is deleted from the graph iscorrect by the same arguments as that seen in the previous case. Now, consider the casewhen S1 is empty. Consider the graph G′ constructed as described in the algorithm andassume that all the guesses made while constructing it were correct. Also, let Kr be theintersection of the set K with R(T1, P1) and Knr be the rest of K.

Lemma 12. (a) The set Xr is a T1-Pnr1 separator in the graph G′ such that Kr is anEMWC of T1 in the graph G′1 \Xr.(b) Let X ′ be a T1-Pnr1 separator which well dominates Xr in the graph G′. Then, theset X ′ ∪Xnr well dominates X in the graph G.

Proof. (a) Suppose that the set Kr is not an EMWC of T1 in the graph G′ \Xr and letP be an even T1-path disjoint fromXr∪Kr. Replace any edge (respectively subdividededge) in P which was not present in G, with the corresponding path of the same parityin G \ S. It must be the case that the resulting walk, say W , is an even T1-walk in thegraph G \ S. If W was a path, then it would contradict our assumption that S was asolution for the given instance of PMWC. Hence, it must be the case that W containssome vertex twice. Observe that any vertex in W which occurs more that once must bea vertex in the set R(T1, X) \ R(T1, P1). We now claim that any vertex u ∈ P1 whichlies on W , must also lie in the main component of S containing T1.

If this was not the case and u was in a semi-isolated component, then, W must con-tain the pivot of u twice since it is a T1-walk disjoint from S. But, since u is reachablefrom T1 in the graph G \ S, the pivot of u must lie in the set R(T1, P1), in which caseit cannot appear twice in W , a contradiction. Hence, every vertex of P1 which lies onW also lies in the main component containing T1. Now, we also know that any pathbetween two vertices in the main component such that it is disjoint from S, also liesin the main component (see proof of Lemma 5). Hence, the even walk W lies entirelyinside the main component containing T1, in the graph G\S. But in this case, we knowthat there cannot be an odd closed loop in W (see Lemma 2 and Lemma 3), and hencethere exists an even T1-path disjoint from S, which is a contradiction.(b) Let K ′ be a minimum EMWC of T1 in the graph G′ \X ′. Since X ′ well dominatesXr inG′, |K ′| ≤ |Kr|. Hence, |X ′∪Xnr| ≤ |X| and |K ′∪Knr| ≤ |K| andX ′∪Xnr

is a T1-T2 separator since it separates T1 from Pnr1 and T2 from P r1 . Therefore, it is suf-ficient to show that in the graphG\ (X ′∪Xnr), the setK ′∪Knr is indeed an EMWCof T1. Suppose that this is not the case and consider an even T1-path P in the graphG \ (X ′ ∪ Xnr). By our construction of G′, there must exist an even T1-path P ′ inthe graph G′ \ X ′. But this contradicts the assumption that K ′ is an EMWC of T1 inG′ \X ′. This completes the proof of the lemma.

18

Now, let X ′ be a T1-Pnr1 separator which well dominates Xr in the graph G′. Then,due to Lemma 12, X ′ ∪Xnr is a T1-T2 separator which well dominates X in the graphG1. Hence, any T1-T2 separator which well dominates X ′ ∪ Xnr in the graph G alsowell dominates X . Therefore, we may assume that the target separator for the currentinstance I is in fact X ′ ∪ Xnr. Let X ′′ be a P r1 -T2 separator in the graph G \ X ′which well dominates Xnr and let K ′′ be a minimum EMWC of T1 in the graphG \ (X ′ ∪X ′′). Since K ′ ∪Knr is an EMWC of T1 in the graph G \ (X ′ ∪Xnr), itmust be the case that |K ′′| ≤ |K ′ ∪Knr|. Therefore, the set X ′ ∪X ′′ well dominatesX ′ ∪Xnr and hence well dominates X in the graph G.

We first search for a T1-Pnr1 separator of size at most |Xr| in the graph G′. ByMenger’s theorem, we know that there are Pnr1 vertex disjoint paths from T1 to Pnr1 ,which is also the size of the smallest T1-Pnr1 separator. Now, µ(I) = 2(|Xr|+|Xnr|)−(|Pnr1 |+|P r1 |) and µ(I ′) = 2|Xr|−|Pnr1 |, which implies that µ(I ′) = µ(I)−(2|Xnr|−|P r1 |). Since |Xnr| ≥ |P r1 |, µ(I)− µ(I ′) ≥ |Xnr|. Since Xnr is non empty, by induc-tion hypothesis, the algorithm is correct on I ′ and returns a set X ′ well dominatingXr. Now, consider the instance I ′′ which is a result of deleting Xr from G. Now,µ(I ′′) = 2|Xnr| − |P r1 |, which implies that µ(I) − µ(I ′′) ≥ |Xr|. By induction hy-pothesis, the algorithm returns a set X ′′ well dominating Xnr in the graph G \X ′ andhence the set X ′ ∪ X ′′ indeed well dominates the set X in the graph G. This provesthe correctness of this case and case 4 as well. We also make the following observation,which will be used in bounding the running time of the algorithm. For the instances I ′

and I ′′ described as above, µ = µ(I ′) +µ(I ′′). This completes the proof of correctnessof the algorithm.Running time. We will show by induction on µ(I) that the number of separators re-turned by an execution of the algorithm on instance I , N(µ(I)), is bounded by 2µ(I)3 .In each of the base cases of the algorithm, we either return a single separator of the re-quired kind or say NO. Since there are at most k choices for l, the number of separatorsreturned in the base case is at most k, and the claim clearly holds. We now assume thatthe claimed bound is true for all instances with µ(I) < µ. Now, consider an instance Isuch that µ(I) = µ.1. The number of separators returned due to case 1 is one for every choice of l, andhence at most k.2. Consider case 2. There are at most k choices for l, 4k choices for the sets S1 and S2

and for each choice, we return at most N(µ − 1) separators. Hence, by induction hy-pothesis, the number of separators returned due to case 2 is bounded by k · 4k · 2(µ−1)3 .3. Consider case 3. There are at most k choices for l, 2k choices for the set P r1 , at mostk choices for |Xnr|, at most 2k choices for the set P r1 ∩ S, at most 4k

2possible graphs

we construct and for each of these choices, we return at most N(µ1) ·N(µ2) separatorswhere µ1+µ2 = µ, which, by the induction hypothesis is at most 2(µ−1)3 ·21. Hence, thenumber of separators returned due to case 3 is bounded by k ·2k ·k ·2k ·4k2 ·2(µ−1)3 ·21.4. Similarly, the number of separators returned due to case 4 is bounded by k · 2k · k ·2k · 4k2 · 2(µ−1)3 · 21.

Using the fact that k ≤ µ ≤ 2k and k > 10, we note that the number of separatorsreturned by each case is at most 1

4 · 2µ3

, which yields the required bound. The number

19

of separators returned is hence 2O(k3). The algorithm spends 22O(k)nO(1) time at each

node of the search tree and hence, the total time taken by the algorithm is 22O(k)nO(1).

This completes the proof of the Lemma.

4.5 Proof of Theorem 1

Given Lemma 10 and Lemma 11, we do the following. Pick a set T1 in P and guess aT1-T \T1 separator well dominating the minimal part of the solution separating T1 andT \ T1. Once T1 has been separated from the rest of the terminals, we use Lemma 1 tocompute a minimum EMWC of T1 in the component containing T1. Following this, wepick another set from P , and repeat. At the end of this procedure, we will be left withan instance of PMWC with no even terminals, resulting in an instance of the OMWCproblem. In each step, we either pick a vertex in the solution or discard an even terminal.Hence the number of steps is bounded by 8k and by Lemma 11, in 22O(k)

nO(1) time,we obtain 2O(k4) instances of OMWC such that the given instance of PMWC is aYES instance if and only if one of these instances of OMWC is a YES instance. This,combined with Lemma 1 proves Theorem 1. ut

5 Odd Multiway Cut parameterized by the solution size

In this section, we prove Lemma 1 by describing an FPT algorithm for OMWC. Themain idea of this algorithm is that we reduce the instance of OMWC to an instancewith certain properties, which ensure that we can solve it in FPT time.

Lemma 13. Given an instance (G,T, k) of OMWC, let S be a solution and let C ′ besome semi-isolated component in G \ S. Then, no vertex of T occurs as a pivot of C ′.

Proof. We first recall that we have assumed some structural properties regarding theterminals of the input instance (see Lemma 6). We have already shown that if there is asolution, then there is one which is disjoint from the set of terminals. Our constructionalso ensures that for any solution, for every i, the terminals Ti occur in the same maincomponent.

We now proceed to the proof of the lemma. Suppose that for some i, the vertextji is the pivot of C ′ for some j. Hence, there is a vertex v ∈ C ′ which is adjacentto tji . But this vertex is also adjacent to the terminals tli, for every l 6= j and theseterminals are also contained in the same main component as tji . Now, we have a T -pathtji , v, t

li intersecting C ′ and disjoint from S, which contradicts the assumption that C ′

is a semi-isolated component.

The properties we require the instance of OMWC to possess, have been formalized inthe following definition.

Definition 11. An instance (G,T, k) of OMWC is said to admit a special solution ifthere is a solution S such that each component of the isolated part and semi-isolatedpart of S is a single vertex. An instance which admits a special solution is called aspecial instance.

20

Lemma 14. Let (G,T, k) be an instance of OMWC which admits a special solution.Then we can find a solution for this instance in time 2.32knO(1).

Proof. The proof is by a parameter preserving reduction to the variable version of AL-MOST 2 SAT, called the ALMOST 2 SAT(VARIABLE) problem, which can then besolved in 2.32knO(1) time [20]. The reduction is as follows. For every vertex u of thegraph, we have a variable xu. The variable xu is intended to represent the parity of T -upaths. The 2 SAT formula is constructed as follows. For every edge (t, u) where t ∈ T ,add a clause (u). For every edge (u, v) in the graph, add two clauses (xu ∨ xv) and(xu ∨ xv) to the 2 SAT formula F . This completes the construction of F . We remarkthat both these clauses will be satisfied if and only if xu and xv are assigned differ-ent values. In addition, we also remark that the subformula FP of F induced by theclauses corresponding to the edges of some odd T -path P is unsatisfiable, that is, wecannot find a satisfying assignment for it unless we delete some variables. We claimthat if (G,T, k) admits a special solution, then (F, k) is a YES instance and if (F, k) isa YES instance of ALMOST 2 SAT(VARIABLE), then (G,T, k) is also a YES instanceof OMWC.

Suppose (G,T, k) has a special solution S. Let Sv be the set of the variables cor-responding to the vertices in S. We claim that the formula F ′ = F \ Sv is satisfiable.Consider the following assignment for F ′. Assign arbitrary values to the variables cor-responding to vertices isolated from T in G \ S. For any vertex u in any main compo-nent, any T -u path must have the same parity (by Lemma 4). Assign 0 to xu if all T -upaths are even and 1 otherwise. Now, for any vertex u in the semi-isolated part, due toLemma 5, the corresponding variable remains in a single clause (whose other variablecorresponds to a vertex in a main component and already has an assignment) and hencewe assign the appropriate value to xu so as to satisfy this clause. We call clauses thussatisfied, explicitly satisfied clauses. We claim that this assignment satisfies F ′. Con-sider any clause (l1 ∨ l2) of F ′ and suppose that it is not one of the explicitly satisfiedclauses. Since this clause remains after the deletion of some variables, it must be thecase that neither of the vertices corresponding to the variables involved in the clauseare deleted. Hence, both these vertices must lie in some main component of S. Sincethere is an edge between these two vertices, they must have paths of opposite parityto T and which implies that the corresponding variables are assigned different values.Hence, this clause is satisfied.

Conversely, consider a solution Sv for the instance (F, k), let F ′ = F \Sv , and let Sbe the set of vertices corresponding to the variables in Sv . We claim that S is a solutionfor the given instance of OMWC. Suppose that this is not the case, and consider anyodd T -path P in the graph G \ S and let FP be the subformula of F induced by theclauses corresponding to the edges in P . Since none of the vertices intersecting the pathP have been deleted, it must be the case that none of the variables corresponding to thevertices along this path are in Sv . But this implies that FP remains as a subformula ofF ′ and since FP is not satisfiable, F ′ is also not satisfiable, which is a contradiction.

In the rest of the section, we will show how, given an instance of OMWC, one canreduce it to equivalent instance(s) with a special solution.

21

5.1 Parity Preserving Torsos

In this section, we consider a fixed hypothetical solution S for the input instance (G,T, k),and examine the structure of the instance with respect to this solution. Using our obser-vations, we will prove some additional structural claims and introduce definitions weneed for the description of the randomized transformation, which will help us to con-struct a special instance from the given input instance. Following that, we will describea randomized algorithm for the OMWC problem when parameterized by the solutionsize, and describe a derandomization procedure as well. We begin by defining the notionof Parity Preserving Torsos, which we will use to construct a set of equivalent instancesof the problem.

Definition 12. Let G = (V,E) be a graph and let C ⊆ V be a vertex set. The graphParity-Torso(G,C) is constructed as follows. Consider the induced subgraph G[C]and perform the following operations on it. For every pair u, v ∈ C, if there is anodd path in G from u to v whose internal vertices are not in C, then add an edge(u, v). Furthermore, for every pair u, v ∈ C, if there is an even path in G from u tov whose internal vertices are not in C, then add a subdivided edge between u and v.The resulting graph is referred to as Parity-Torso(G,C) or PT (G,C) and we call anewly added vertex which is part of a subdivided edge, a subdivision vertex.

Lemma 15. Given a graph G = (V,E) and a vertex set C, the graph PT (G,C) canbe constructed in polynomial time.

Proof. Testing if there is an even path between two vertices s and t in a graph can bedone in polynomial time [19]. Testing if there is an odd path between s and t can bedone by subdividing every edge incident on s and checking if there is an even s-t pathin this modified graph. Hence, given C, for every component X of G \ C, for everypair of vertices of C in the neigborhood of this component, we can test in polynomialtime if there is an even (respectively odd) path between these vertices, whose internalvertices lie in X . Since the number of components of G \C is at most |V | and for eachcomponent there are at most |V |2 pairs of neighbors in C, the graph PT (G,C) can beconstructed in polynomial time.

Note that intuitively, the operation Parity-Torso is designed to preserve the parity ofpaths between vertices in C. The following lemma formalizes this intuition.

Lemma 16. Let C ⊆ V and let u, v ∈ C. If a set S ⊂ C is such that all paths of somefixed parity from u to v in PT (G,C) intersect S, then all paths of the same parity fromu to v in G also intersect S.

Proof. We first define the notion of external subpaths as follows. Consider some u-vpath P and let p, q ∈ C be two vertices on this path such that the subpath of P betweenp and q contains no other vertex in C. We call this subpath of P between p and q, anexternal subpath. We now prove the following claim which we will then use to provethe statement of the lemma.

22

Claim. Given an r-s path P in G, there is a path in PT (G,C) which has the sameparity as P , contains all the vertices in P ∩ C, is disjoint from C \ P . That is, the onlyvertices on this path other than those in P ∩ C can be subdivision vertices betweenvertices in P ∩ C.

Proof. We prove the claim by induction on the number of external subpaths of P . Inthe base case, the number of external subpaths of P is 0, which implies that P containsonly vertices ofC and hence lies in PT (G,C). Thus, the claim is true for the case whenthe number of external subpaths of P is 0.

Now, suppose that the number of external subpaths of P is some t > 0 and assumethat our claim holds true for all paths with less that t external subpaths. When traversingP from r to s, let x and y be the first two vertices in C ∩ P such that the subpath ofP between x and y is an external subpath and call this subpath P . If P has odd length,then, there is an edge between x and y in the graph PT (G,C) and if P has even length,then there is a subdivided edge between x and y in the graph PT (G,C). Let P2 bethe path (edge or subdivided edge) in PT (G,C) between x and y which has the sameparity as P . Now, let P ′ be the subpath of P from r to x and let P ′′ be the subpath of Pfrom y to s. The path P ′ lies entirely inside C and the path P ′′ is a path from y to s withless than t external subpaths. By the induction hypothesis, there is a path P1 from y tos in C which has the same parity as P ′′, contains the vertices of P ′′ ∩C and is disjointfrom C \ P ′′. But now, P ′ + P2 + P ′′ is a path from r to s in PT (G,C) which has thesame parity as P , contains the set of vertices in P ∩C and is disjoint from C \ P . Thiscompletes the proof of the claim.

We now prove the statement of the lemma as follows. Suppose that S does notintersect all paths of said parity from u to v in G, and let P be a u-v path of this parityin G \ S. By the above claim, there is a path P1 from u to v of the same parity inPT (G,C) which contains P ∩ C and is disjoint from C \ P . Since P is disjoint fromS, it must be the case that S ⊆ C \ P and hence P1 is also disjoint from S, whichis a contradiction to our assumption that S intersects all u-v paths of that parity inPT (G,C).

Definition 13. Given an instance I = (G = (V,E), T, k) of OMWC, and a set Z ⊆V \ T , we define an instance I/Z of OMWC as (PT (G,V \ Z), T, k).

Observe that, while constructing the instance I/Z, the Parity-Torso operation is ap-plied on the set V \ Z. The following lemma shows that if we compute a set Z withcertain properties, an application of the Parity-Torso operation depending on this setwill lead us to an equivalent special instance of the problem.

Lemma 17. Let I = (G = (V,E), T, k) be an instance of OMWC and let Z ⊆ V \T .If I is a NO instance, then I/Z is also a NO instance. If I has a solution S such that Zcontains the isolated and semi-isolated parts of S and Z ∩ (S ∪ T ) = ∅ (see Fig. 8),then S is a special solution for the instance I/Z.

Proof. Suppose that I/Z is a YES instance and suppose that S is a solution for thisinstance. By Lemma 16, any even T -path in I intersects S as well and hence S is a

23

Fig. 8. Illustration of an application of the parity-torso operation.

solution for I , which makes it a YES instance. This proves the first statement of thelemma.

We now prove the second statement of the lemma. Suppose that I has a solution Ssuch that Z contains the isolated and semi isolated parts of S and Z ∩ (S ∪T ) = ∅. Wewill first show that S is indeed a solution for I/Z. Before we prove this, we make thefollowing claim.

Claim. Any new edge (or subdivided edge) added between two vertices of some maincomponent during the construction of the graph PT (G,V \ Z), is due to a path whichlies entirely in the same main component.

Proof. Consider two vertices x and y in some main component and let P2 be a newlyadded edge (respectively subdivided edge) between these two vertices. Let P be a pathfrom x to y which has the same parity as P2 and has its internal vertices in Z. Since Z isdisjoint from S, the path P also is disjoint from S. If the path P intersects some isolatedor semi-isolated component, it must also intersect S, which is not possible. This impliesthat P lies entirely in the same main component as x and y. This completes the proofof the claim.

We will now prove that S is a solution for the instance I/Z as follows. Suppose thatthis is not the case, and let P be an odd path from t1 to t2 in the graph PT (G,V \Z)\S.Since the set Z contains all the isolated and semi-isolated components of S, the onlyoriginal vertices of the graph which occur in P are from a single main componentof S. By the claim above, any edge (or subdivided edge) between these vertices inPT (G,V \ Z) is due to a path lying in the main component. Hence, we can replacethe newly added edges (respectively subdivided edges) in P with the original paths inG, to get an even walk W from t1 to t2 which lies entirely inside this main component.We now claim that every closed loop in W is of even length and hence removing theseloops enables us to obtain an even path from t1 to t2. Suppose that there is an odd closedloop inW . Then, by Lemma 2, for some vertex on this odd loop, there are both odd and

24

even length paths to T , which is a contradiction to Lemma 4. Hence, every loop ofW iseven and we can remove these loops to obtain an odd T -path disjoint from S (see proofof Lemma 2), which is a contradiction to our original assumption that S is a solutionfor the instance I .

We will now show that S is indeed a special solution for the instance I/Z. We willshow this by considering each vertex of PT (G,V \Z)\S and examining the componentit belongs to. Consider a vertex v in PT (G,V \ Z) \ S. The vertex v must either bea vertex in G or a subdivision vertex added as a result of a subdivided edge. If v is avertex in G, it must occur in a main component of S in I . But this implies that v alsooccurs in a main component of S in I/Z since the Parity-Torso operation maintainsconnectivity along with parity for this vertex with respect to the other vertices disjointfrom Z. We can also argue along the same lines as in the proof of Lemma 5 that, if v isa subdivision vertex between two vertices in the main component of S in I , then it alsolies on a T -path and hence occurs in the same main component of S as these two verticesin I/Z. Now, suppose v is a subdivision vertex which occurs as a result of a subdividededge added between a vertex of S and a vertex u in some some main component of Sin I , which is disjoint from Z. Since u remains in some main component of S in I/Z,v will be a singleton semi-isolated component of S in I/Z. Finally, suppose that v isa subdivision vertex which occurs as a result of a subdivided edge added between twovertices of S. Then, v is a singleton isolated component. Hence, S is a special solutionfor the instance I/Z and this proves the second statement of the lemma.

In the following subsections, we examine the structure of such a set Z and using ourobservations, describe a method of constructing such a set.

5.2 Important components and clusters

Definition 14. We call J an important component if G[J ] is connected and N(J) is animportant J-T separator of size at most k + 1.

The motivation for the above definition is due to the following lemma, which will allowus to consider the required set Z as the union of a set of important components.

Lemma 18. Let (G,T, k) be a YES instance of OMWC. Then, there is a solution Ssuch that every component of the isolated and semi-isolated part of S is an importantcomponent.

Proof. Let S be a smallest solution for the given instance which maximizes the sum ofthe sizes of the isolated part and the semi-isolated part. We will prove that every com-ponent of the isolated and semi-isolated part of this solution is an important component.Suppose this is not so. We have the following two cases.Case 1. Suppose that some component C1 in the semi-isolated part is not an impor-tant component. Since the size of the neighborhood of C1 is at most k + 1, it must bethe case that there is an important separator K which dominates the C1-T separatorN(C1). Define the set S′ = (S \N(C1)) ∪ (K \ {w}) where w is an arbitrary vertexof K. Clearly, |S′| ≤ |S|. We claim that S′ is a solution for the given instance as well.Suppose this is not the case and let P be an odd T -path in the graph G \ S′. It must

25

be the case that this path contains some vertex v in S \ S′, which implies that v is in(N(C1) \K)∪{w}. Since v lies on a T -path, it has two vertex disjoint paths to T . ButK is an important C1-T separator dominating N(C1) and hence is a v-T separator aswell. But then, K must contain two vertices of the path P . Hence, K \ {w} containssome vertex of this T -path, which is a contradiction to our assumption that S′ is not asolution. This proves that S′ is indeed a solution. In addition, we may assume that S′

is inclusionwise minimal, that is, for every vertex of S′, there is an odd T -path whichintersects this vertex and is disjoint from the rest of S′. This is because if this werenot the case, and we have a vertex u in S′ such that every odd T -path it intersects alsointersects some vertex in S′ \ {u}, we can remove u from S′, and still have a solution.

We now claim that the sum of the sizes of the isolated and semi-isolated parts ofS′ is strictly greater than that of S, which will contradict our assumption about themaximality of S with respect to the size of the isolated and semi-isolated part.

We first observe that S′ is disjoint from the isolated part of S. If this were notthe case, then there is a vertex u of S′ in some component in the isolated part of S.Since S′ is minimal, there is an odd T -path P which intersects u and is disjoint fromS′ \ {u}. Since any T -path intersecting u must intersect S in at least two vertices, Pmust contain two vertices of S \ S′ and hence this implies the existence of two vertexdisjoint {v1, v2}-T paths for some v1, v2 ∈ S \ S′ and these paths are disjoint from uas well. But K intersects all (S \S′)-T paths and hence K \ {w} intersects at least oneof the two vertex disjoint {v1, v2}-T paths. This implies that S′ \{u} is also a solution,which contradicts the minimality of S′. Hence, S′ is disjoint from the isolated part ofS.

We now observe that S′ is also disjoint from the semi-isolated part of S. To provethis, it is sufficient to show thatK does not intersect the semi-isolated part of S. Supposethis is not the case and let u be a vertex of K which intersects some semi-isolatedcomponent of S, say C. Then, in K, we replace u with the pivot of C to get a set K ′

and claim that K ′ is a C1-T separator which dominates K. To prove this, it is enoughto show that K ′ is a C1-T separator. If this were not the case, consider a C1-T pathP which intersects u and is disjoint from χ(C). Since the path P must enter and leavethe semi-isolated component without intersecting the pivot, this implies that P containstwo vertices x and y of S∩N(C1) such that u is contained in the subpath of P betweenx and y. Let P1 be the subpath of P from y to T . Now, consider an edge e = (a, y)where a ∈ C1. We know that such an edge exists since y is in N(C1). But now, wehave a C1-T path e+ P1 disjoint from K, which is a contradiction to K being a C1-Tseparator. We have thus proved that S′ is also disjoint from the semi-isolated part of S.

We will now show that the vertices in S \ S′ are either in the isolated or semi-isolated part of S′. Following that, we will show that every vertex in the isolated orsemi-isolated part of S is also in either the isolated or semi-isolated part of S′. SinceS \S′ is non empty, these two statements imply that the sum of the sizes of the isolatedand semi-isolated components of S′ is strictly larger than that of S.

Consider a vertex v in S \ S′. Note that, in order to show that v is in an isolatedof semi-isolated component of S′, it is sufficient for us to show that there is no T -pathintersecting v in the graphG\S′. Suppose that this is not the case, and let P be a T -pathintersecting v in the graph G\S′. Then, there are two vertex disjoint paths from v to T .

26

But we know that K is an (S \ S′)-T separator and hence there can be at most one v-Tpath in the graph G \ (K \ {w}) which implies that there can be at most one path in thegraph G \ S′, which is a contradiction. Thus, we have proved that there is no T -pathintersecting v in the graph G \ S′ and hence proved that the vertices in S \ S′ are ineither the isolated or semi-isolated part of S′.

Consider a vertex v in the isolated or semi-isolated part of S. In order to show thatv is in an isolated or semi-isolated component of S′, it is sufficient for us to show thatthere is no T -path intersecting v in the graph G \ S′. Suppose that this is not the case,and let P be a T -path containing v in the graph G \ S′. Since v is in the isolated orsemi-isolated part of S, the path intersects S and hence intersects S \ S′. This impliesthat there is a vertex u ∈ S \ S′ which lies on a T -path in the graph G \ S′. But, wehave already shown that no vertex in S \ S′ can lie on a T -path in the graph G \ S′and thus we have reached a contradiction. Hence, we have proved that every vertex inthe isolated or semi-isolated part of S stays in the isolated or semi-isolated part of S′ aswell. This completes the proof for case 1.Case 2. Suppose that some component C2 in the isolated part is not an importantcomponent. Since the size of the neighborhood of C2 is at most k, it must be thecase that there is an important separator K which dominates N(C2). Define S′ =(S \ N(C2)) ∪ K. Clearly, S′ is no larger than S. We claim that S′ is also a solutionfor the given instance.

Suppose this is not the case and let P be an odd T -path in the graph G \ S′. It mustbe the case that this path contains some vertex v in S \ S′, which implies that v is in(N(C2) \K). But K is an important C2-T separator dominating N(C2) and hence isa v-T separator as well. Hence, K intersects the path P , which is a contradiction to ourassumption that S′ is not a solution. This proves that S′ is indeed a solution. In addition,we may assume that S′ is inclusionwise minimal.

We now claim that the sum of the sizes of the isolated and semi-isolated parts ofS′ is strictly greater than that of S, which will contradict our assumption about themaximality of S with respect to the size of the isolated and semi-isolated part.

We first observe that S′ is disjoint from the isolated part of S. If this were notthe case, then there is a vertex u of S′ in some component in the isolated part of S.Since S′ is minimal, there is an odd T -path P which intersects u and is disjoint fromS′ \ {u}. Since any T -path intersecting u must intersect S in at least two vertices, Pmust contain two vertices of S \ S′ and hence this implies the existence of two vertexdisjoint {v1, v2}-T paths for some v1, v2 ∈ S \ S′ and these paths are disjoint from uas well. But K intersects all (S \ S′)-T paths and this implies that S′ \ {u} is also asolution, which contradicts the minimality of S′. Hence, S′ is disjoint from the isolatedpart of S.

We now observe that S′ is also disjoint from the semi-isolated part of S. To provethis, it is sufficient to show thatK does not intersect the semi-isolated part of S. Supposethis is not the case and let u be a vertex of K which intersects some semi-isolatedcomponent of S, say C. Then, in K, we replace u with the pivot of C to get a set K ′

and claim that K ′ is a C2-T separator which dominates K. To prove this, it is enoughto show that K ′ is a C2-T separator. If this were not the case, consider a C2-T path Pwhich intersects u and is disjoint from χ(C). Since the path P must enter and leave the

27

Fig. 9. Illustration of an important cluster LA with important components J1, J2, and J3, whereN(J1) = A ∪ {v1}, N(J2) = A ∪ {v2} and N(J3) = A.

semi-isolated component without intersecting the pivot, this implies that P contains twovertices x and y of S ∩N(C2) such that u is contained in the subpath of P between xand y. Let P1 be the subpath of P from y to T . Now, consider an edge e = (a, y) wherea ∈ C2. We now that such an edge exists since y ∈ N(C2). But now, we have a C2-Tpath e+P1 disjoint from K, which is a contradiction to K being a C2-T separator. Wehave thus proved that S′ is also disjoint from the semi-isolated part of S.

We will now show that any vertex which lies in S \ S′, or in the isolated or semi-isolated part of S lies in the isolated or semi-isolated part of S′. Since S \ S′ is nonempty, this implies that the sum of the sizes of the isolated and semi-isolated compo-nents of S′ is strictly larger than that of S.

Consider a vertex v which is in S \ S′ or in the isolated or semi-isolated part of S.Note that, in order to show that v is in an isolated or semi-isolated component of S′, itis sufficient for us to show that there is no T -path intersecting v in the graph G \ S′.We know that any T -path in the graph G \ S′ intersecting S \ S′ or the isolated orsemi-isolated part of S must intersect S \ S′. But K is an (S \ S′)-T separator, whichimplies that there cannot be a T -path intersecting v in the graph G \S′. This completesthe proof for case 2.In either case, we have arrived at a contradiction and this completes the proof of thelemma.

Definition 15. For every A ⊆ V , the important cluster LA is the disjoint union ofevery important component withN(C) = A∪P where the set P has size at most 1 andcould be different for different important components (see Fig 9).

The motivation behind the definition of important clusters is that, while the number ofimportant components we are interested in may not be bounded by a function of k, thereis a function f : N → N, such that they can be partitioned into at most f(k) importantclusters.

Observation 7 Any important component can be a part of at most k + 2 importantclusters.

28

Proof. Consider an important component J and letD = N(J). The only clusters whichJ can occur in correspond to subsets of D of size at least |D| − 1. Since |D| ≤ k + 1,the number of clusters which J can occur in is at most k + 2.

Lemma 19. Every vertex v ∈ V is contained in at most 4k+1 important componentsand at most (k+2)4k+1 important clusters. Furthermore, all the important componentsand clusters can be enumerated in time O(4knO(1)).

Proof. Consider an important component J . Then, N(J) is an important v-T separa-tor for any v ∈ J . Since there are only at most 4k+1 important v-T separators, v canoccur in at most 4k+1 important components and by Observation 7, v can occur in atmost 4k+1(k + 2) important clusters. The set of important components can be com-puted by computing the set of important v-T separators for every vertex v in the graph(Lemma 8). Once the set of important components is computed, we can compute the setof important clusters by adding each important component to the appropriate clusters.By Lemma 8, this requires time O(4knO(1)).

5.3 Randomized selection of important components

We recall that our objective is to find a set Z which contains the isolated and semi-isolated part of some solution S, and is disjoint from S. By Lemma 18, we know thatthere exists such a set Z which contains only important components. Note that, if wetake the important clusters corresponding to all the subsets of the solution S and taketheir union, then this set will contain Z. Hence, Z is contained in the union of at most2k important clusters. Now, we will select important clusters randomly and computethe probability with which we will have selected a set of vertices which contains allthe isolated and semi-isolated components of some solution and is disjoint from thesolution. We first enumerate all important clusters and pick each one independently,with probability 1

2 . Call the union of all important clusters thus picked,H. We will nowcompute the probability that the setH satisfies the required properties.1. The probability thatH contains the isolated and semi-isolated part of S is equal to theprobability that we pick all the at most 2k clusters whose disjoint union is the isolatedand semi-isolated part of S. This probability is at least ( 1

2 )2k

.2. The probability that H is disjoint from S, is at least (1 − 1

2 )k(k+2)4k+1, since there

are at most k(k + 2)4k+1 important clusters intersecting S.Finally, since these two events are independent, the probability that they both occur isat least ( 1

2 )2k

(1 − 12 )k(k+2)4k+1

= 2−2O(k). Hence, by Lemma 17, with probability at

least 2−2O(k), the instance I \ H is a special instance, which can solved by applying

Lemma 14. Thus, we have a randomized algorithm (see Algorithm 5.1) for OMWCwhich has a success probability of 2−2O(k)

.

5.4 Derandomization

We derandomize the selection of important clusters by using the standard technique ofsplitters. An (n, r, r2)-splitter is a family of functions from [n] to [r2] such that for any

29

Input : An instance (G, T, k) of OMWCOutput: A solution of size at most k for the instance (G, T, k) if it exists and NO

otherwise

1 Enumerate all important components.2 Enumerate all important clusters.3 Select each cluster independently, with probability 1

2. Call the union of the selected

clusters Z.4 Construct the instance I/Z.5 Compute a solution S for this instance by reduction to an instance of ALMOST 2

SAT(VARIABLE) and solving this instance.6 if S is not NO and S is a solution to the input instance then7 return S.8 end9 return NO

Algorithm 5.1: Randomized algorithm for OMWC

r−sized subsetX of [n], there is a function in this family which is injective onX . Thereexist explicit constructions of an (n, r, r2)-splitter of size O(r6 log r log n) [24].

Let C be the set of all important clusters in G. We let P be the set of importantclusters whose disjoint union is the union of the isolated and semi-isolated parts of Sand let Q be the set of all important clusters which intersect S. We know that |C| =c ≤ n(k + 2)4k+1, |P| = p ≤ 2k, and |Q| = q ≤ k(k + 2)4k+1. For the deterministicselection of important clusters, we go through each function in a (c, p + q, (p + q)2)-splitter family F and every subset F ⊆ [(p + q)2]. For some f ∈ F and F , we selectthose sets of C which f maps to an element in F and call the union of these setsH.

We now count the number of instances returned by this algorithm. The size of thesplitter family we use is bounded by 2O(k) log n and for each function in the splitterfamily, we have

((p+q)2

p+q

)= 22O(k)

subsets F . Hence, the number of instances returned

by this algorithm is 22O(k)log n and we have the following lemma.

Lemma 20. There is an algorithm that, given an instance (G,T, k) of OMWC, runsin time 22O(k)

nO(1) and returns 22O(k)log n instances such that if I is a YES instance,

then at least one of the returned instances has a special solution and if I is a NOinstance, then all of the returned instances are NO instances.

5.5 Proof of Lemma 1

We are now ready to prove Lemma 1. In our algorithm for OMWC, we first compute theset of all important clusters and use Lemma 20 to obtain a set of instances of OMWCin 22O(k)

nO(1) time such that if the given instance is a YES instance, then at least one ofthe returned instances has a special solution. We then apply the reduction of Lemma 14to each of these instances. Each such reduction only requires polynomial time. We thensolve the resulting ALMOST 2 SAT(VARIABLE) instances and return YES if and onlyif at least one of the ALMOST 2 SAT(VARIABLE) instances was found to be a YES

30

instance. The time required to solve ALMOST 2 SAT(VARIABLE) for each instance is2O(k)nO(1). Hence, our algorithm for OMWC runs in time 22O(k)

nO(1). ut

6 EDGE PARITY MULTIWAY CUT parameterized by the solutionsize

Lemma 21. EDGE PARITY MULTIWAY CUT (EPMWC) is NP-complete for |T | ≥ 3.

Proof. It is clear that this problem is in NP. We prove the NP-hardness of EPMWC byshowing that even the edge variant of OMWC is NP-hard for |T | ≥ 3. Since OMWCis a special case of PMWC, the lemma follows. We give a polynomial time many-one reduction from the EDGE MULTIWAY CUT problem (EDGE MWC) to EDGE ODDMULTIWAY CUT (EOMWC). In the EDGE MWC problem we are given a graph G,a set of terminals T and a positive integer k and the objective is to determine if thereis a k-sized subset of edges, whose removal from the graph disconnects every pair ofterminals. EDGE MWC is NP-complete for |T | ≥ 3 [6].

Given an instance (G = (V,E), T, k) of EDGE MWC, for each terminal ti ∈ T , weadd 3k+4 vertices t1i1 , . . . , t

1ik+1

, t2i1 , . . . , t2ik+1

, t3i1 , . . . , t3ik+1

, t′i. Add an edge betweenti and tlij for every 1 ≤ j ≤ k + 1 and l ∈ {1, 3} (see Fig. 10). Add an edge betweent′i and tlij for every 1 ≤ j ≤ k + 1 and l ∈ {2, 3}. Add an edge between t1ij and t2ijfor every 1 ≤ j ≤ k + 1. Let the resulting graph be called G′. Define a new set ofterminals T ′ = {t′i|ti ∈ T}. We claim that the instance (G,T, k) is a YES instance ofEDGE MWC if and only if the instance (G′, T ′, k) is a YES instance of EOMWC.

Let S be a solution for the instance (G,T, k). We claim that S is also a solution forthe instance (G′, T ′, k). Suppose that this is not the case and consider some odd T ′-pathP in G′ \ S. Suppose the path P is from t′i to t′j . Clearly, this path has to intersect tiand tj , which implies that there is a path from ti to tj in the graph G′ \ S. Since thenewly added edges and vertices do not create any new T -paths, this path also exists inthe graph G \ S, which is a contradiction to our assumption.

Now, let S′ be a solution for the instance (G′, T ′, k). Note that S′ will not containany newly added edges. We claim that S′ is a solution for the instance (G,T, k). Sup-pose this is not the case and let P be a T -path in the graph G \ S′ from ti to tj . SinceS′ is disjoint from the newly added edges, we can extend this path P on both sidesusing the appropriate newly added edges, to get an odd T ′-path in G′ \ S′, which is acontradiction. This completes the proof.

Theorem 8. EPMWC can be solved in time 22O(k)nO(1).

Proof. The proof is by a polynomial time parameter preserving reduction to PMWCwhere the solution is required to be disjoint from the terminals. Theorem 1 also holdsfor this case ( since we assume that the solution is disjoint from the terminals fromLemma 11 onwards). Let (G = (V,E), T = Te ∪ To, k) be an instance of EPMWC.We construct a graph G′ as follows. Take the set T and for each vertex v ∈ V \ T ,make k + 1 copies v1, . . . , vk+1 of this vertex. For each edge e = (u, v) ∈ E, add two

31

Fig. 10. An illustration of the terminal gadget in Lemma 21.

Fig. 11. An illustration of the reduction from EPMWC to PMWC.

vertices xe and ye and add an edge between them (see Fig. 11). Furthermore, add anedge from each copy of u (if u ∈ T , there is a single copy) to xe and from each copyof v to ye. We call the resulting graph G′ and keep the set of terminals the same. Thiscompletes the construction. We claim that (G,T, k) is a YES instance of EPMWC ifand only if (G′, T, k) is a YES instance of PMWC where the solution is disjoint fromT .

Suppose that S is a solution of size at most k for the instance (G,T, k). For eachedge e in S, pick one of the vertices xe or ye and we claim that this set S′ forms asolution of the required kind for the instance (G′, T, k). Clearly S′ ∩ T = ∅. Now,suppose that there is a t1-t2 path P of forbidden parity in G′ \ S′. The existence of thispath implies that no vertex of the form xe or ye lying on this path has been deleted,which implies that none of the corresponding edges in the original graph were deleted.But these edges together constitute a t1-t2 path of the same parity in G disjoint from S,which is a contradiction.

32

Conversely, let S′ be a solution for the instance (G′, T, k) such that S′ ∩ T = ∅.Note that the construction of G′ then ensures that S′ only contains vertices of the formxe or ye. For each vertex xe or ye in S′, pick the corresponding edge in G and call thisset S. We claim that S is a solution for the instance (G,T, k). Clearly, |S| ≤ k. Supposethat there is a t1-t2 path P1 of forbidden parity in G \ S. Since no edge along this pathis in S, neither the xe nor the ye vertex corresponding to any edge e in this path is inS′. But this implies that existence of a t1-t2 path of the same parity in G′ \S′, which isa contradiction.

7 Conclusion

In this paper, we introduce a notion of generalized important separators and by sup-plementing this idea with randomized selection of important components, along withthe iterative compression technique, we give an FPT algorithm for a parity based gen-eralization of the classical MULTIWAY CUT problem, the PARITY MULTIWAY CUTproblem. The design of improved FPT algorithms for this problem, as well as FPTalgorithms for other parity based separation problems like the parity version of MULTI-CUT remains an interesting open problems, as does the kernelization complexity ofthese problems.

Acknowledgements

We would like to thank Saket Saurabh for the insightful discussions on graph separationproblems.

References

1. N. Bousquet, J. Daligault, and S. Thomasse. Multicut is fpt. In STOC, pages 459–468, 2011.2. J. Chen, Y. Liu, and S. Lu. An improved parameterized algorithm for the minimum node

multiway cut problem. Algorithmica, 55(1):1–13, 2009.3. J. Chen, Y. Liu, S. Lu, B. O’Sullivan, and I. Razgon. A fixed-parameter algorithm for the

directed feedback vertex set problem. J. ACM, 55(5), 2008.4. R. H. Chitnis, M. Hajiaghayi, and D. Marx. Fixed-parameter tractability of directed multiway

cut parameterized by the size of the cutset. In SODA, pages 1713–1725, 2012.5. M. Cygan, M. Pilipczuk, M. Pilipczuk, and J. O. Wojtaszczyk. On multiway cut parameter-

ized above lower bounds. IPEC, 2011.6. E. Dahlhaus, D. S. Johnson, C. H. Papadimitriou, P. D. Seymour, and M. Yannakakis. The

complexity of multiterminal cuts. Siam Journal on Computing, 23:864–894, 1994.7. R. G. Downey and M. R. Fellows. Parameterized Complexity. Springer-Verlag, New York,

1999.8. J. Flum and M. Grohe. Parameterized Complexity Theory. Texts in Theoretical Computer

Science. An EATCS Series. Springer-Verlag, Berlin, 2006.9. N. Garg, V. V. Vazirani, and M. Yannakakis. Multiway cuts in directed and node weighted

graphs. In ICALP, volume 820 of Lecture Notes in Computer Science, pages 487–498, 1994.10. J. Geelen, B. Gerards, B. A. Reed, P. D. Seymour, and A. Vetta. On the odd-minor variant of

hadwiger’s conjecture. J. Comb. Theory, Ser. B, 99(1):20–29, 2009.

33

11. K. ichi Kawarabayashi, Z. Li, and B. A. Reed. Recognizing a totally odd k4-subdivision,parity 2-disjoint rooted paths and a parity cycle through specified elements. In SODA, pages318–328, 2010.

12. K. ichi Kawarabayashi and B. A. Reed. A nearly linear time algorithm for the half integralparity disjoint paths packing problem. In SODA, pages 1183–1192, 2009.

13. K. ichi Kawarabayashi and B. A. Reed. An (almost) linear time algorithm for odd cylestransversal. In SODA, pages 365–378, 2010.

14. K. ichi Kawarabayashi and B. A. Reed. Odd cycle packing. In STOC, pages 695–704, 2010.15. K. ichi Kawarabayashi, B. A. Reed, and P. Wollan. The graph minor algorithm with parity

conditions. In FOCS, pages 27–36, 2011.16. K. ichi Kawarabayashi and M. Thorup. The minimum k-way cut of bounded size is fixed-

parameter tractable. In FOCS, pages 160–169, 2011.17. N. Kakimura, K. ichi Kawarabayashi, and Y. Kobayashi. Erdos-posa property and its algo-

rithmic applications: parity constraints, subset feedback set, and subset packing. In SODA,pages 1726–1736, 2012.

18. N. Kakimura, K. ichi Kawarabayashi, and D. Marx. Packing cycles through prescribed ver-tices. J. Comb. Theory, Ser. B, 101(5):378–381, 2011.

19. A. S. Lapaugh and C. H. Papadimitriou. The even-path problem for graphs and digraphs.Networks, 14(4):507–513, 1984.

20. D. Lokshtanov, N. S. Narayanaswamy, V. Raman, M. S. Ramanujan, and S. Saurabh. Fasterparameterized algorithms using linear programming. Manuscript, 2012.

21. W. Mader. Uber die Maximalzahl kreuzungsfreier H-Wege. Arch. Math. (Basel), 31(4):387–402, 1978/79.

22. D. Marx. Parameterized graph separation problems. Theoret. Comput. Sci., 351(3):394–406,2006.

23. D. Marx and I. Razgon. Fixed-parameter tractability of multicut parameterized by the sizeof the cutset. In STOC, pages 469–478, 2011.

24. M. Naor, L. J. Schulman, and A. Srinivasan. Splitters and near-optimal derandomization.In Proceedings of the 36th Annual Symposium on Foundations of Computer Science, FOCS’95, pages 182–191, Washington, DC, USA, 1995. IEEE Computer Society.

25. R. Niedermeier. Invitation to Fixed-Parameter Algorithms, volume 31 of Oxford LectureSeries in Mathematics and its Applications. Oxford University Press, Oxford, 2006.

26. V. Raman, M. S. Ramanujan, and S. Saurabh. Paths, flowers and vertex cover. In ESA,volume 6942 of Lecture Notes in Computer Science, pages 382–393, 2011.

27. I. Razgon and B. O’Sullivan. Almost 2-sat is fixed-parameter tractable. J. Comput. Syst. Sci.,75(8):435–450, 2009.

28. B. A. Reed, K. Smith, and A. Vetta. Finding odd cycle transversals. Oper. Res. Lett.,32(4):299–301, 2004.

34