14
Theory Comput Syst (2010) 46: 723–736 DOI 10.1007/s00224-009-9215-5 Simple and Improved Parameterized Algorithms for Multiterminal Cuts Mingyu Xiao Published online: 8 May 2009 © Springer Science+Business Media, LLC 2009 Abstract Given a graph G = (V,E) with n vertices and m edges, and a sub- set T of k vertices called terminals, the Edge (respectively, Vertex) Multitermi- nal Cut problem is to find a set of at most l edges (non-terminal vertices), whose removal from G separates each terminal from all the others. These two prob- lems are NP-hard for k 3 but well-known to be polynomial-time solvable for k = 2 by the flow technique. In this paper, based on a notion farthest minimum isolating cut, we design several simple and improved algorithms for Multitermi- nal Cut. We show that Edge Multiterminal Cut can be solved in O(2 l kT (n, m)) time and Vertex Multiterminal Cut can be solved in O(k l T (n, m)) time, where T (n, m) = O(min(n 2/3 ,m 1/2 )m) is the running time of finding a minimum (s,t) cut in an unweighted graph. Furthermore, the running time bounds of our algo- rithms can be further reduced for small values of k: Edge 3-Terminal Cut can be solved in O(1.415 l T (n, m)) time, and Vertex {3, 4, 5, 6}-Terminal Cuts can be solved in O(2.059 l T (n, m)), O(2.772 l T (n, m)), O(3.349 l T (n, m)) and O(3.857 l T (n, m)) time respectively. Our results on Multiterminal Cut can also be used to obtain faster algorithms for Multicut: O((min( 2k,l) + 1) 2k 2 l T (n, m))-time algorithm for Edge Multicut and O((2k) k+l/2 T (n, m))-time algorithm for Vertex Multicut. Keywords Graph algorithm · Parameterized algorithm · Multiterminal cut · Multicut A preliminary version of this paper was presented at the 3rd International Computer Science Symposium in Russia (CSR 2008), and appeared in [1]. The work was supported in part by UESTC Youth Science Funds and Earmarked Research Grant 410206 of the Research Grants Council of Hong Kong SAR. Most of the work was done when the author was a Ph.D. student in Department of Computer Science and Engineering, the Chinese University of Hong Kong. M. Xiao ( ) School of Computer Science and Engineering, University of Electronic Science and Technology of China, Chengdu 610054, People’s Republic of China e-mail: [email protected]

Simple and Improved Parameterized Algorithms for Multiterminal Cuts

Embed Size (px)

Citation preview

Theory Comput Syst (2010) 46: 723–736DOI 10.1007/s00224-009-9215-5

Simple and Improved Parameterized Algorithmsfor Multiterminal Cuts

Mingyu Xiao

Published online: 8 May 2009© Springer Science+Business Media, LLC 2009

Abstract Given a graph G = (V ,E) with n vertices and m edges, and a sub-set T of k vertices called terminals, the Edge (respectively, Vertex) Multitermi-nal Cut problem is to find a set of at most l edges (non-terminal vertices), whoseremoval from G separates each terminal from all the others. These two prob-lems are NP-hard for k ≥ 3 but well-known to be polynomial-time solvable fork = 2 by the flow technique. In this paper, based on a notion farthest minimumisolating cut, we design several simple and improved algorithms for Multitermi-nal Cut. We show that Edge Multiterminal Cut can be solved in O(2lkT (n,m))

time and Vertex Multiterminal Cut can be solved in O(klT (n,m)) time, whereT (n,m) = O(min(n2/3,m1/2)m) is the running time of finding a minimum (s, t)

cut in an unweighted graph. Furthermore, the running time bounds of our algo-rithms can be further reduced for small values of k: Edge 3-Terminal Cut can besolved in O(1.415lT (n,m)) time, and Vertex {3,4,5,6}-Terminal Cuts can be solvedin O(2.059lT (n,m)), O(2.772lT (n,m)), O(3.349lT (n,m)) and O(3.857lT (n,m))

time respectively. Our results on Multiterminal Cut can also be used to obtain fasteralgorithms for Multicut: O((min(

√2k, l) + 1)2k2lT (n,m))-time algorithm for Edge

Multicut and O((2k)k+l/2T (n,m))-time algorithm for Vertex Multicut.

Keywords Graph algorithm · Parameterized algorithm · Multiterminal cut ·Multicut

A preliminary version of this paper was presented at the 3rd International Computer ScienceSymposium in Russia (CSR 2008), and appeared in [1].

The work was supported in part by UESTC Youth Science Funds and Earmarked Research Grant410206 of the Research Grants Council of Hong Kong SAR. Most of the work was done when theauthor was a Ph.D. student in Department of Computer Science and Engineering, the ChineseUniversity of Hong Kong.

M. Xiao (�)School of Computer Science and Engineering, University of Electronic Science and Technologyof China, Chengdu 610054, People’s Republic of Chinae-mail: [email protected]

724 Theory Comput Syst (2010) 46: 723–736

1 Introduction

Given a graph G = (V ,E) with |V | = n vertices and |E| = m edges, positive integersk and l, and a set T ⊂ V of k vertices, called terminals, the Edge (respectively, Ver-tex) Multiterminal Cut problem is to find a subset S of at most l edges (non-terminalvertices) such that all terminals in T are in different components of G − S. Thesetwo Multiterminal Cut problems are fundamental network design problems and haveapplications in VLSI system design, parallel computing, distributed computing, clus-tering, and many others [2–4].

Dahlhaus et al. [2] initiated the study of Edge Multiterminal Cut by establish-ing its NP-hardness for each fixed k ≥ 3 and giving a polynomial-time (2 − 2/k)-approximation algorithm. Later Calinescu et al. [5] used a novel geometric relax-ation to obtain a polynomial-time (1.5 − 1/k)-approximation algorithm for EdgeMultiterminal Cut, and the current best approximation algorithm is the polynomial-time (1.3438 − εk)-approximation algorithm developed by Karger et al. [6]. Further-more, Garg et al. [7] obtained a polynomial-time (2 − 2/k)-approximation algorithmfor Vertex Multiterminal Cut, and Naor and Zosin [8] gave a polynomial-time 2-approximation algorithm for the Multiterminal Cut problem in directed graphs. Interms of exact algorithms, Edge/Vertex Multiterminal Cuts for k = 2 degenerate tothe well-known Minimum Edge/Vertex Cut problems and can be solved in polynomialtime by the flow technique and some other techniques. For k ≥ 3, Dahlhaus et al. [2]gave an O((4k)kn(2k−1) logn)-time algorithm for solving Edge Multiterminal Cut inplanar graphs, which was later improved to O(k4kn2k−4 logn) by Hartvigsen [9].Yeh [3] also gave an O(kk(n − k)2kn log(n − k))-time algorithm for Planar EdgeMultiterminal Cut. Chen and Wu [10] obtained an O(k3n + kn logn)-time algorithmfor planar graphs where all the terminals are on the boundary of a face. Marx [11]obtained a 4l3nO(1)-time algorithm for Vertex Multiterminal Cut in general graphs.Recently, Chen et al. [12] and Guillemot [13] improved Marx’s result to 4lnO(1) re-spectively.

In this paper, we concentrate on exact algorithms for Multiterminal Cut. To makethem tractable, we put much attention to the scenarios where the size l of the multiter-minal cut is small. This point of view has drawn much attention in NP-hard problemsrecently, such as Feige and Mahdian’s work [14] on finding small balanced cuts,and so on. Those who are familiar with Parameterized Complexity [15–17] will findour results positive on the fixed-parameter tractability of finding minimum multiter-minal cuts. The running time bounds of most of our algorithms are in the form off (l)|I |O(1), where f (l) is a computable function and |I | is the input size of the prob-lem, which implies that our problems are fixed-parameter tractable when l is takenas a parameter. A fixed-parameter tractable algorithm is also called a parameterizedalgorithm.

We show that Edge Multiterminal Cut can be solved in O(2k−2k−1 lkT (n,m)) time,

which implies that Edge Multiterminal Cut can be solved in polynomial timewhen l is O(logn). For Vertex Multiterminal Cut, we obtain an O(klT (n,m))-time algorithm. We also prove better running time bounds for small values of k:O(2.059lT (n,m)), O(2.772lT (n,m)), O(3.349lT (n,m)) and O(3.857lT (n,m))-time algorithms for Vertex {3,4,5,6}-Terminal Cuts respectively. Our algorithms for

Theory Comput Syst (2010) 46: 723–736 725

Edge Multiterminal Cut and Vertex {3,4,5,6}-Terminal Cuts are the fastest para-meterized algorithms so far. Furthermore, our algorithms for Multiterminal Cut canbe easily applied to another famous problem—the Multicut problem, in which weare required to separate k given pairs of terminals by deleting at most l edges or ver-tices. We show that Edge Multicut can be solved in O((min(

√2k, l)+1)2k2lT (n,m))

time and Vertex Multicut can be solved in O((2k)k+l/2T (n,m)) time. In particular,Edge Multicut and Vertex Multicut for k ≤ 5 can be solved in O(1.415lT (n,m)) andO(2.059lT (n,m)) time respectively. For most cases, our results improve the previ-ously known result of 2kl4l3nO(1) [11] on Multicut.

Our algorithms are based on some important properties of the farthest minimumisolating cut of a terminal (see the definition in Sect. 2.3) and a simple observationthat each element (an edge, or a vertex for the vertex version) in the farthest minimumisolating cut of a terminal is either in the solution or not. We arbitrarily choose oneelement and branch on it by either including it in the solution or excluding it fromthe solution. In the former branch, the size of the current solution increases by 1; andin the latter branch, we can get an equivalent graph, in which the size of the farthestminimum isolating cut of the same terminal will increase. When a solution exists, thesize of the solution and all the minimum isolating cuts are bounded by l, and thus wecan build a bounded search tree to solve both Edge and Vertex Multiterminal Cuts.

The rest of this paper is organized as follows:In Sect. 2, we first introduce some basic techniques and present some structural

properties of optimal cut problems. Farthest minimum isolating cut is a frequentlyused notion in our algorithms. Based on it, we can identify a small set of edges(vertices) in various ways to branch upon in enumerating possible minimum mul-

titerminal cuts. In Sect. 3, we present an O(2k−2k−1 lkT (n,m))-time algorithm for Edge

Multiterminal Cut (see Theorem 1). That algorithm only works for the edge ver-sion, since it will use a 2-approximation property and this property does not hold inthe vertex version. In Sect. 4, we show that Vertex Multiterminal Cut can be solvedin O(klT (n,m)) time (see Theorem 3) and faster algorithms for small values of k:O(2.059lT (n,m)), O(2.772lT (n,m)), O(3.349lT (n,m)) and O(3.857lT (n,m))-time algorithms for Vertex {3,4,5,6}-Terminal Cuts respectively (see Theorem 2).In Sect. 5, we give a reduction from Multicut to Multiterminal Cut, which leads toimprovements on Multicut.

2 Definitions and Structural Properties

2.1 Different Problem Versions

It is easy to transform an Edge Multiterminal Cut instance to a Vertex Multiter-minal Cut instance in polynomial time by using some standard techniques. But nopolynomial-time reduction in the opposite direction is found, which implies that theedge version might be easier than the vertex version. In this paper our algorithms forthe edge version are also faster than those for the vertex version. There are certainrelations between those two versions as they have similar definitions and properties,and our algorithms for the vertex version are still applicable to the edge version.

726 Theory Comput Syst (2010) 46: 723–736

Considering their similarities, we will not discuss two versions separately. In the fol-lowing sections, if no explicit statement is given, the defined terms are applicable forboth the edge and vertex versions. For the vertex version cut problems, some papers[18, 19] also discuss the case that terminals can be added to the solution. They call itunrestricted vertex version when terminals are allowed to be removed, and restrictedvertex version when terminals are not allowed to be removed. An Unrestricted VertexMultiterminal Cut instance can be reduced to a restricted vertex version instance sim-ply by adding, for each terminal ti , a new terminal t ′i adjacent only to ti . With somemodifications our algorithms for the restricted vertex version are still applicable forthe unrestricted vertex version. In this paper, we do not discuss the unrestricted ver-tex version problem individually, and vertex version always means restricted vertexversion.

2.2 Basic Definitions

In this paper, l always denotes the upper bound of the solution size, k the num-ber of terminals (or the number of terminal pairs in the Multicut problem), T ={t1, t2, . . . , tk} the terminal set, and T−i = T −{ti} the set of terminals except ti . E(G)

and V (G) denote the edge set and vertex set of graph G respectively. N(v) denotesthe set of neighbors of vertex v. For a set V ′ of vertices, N(V ′) = ⋃

v∈V ′ N(v) − V ′is called the neighbor set of V ′. For a subgraph G′ in G, an edge e is incident withG′ if e has exactly one endpoint in V (G′), and a vertex v is adjacent to G′ if v hasat least one neighbor in V (G′) and v /∈ V (G′). We call an edge (non-terminal vertex)subset an edge (vertex) multiterminal cut, if its removal separates all the terminals.Among all the multiterminal cuts, those with the minimum size are called minimummultiterminal cuts. A minimal multiterminal cut is a multiterminal cut in case thatany of its proper subsets is not a multiterminal cut.

We call a subset Ci of edges (vertices) an isolating cut of terminal ti , if its removalseparates ti from all other terminals T−i . A minimum isolating cut of ti is an isolatingcut of ti with the minimum size. A minimum isolating cut, which may not be unique,can be found by using the methods for the Minimum (s, t) Cut problem. Let S be anarbitrary minimum multiterminal cut in G. We consider the connected componentsof the graph obtained by removing S. Let CPi be the component that contains ter-minal ti . We will use Si ⊆ S to denote all the edges incident with (vertices adjacentto) CPi in G (i = 1,2, . . . , k). In Fig. 1, dash-dot lines indicate S1. Obviously, Si isthe minimum isolating cut of ti contained in S. Readers will see that the algorithmfor Edge Multiterminal Cut in Sect. 3 will use some properties of Si ’s and the vertexversion has no such good properties.

In our algorithms, we often branch on an edge (vertex) by either including orexcluding it in the solution. To exclude an edge (vertex) from the solution, we canshrink the edge (dissolve the vertex). Shrinking an edge means that we identify thetwo endpoints of it and keep all edges, including possible parallel edges, incidentwith the two endpoints, and delete self-loops. To dissolve a vertex we will deletethis vertex and all the edges incident with it, and add an edge between every pair ofnonadjacent vertices in its neighborhood. When a vertex to be dissolved is adjacentto a terminal, then we can simply implement the dissolving by shrinking the edge

Theory Comput Syst (2010) 46: 723–736 727

Fig. 1 Illustration for Si

Fig. 2 Shrinking and dissolving

between this vertex and the terminal.1 We use G · e to denote the graph after e shrinks(dissolves) in G. See Fig. 2 for an illustration for these two operations. Sometimeswe will contract a subgraph into a single vertex, i.e., we replace this subgraph witha single vertex, and keep all the edges incident with it (including parallel edges), anddelete self-loops.

2.3 Farthest Minimum Isolating Cuts

First, we introduce the notion of farthest minimum isolating cut, which leads to adeep understanding about the structure of cut problems and forms the foundation ofour algorithms. A minimum isolating cut Ci of terminal ti separates the graph intotwo components. One that contains ti is called the residual of Ci and denoted by Ri .The other one is the remaining part that contains T−i , and it is called the outsideof Ci . The farthest minimum isolating cut of terminal ti is the minimum isolating cutthat maximizes the cardinality of the residual Ri . Here we use ‘the minimum isolatingcut’ as opposed to ‘a minimum isolating cut’, since the farthest minimum isolating cutof a given terminal is unique. The uniqueness is discussed and used in the literature[2, 20–22]. It can be easily derived from the Max flow/Min cut theorem [20]. Howfast we can find the farthest minimum isolating cut is directly related to the runningtime of our algorithms since finding the farthest minimum isolating cut is a subroutinein our algorithms. In fact, many algorithms for the Minimum (s, t) Cut problem justfind the farthest minimum isolating cut of s or t . The farthest minimum isolating cutof ti can be found in linear time if a maximum flow from ti to T−i is given. Thereare many fast algorithms for computing maximum flows in the literature. Reader can

1When a vertex dissolves, the number of edges may increase, which will not cause trouble in our proofs.In our algorithms, the vertices to be dissolved are adjacent to a terminal. Therefore, we can implement thedissolving in the simpler way without increasing the problem size.

728 Theory Comput Syst (2010) 46: 723–736

refer to [23] as a survey. In this paper, we will use Dinic’s O(min(n2/3,m1/2)m)-timealgorithm [24] for finding maximum flows in unweighted graphs to compute farthestminimum isolating cuts. We will also use Ci to denote the farthest minimum isolatingcut of ti , when there is no confusion.

Lemma 1 The farthest minimum isolating cut of terminal ti will not change in thegraph after e shrinks (dissolves, for the vertex version), where e is an edge (vertex)not in the farthest minimum isolating cut of ti .

Proof Let G be the graph, Ci the farthest minimum isolating cut of terminal ti in G,and e an edge (vertex) not in Ci . Let G · e be the graph after e shrinks (dissolves), andC′

i the farthest minimum isolating cut of ti in G ·e. Since we keep all resulting paralleledges when shrinking e, then C′

i is also a corresponding isolating cut of ti in G. Sincee /∈ Ci , Ci is also an isolating cut of ti in G · e. Both Ci and C′

i are minimum isolatingcuts of ti in G and G · e. Considering the uniqueness of the farthest minimum cuts intwo graphs, we can easily get Ci = C′

i . �

Lemma 2 Let Ci be a minimum isolating cut of terminal ti , and Ri the residual ofCi in graph G, (1 ≤ i ≤ k). Then there is a minimum multiterminal cut S′ of G suchthat S′ ∩ E(Ri) = ∅ (S′ ∩ V (Ri) = ∅, for the vertex version).

Proof We only give the proof of the vertex version. The edge version can be provedin the same way.

Let S be a minimum vertex multiterminal cut of G, CPi the component of G − S

that contains terminal ti , and Si ⊆ S the minimum isolating cut of ti contained in S.Obviously, Si is the set of vertices adjacent to CPi . Let Vi = V (Ri) ∩ V (CPi) andV ′

i = V (Ri) ∪ V (CPi) (see Fig. 3). Then each vertex in N(Vi) is either in Si or inCi . Let C′′

i = N(Vi)∩ Ci , S′i = N(Vi)− C′′

i , and C′i = Ci − C′′

i . Then we get S′i ⊆ Si

and N(V ′i ) = Si − S′

i + C′i . Let S∗

i = S ∩ V (Ri). Then we get S′i ⊆ S∗

i .We argue that S′ = S − S∗

i + C′i is a minimum multiterminal cut satisfying the

constraints of the lemma.First, we prove that S′ is a multiterminal cut such that S′ ∩ V (Ri) = ∅. If there is

any path P from one terminal to another in G − S′, P must pass through at least onevertex in S∗

i . On the other hand, we can prove that S∗i and T−i are disconnected in

G − S′. Since removal of N(V ′i ) = Si − S′

i + C′i disconnects S∗

i ⊆ V ′i and T−i , and

Fig. 3 Illustration for Vi

and V ′i

Theory Comput Syst (2010) 46: 723–736 729

N(V ′i ) ⊆ S′, we know that in G − S′ no path from one terminal to another passes

through a vertex in S∗i .

Second, we prove that S′ is minimum. Since N(Vi) = Ci − C′i + S′

i is an isolatingcut of ti and Ci is a minimum isolating cut of ti , we get

|Ci | ≤ |N(Vi)| = |Ci − C′i + S′

i |and thus

|S′i | ≥ |C′

i |. (1)

Therefore,

|S′| = |S − S∗i + C′

i | ≤ |S − S′i + C′

i | = |S| − |S′i | + |C′

i | ≤ |S|.We have finished the proof. �

Corollary 1 Let Ci be the farthest minimum isolating cut of terminal ti in G, and G′be the graph obtained by merging Ri into a new terminal t ′i . Then any minimummultiterminal cut in G′ is a minimum multiterminal cut in G.

Proof It is obvious that any multiterminal cut in G′ is a corresponding multiterminalcut in G. We only need to prove that the size of the minimum multiterminal cut inG′ is not greater than the size of the minimum multiterminal cut in G. In the proofof Lemma 2, we construct a minimum multiterminal cut S′ in G and S′ is still acorresponding multiterminal cut in G′. Then the size of the minimum multiterminalcut in G′ is not greater than |S′|. �

Lemma 2 and Corollary 1 imply that we can find minimum multiterminal cuts ina reduced graph obtained by contracting the residuals of farthest minimum isolatingcuts. We note that the edge version of Lemma 2 can also be inferred from the proof ofGoldschmidt and Hochbaum’s main theorem in [21]. Dahlhaus et al. [2] also provedsimilar results of the edge version of Lemma 2 and Corollary 1 when discussingreducing the instance size of Edge Multiterminal Cut. However their arguments onlywork for the edge version.

3 The Algorithm for Edge Multiterminal Cut

In this section we will combine farthest minimum isolating cuts and bounded searchtree technique to obtain an algorithm for Edge Multiterminal Cut. An interestinganalysis enables us to bound the depth of the search tree by k−2

k−1 l, therefore bounding

the running time of our algorithm by O(2k−2k−1 lkT (n,m)).

Before explaining the algorithm, we present some reduction rules to reduce thesizes of Edge Multiterminal Cut instances.

Rule 1 For each terminal ti , let Ci and Ri be its farthest minimum isolating cut andthe corresponding residual. We can contract Ri in the graph to form terminal ti .

730 Theory Comput Syst (2010) 46: 723–736

Rule 2 We can remove all the edges that connect two terminals from the graph andput them into the solution.

The correctness of Rule 1 follows from Corollary 1 and the correctness of Rule 2 isobvious. For convenience, we call a Multiterminal Cut instance after applying Rule 1and Rule 2 a reduced Edge Multiterminal Cut instance. In a reduced instance, theset of all the edges incident with terminal ti is the farthest minimum isolating cut Ci

of ti , and all the farthest minimum isolating cuts are pairwise disjoint.

Rule 3 Given a reduced Edge Multiterminal Cut instance, let Ci be a minimum iso-lating cut of terminal ti , (i = 1,2, . . . , k). If |⋃k

i=1 Ci | > 2l, then there is no multi-terminal cut with size at most l. If |⋃k

i=1 Ci | ≤ lkk−1 , then

⋃i =i′ Ci is a multiterminal

cut with size at most l, where Ci′ satisfies |Ci′ | = maxki=1 |Ci |.

Lemma 3 Rule 3 is correct.

Proof Let S be a minimum multiterminal cut and Si ⊆ S the set of all edges incidentwith the component of G − S that contains ti (i.e., Si is the minimum isolating cut ofti contained in S), (i = 1, . . . , k). Since S is a minimum multiterminal cut, each edgein S is incident with two nontrivial components (components containing a terminal)of G − S. We get

k∑

i=1

|Si | = 2|S|. (2)

Since Ci is a minimum isolating cut of ti and Si is also an isolating cut of ti , we have|Ci | ≤ |Si |. Therefore,

∣∣∣∣∣

k⋃

i=1

Ci

∣∣∣∣∣=

k∑

i=1

|Ci | ≤k∑

i=1

|Si | = 2|S|.

If∑k

i=1 |Ci | > 2l, then |S| > l.Next, we prove the second claim in Rule 3. It is obvious that

⋃i =i′ Ci is a multiter-

minal cut. If |⋃ki=1 Ci | ≤ lk

k−1 , then |⋃i =i′ Ci | ≤ ∑ki=1 |Ci | k−1

k≤ lk

k−1 · k−1k

= l. �

Based on these three reduction rules, we design a simple but effective parameter-ized algorithm for Edge Multiterminal Cut. Our algorithm is described in Fig. 4.

The main idea of the algorithm is that we first use the three reduction rules toreduce the instance size, and then branch on an edge in B = ⋃k

i=1 Ci by either in-cluding the edge in the solution or excluding it from the solution.

To analyze the time complexity of the algorithm, we build a recurrence relationbased on the control value p = 2l − |⋃k

i=1 Ci |. It is obvious that in our algorithm p

will not increase in Step 1 and Step 2, and the algorithm will stop in Step 3 whenp < 0. In Step 4, we branch on an edge e by either including e in the solution orexcluding e from the solution. We prove that in each branch p will decrease by atleast 1. When e is included in the solution, then l decreases by 1. It is easy to see

Theory Comput Syst (2010) 46: 723–736 731

EMC(G,T , l)

Input: A graph G = (V ,E), a terminal set T = (t1, t2, . . . , tk) ⊆ V and an integer l.Output: An edge multiterminal cut of size at most l when it exists and ⊥ when it does not exist.

1. For each terminal ti ∈ T doFind its farthest minimum isolating cut Ci and the corresponding residual Ri ;Contract Ri in G to form terminal ti .

2. Let E′ be the set of edges that directly connect two terminals.If {E′ = ∅ & EMC(G − E′, T , l − |E′|) =⊥}, then return ⊥;If {E′ = ∅ & EMC(G − E′, T , l − |E′|) =⊥},

then return E′∪EMC(G − E′, T , l − |E′|).3. B ←− ⋃k

i=1 Ci ;If {|B| > 2l}, then return ⊥;If {|B| ≤ lk

k−1 }, then return B − Ci′ , where Ci′ satisfies |Ci′ | = maxki=1 |Ci | and i′ ∈ {1,2, . . . , k}.

4. Arbitrarily select an edge e ∈ B ;C1 ←− EMC(G · e,T , l); C2 ←− EMC(G − e,T , l − 1).If {C1 =⊥}, then return C1;Else if {C2 =⊥}, then return {e} ∪ C2;Else return ⊥.

Fig. 4 The Algorithm EMC(G,T , l)

that Ci − e is the farthest minimum isolating cut of ti in G − e. For any j = i, thesize of the farthest minimum isolating cut in G − e will not change. (Note that if thefarthest minimum isolating cut C′

j of tj in G − e is of size less than Cj , then C′j + e

is an isolating cut of tj in G of size not greater than |Cj |, which will imply that Cj

is not the farthest minimum isolating cut of tj .) Therefore, |⋃ki=1 Ci | = ∑k

i=1 |Ci |decreases by 1. Totally, p decreases by 1. When e shrinks, it is easy to see that thefarthest minimum isolating cut of ti will increase its size by at least 1 and otherfarthest minimum isolating cuts will not change by Lemma 1. In this branch, p willalso decrease by at least 1. Let C(p) be the size of the search tree generated by ouralgorithm when it is called on a problem with control value p, then we get

C(p) ≤ C(p − 1) + C(p − 1) + 1. (3)

It is easy to verify that

C(p) = O(2p) (4)

satisfies (3).Next, we determine an upper bound for p. Recall p = 2l − |⋃k

i=1 Ci |. If|⋃k

i=1 Ci | ≤ lkk−1 , then we will find a solution in Step 3. Else we get

p = 2l −∣∣∣∣∣

k⋃

i=1

Ci

∣∣∣∣∣<

k − 2

k − 1l. (5)

It follows from (4) and (5) that C(p) = O(2k−2k−1 l ). Since at each node of the

search tree, our algorithm will compute at most k farthest minimum isolating cuts,we get

732 Theory Comput Syst (2010) 46: 723–736

Theorem 1 Edge Multiterminal Cut can be solved in O(2k−2k−1 lkT (n,m)) time.

Corollary 2 Edge 3-Terminal Cut can be solved in O(1.415lT (n,m)) time.

4 The Algorithm for Vertex Multiterminal Cut

In this section we present our algorithm for Vertex Multiterminal Cut. The algorithmis also based on data reduction rules. We show that the idea in Sect. 3 can still be usedfor solving Vertex Multiterminal Cut, but the running time may be worse.

First, we give some reduction rules for Vertex Multiterminal Cut. By Corollary 1,we know that Rule 1 for Edge Multiterminal Cut in Sect. 3 is still applicable to VertexMultiterminal Cut. However, Rule 2 and Rule 3 make changes to

Rule 2′ There is no solution if one terminal is adjacent to another terminal.

Rule 3′ We can remove all the vertices that are common neighbors of two terminalsand put them into the solution.

A reduced Vertex Multiterminal Cut instance is a Vertex Multiterminal Cut in-stance after applying Rule 1, Rule 2′ and Rule 3′.

Rule 4′ Given a reduced Vertex Multiterminal Cut instance, let Ci be a minimumisolating cut of terminal ti , (i = 1,2, . . . , k). If |⋃k

i=1 Ci | > kl, then there is no ver-tex multiterminal cut with size at most l. If |⋃k

i=1 Ci | ≤ lkk−1 , then

⋃i =i′ Ci is a

multiterminal cut with size at most l, where Ci′ satisfies |Ci′ | = maxki=1 |Ci |.

The reason why Rule 3 in Sect. 3 is not applicable to Vertex Multiterminal Cutis that (2) does not hold for minimum vertex multiterminal cuts. Instead, we haverelation

k∑

i=1

|Si | ≤ k|S|. (6)

Therefore, we get Rule 4′.Similar to the algorithm in Sect. 3, we first use the four reduction rules to reduce

the input size, then branch on a vertex in B = ⋃ki=1 Ci by either including it in the

solution or excluding it form the solution. Put p = kl − |⋃ki=1 Ci |. When we include

a vertex v ∈ B in the solution, l decreases by 1. As we discussed in Sect. 3, in thisbranch, |⋃k

i=1 Ci | will decrease by 1. Totally p decreases by k−1. When v dissolves,l does not change and |⋃k

i=1 Ci | increases by at least 1. In this branch, p will decreaseby at least 1.

We get the following recurrence relation:

C(p) ≤ C(p − 1) + C(p − (k − 1)) + 1, (7)

where C(p) is the size of the search tree generated by our algorithm when it is calledon a problem with control value p.

Theory Comput Syst (2010) 46: 723–736 733

Since |⋃ki=1 Ci | > k

k−1 l, we have

p = lk −∣∣∣∣∣

k⋃

i=1

Ci

∣∣∣∣∣< (k − 1)l − 1

k − 1l. (8)

By using the substitution method, we can verify that when k = 3,4,5 and 6,C(p) = O(2.059l), O(2.772l ), O(3.349l ) and O(3.857l) respectively satisfy (7)and (8). The problem of bounding a function C(r) satisfying a recurrence of theform C(r) ≤ ∑

C(r − ri) + O(1) has been extensively studied [25]. The boundis O([α(r, r1, r2, . . .)]r ), where α(r, r1, r2, . . .) is the largest root of the functionf (x) = 1 − ∑

x−ri .

Theorem 2 Vertex {3,4,5,6}-Terminal Cuts can be solved in O(2.059lT (n,m)),O(2.772lT (n,m)), O(3.349lT (n,m)) and O(3.857lT (n,m)) time respectively.

For general k, we will relax more to get a simplified running time bound. It is clearthat

C(p) ≤ C(p − 1) + C(p − (k − 1)) + 1 ≤ C(p − 2) + 2C(p − (k − 1)) + 2

≤ · · · ≤ C(p − (k − 1)) + (k − 1)C(p − (k − 1)) + (k − 1)

= kC(p − (k − 1)) + (k − 1).

Therefore,

C(p) = O(k� pk−1�

).

Since

k� pk−1�

< kl−� l

(k−1)2 � ≤ kl,

we get

Theorem 3 Vertex Multiterminal Cut can be solved in O(klT (n,m)) time.

5 Improvements on Multicut

The Multicut problem is another important graph partition problem and has been ex-tensively studied in the literature [4, 18, 19]. In this problem, k pairs of terminalsH = {(s1, t1), (s2, t2), . . . , (sk, tk)} ⊆ V × V , instead of k terminals, are given, andwe are required to separate each of the k pairs by deleting at most l edges or vertices.It is easy to see that Multiterminal Cut is a special case of Multicut as we can set H

to be the set of all terminal pairs. Since Multiterminal Cut is NP-hard for each fixedk ≥ 3, Multicut is also NP-hard for each fixed k ≥ 3. But Multicut is polynomial solv-able for k = 2 [26, 27]. For Multicut, the previously known parameterized algorithm

734 Theory Comput Syst (2010) 46: 723–736

is Marx’s 2kl4l3nO(1)-time algorithm for Vertex Multicut [11], and the best approxi-mation algorithm is Garg et al.’s polynomial-time O(log k)-approximation algorithmfor Edge Multicut [28].

Next, we present a reduction from Multicut to Multiterminal Cut, which may leadto better parameterized and approximation algorithms for Multicut, in particular forsmall values of k.

Let (G,H) be a Multicut instance, where G is an undirected graph and H a set ofterminal pairs in G. First, we introduce an undirected commodity graph L = (T ,R),where vertex set T denotes the set of terminals in G, i.e. vertices in any terminalpair in H . The edge set R = H describes the set of pairs of terminals that need tobe disconnected in G. A proper vertex coloring of L is a function assigning colorsto T with the restriction that each pair of terminals in R gets distinct colors. Let φ

be an arbitrary proper vertex coloring of L, and Gφ the graph obtained by mergingeach set of terminals, having the same color with respect to φ, into a new compositeterminal. It is easy to see that each multiterminal cut in Gφ gives rise to a multicutin G. This prompts a possible way to solve Multicut: we enumerate the colorings φ

of L, find a minimum multiterminal cut in Gφ, and finally choose the best of thesecuts. To establish the correctness of this procedure, we need the following lemma:

Lemma 4 Each multicut in G corresponds to a multiterminal cut in Gφ for some φ

that uses at most �ρ(k)� distinct colors, where ρ(k) = 12 (

√8k + 1 + 1).

Proof Let C be an arbitrary multicut in G. We consider the connected componentsof the graph obtained by removing C. First, we assign a unique color to the terminalsin each of these components thus producing φ. Clearly, φ is a proper coloring of H ,otherwise there exists an edge (x, y) ∈ R with both terminals x and y in the samecomponent, which is impossible.

Moreover, we can reduce the number of used colors as follows. If there are twocolor classes that are not connected by an edge in L, then we merge them. Afterthese merges, there are at most �ρ(k)� color classes (note that the number of verticesin a clique on at most k edges is at most �ρ(k)�, where ρ(k) = 1

2 (√

8k + 1 + 1) isa root of function f (x) = x2 − x − 2k). Moreover, every pair of terminals havingdistinct colors is in distinct connected components. Hence, C can be regarded as amultiterminal cut in Gφ and φ uses at most �ρ(k)� distinct colors. �

Therefore, we can solve Multicut by solving at most �ρ(k)�|T | ≤ �ρ(k)�2k Mul-titerminal Cuts that have at most �ρ(k)� terminals. We also note that in the edgeversion of the lemma, the number of distinct colors may not be greater than l + 1 (af-ter removing l edges, the number of components can increase by at most l). Then, wecan solve Edge Multicut by solving at most min(l + 1, �ρ(k)�)2k Edge MultiterminalCuts. Combining our results on Multiterminal Cut, we get

Theorem 4 Edge Multicut can be solved in O(p2k2lT (n,m)) time, where p =min(l + 1, � 1

2 (√

8k + 1 + 1)�).

Theorem 5 Vertex Multicut can be solved in O(�ρ(k)�2k+lT (n,m)) ≈O((2k)k+l/2T (n,m)) time.

Theory Comput Syst (2010) 46: 723–736 735

When there are at most 5 pairs of terminals in Multicut (k ≤ 5), we can solveMulticut by solving at most �ρ(k)�2k ≤ 310 Multiterminal Cuts that have at most�ρ(k)� ≤ 3 terminals.

Corollary 3 Edge Multicut with at most 5 terminal pairs can be solved inO(1.415lT (n,m)) time.

Corollary 4 Vertex Multicut with at most 5 terminal pairs can be solved inO(2.059lT (n,m)) time.

Since Karger et al. [6] obtained a polynomial-time 1.3438-approximation algo-rithm for Edge Multiterminal Cut and Garg et al. [7] obtained a polynomial-time2-approximation algorithm for Vertex Multiterminal Cut, we get

Theorem 6 For each fixed k, there is a polynomial-time 1.3438-approximation al-gorithm for Edge Multicut.

Theorem 7 For each fixed k, there is a polynomial-time 2-approximation algorithmfor Vertex Multicut.

6 Concluding Remarks

In this paper, based on the notion farthest minimum isolating cut, we have presentedseveral simple and improved algorithms for Multiterminal Cut as well as Multicut.This notion is helpful for us to characterize the structure of optimal cut problemsand design fast algorithms. In the initial version of this paper [1], based on farthest

minimum isolating cuts, we have also presented an O((l!)2

2l T (n,m))-time algorithmfor Vertex Multiterminal Cut. Although that algorithm and its analysis are short andintuitive, faster algorithms were given recently. We do not include that algorithm inthis version of the paper.

Acknowledgements The author is grateful to all the anonymous reviewers for fruitful and insightfulcomments to improve the presentation of the paper. The author also thanks Leizhen Cai and Andrew Chi-Chih Yao for useful discussions and support.

References

1. Xiao, M.: Algorithms for multiterminal cuts. In: Hirsch, E.A., Razborov, A.A., Semenov, A.L., Slis-senko, A. (eds.) CSR. Lecture Notes in Computer Science, vol. 5010, pp. 314–325. Springer, Berlin(2008)

2. Dahlhaus, E., Johnson, D., Papadimitriou, C., Seymour, P., Yannakakis, M.: The complexity of mul-titerminal cuts. SIAM J. Comput. 23(4), 864–894 (1994). A preliminary version appeared in STOC1992

3. Yeh, W.C.: A simple algorithm for the planar multiway cut problem. J. Algorithms 39(1), 68–77(2001)

4. Costa, M.C., Létocart, L., Roupin, F.: Minimal multicut and maximal integer multiflow: A survey.Eur. J. Oper. Res. 162(1), 55–69 (2005)

736 Theory Comput Syst (2010) 46: 723–736

5. Calinescu, G., Karloff, H.J., Rabani, Y.: An improved approximation algorithm for multiway cut.J. Comput. Syst. Sci. 60(3), 564–574 (2000). A preliminary version appeared in STOC 1998

6. Karger, D.R., Klein, P.N., Stein, C., Thorup, M., Young, N.E.: Rounding algorithms for a geometricembedding relaxation of minimum multiway cut. In: Proceedings of the 31th Annual ACM Sympo-sium on Theory of Computing (STOC 1999), pp. 668–678 (1999)

7. Garg, N., Vazirani, V.V., Yannakakis, M.: Multiway cuts in node weighted graphs. J. Algorithms 50(1),49–61 (2004)

8. Naor, J., Zosin, L.: A 2-approximation algorithm for the directed multiway cut problem. SIAM J.Comput. 31(2), 477–482 (2001). A preliminary version appeared in FOCS 1997

9. Hartvigsen, D.: The planar multiterminal cut problem. Discrete Appl. Math. 85(3), 203–222 (1998)10. Chen, D.Z., Wu, X.: Efficient algorithms for k-terminal cuts on planar graphs. Algorithmica 38(2),

299–316 (2003)11. Marx, D.: Parameterized graph separation problems. Theor. Comput. Sci. 351(3), 394–406 (2006).

A preliminary version appeared in IWPEC 200412. Chen, J., Liu, Y., Lu, S.: An improved parameterized algorithm for the minimum node multiway

cut problem. In: Proceedings of the 10th International Workshop on Algorithms and Data Structures(WADS 2007), pp. 495–506. Algorithmica (2007, to appear)

13. Guillemot, S.: FPT algorithms for path-transversals and cycle-transversals problems in graphs. In:Grohe, M., Niedermeier, R. (eds.) IWPEC. Lecture Notes in Computer Science, vol. 5018, pp. 129–140. Springer, Berlin (2008)

14. Feige, U., Mahdian, M.: Finding small balanced separators. In: Proceedings of the 38th Annual ACMsymposium on Theory of Computing (STOC 2006), pp. 375–384 (2006)

15. Downey, R., Fellows, M.: Parameterized Complexity. Springer, New York (1999)16. Flum, J., Grohe, M.: Parameterized Complexity Theory. Springer, Berlin (2006)17. Niedermeier, R.: Invitation to Fixed-Parameter Algorithms. Oxford University Press, Oxford (2006)18. Calinescu, G., Fernandes, C.G., Reed, B.A.: Multicuts in unweighted graphs and digraphs with

bounded degree and bounded tree-width. J. Algorithms 48(2), 333–359 (2003)19. Guo, J., Huffner, F., Kenar, E., Niedermeier, R., Uhlmann, J.: Complexity and exact algorithms for

vertex multicut in interval and bounded treewidth graphs. Eur. J. Oper. Res. 186(2), 542–553 (2008).A preliminary version appeared in SOFSEM 2006

20. Ford, J., Fulkerson, D.: Flows in Networks. Princeton University Press, Princeton (1962)21. Goldschmidt, O., Hochbaum, D.: A polynomial algorithm for the k-cut problem for fixed k. Math.

Oper. Res. 19(1), 24–37 (1994). A preliminary version appeared in FOCS 198822. Xiao, M.: An improved divide-and-conquer algorithm for finding all minimum k-way cuts. In: Hong,

S.H., Nagamochi, H., Fukunaga, T. (eds.) ISAAC. Lecture Notes in Computer Science, vol. 5369, pp.208–219. Springer, Berlin (2008)

23. Goldberg, A.V., Rao, S.: Beyond the flow decomposition barrier. J. ACM 45(5), 783–797 (1998).A preliminary version appeared in FOCS 1997

24. Dinic, E.: Algorithm for solution of a problem of maximum flow in networks with power estimation.Sov. Math. Dokl. 11, 1277–1280 (1970)

25. Beigel, R., Eppstein, D.: 3-coloring in time O(1.3289n). J. Algorithms 54(2), 168–204 (2005)26. Hu, T.C.: Multi-commodity network flows. Oper. Res. 11(3), 344–360 (1963)27. Itai, A.: Two-commodity flow. J. ACM 25(4), 596–611 (1978)28. Garg, N., Vazirani, V.V., Yannakakis, M.: Approximate max-flow min-(multi)cut theorems and their

applications. SIAM J. Comput. 25(2), 235–251 (1996)