The Complexity of Multiway Cuts (Extended Abstract)

E. Dahlhausl, D. S. Johnson2, C, H. Papadimitriou3 P. D. Seymour4, and M. Yannakal&2

Absfrast. In the Multiway problem we are given an edga- with the minimization of communication costs in parallel weighted graph and a subset of the vertices called termimds, and computing systems. In [20], Stone points out how the asked for a minimum weight set of edges that separates each ter- problem of assigning program modules to processors can minal from all the others. when the number k of terminals is two, this is simply the min-cu~ msx-flow problem, and can be solved be formulated in this framework. Other applications in polynomial time. We show that the problem becomes NP-hsrd involve partitioning tiles among the nodes of a network, as sxrn as k = 3, but ctm be solved in polynomial time for planar assigning users to base computers in a multicomputer envi- graphs for any fixed k. The planar problem is NP-hsrd however, ronment, and partitioning the elements of a circuit into the if k is not tixad. We also describe a simple approximation slgo- subcircuits that will go on different chips. It is known that rithnt for arbkmry graphs that is guaranteed to come within a fsc- tor of 2– 2/k of the optimal cut weight. such problems can become NP-hard even fork = 2 if there is a constraint imposed on the size of the components into which the graph is cut [8,9]. In this paper we ask whether the problem might be tractable without such a constzahtt (as 1. Introduction it is for k = 2), The Mdtiwwy Cut problem can be defined as follows: Our first results concern the planar case. The restriction Given a graph G = (V,J??), a set S = {sl ,s2,.,.,s~) of k to planar graphs, besides its basic graph-theoretic specified vertices or termz”nals, and a positive weight w(e) significance, has potential relevance in the circuit partition- for each edge e ● E, find a minimum weight set of edges ing application. E’ G E such that the removal of E’ from E discomects each terminal from all the others. Theorem 1. (a) For k = 3, theplanar Multiway Cut problem can be solved in time O (n3 logn). When k = 2 this problem reduces to the famous ‘ ‘min- cut/max-flow” problem, a problem of central significance (b) For anyjixedk23, the planar MuMway Cut prob- in the field of eombinatoria.1 optimization due to its many lem is solvable in polynow”al time. applications and the fact that it can be solved in polynomial The of Part (b) are, unfortunately, exponen- time (e.g., see [6,14,15,17]). The “k-way cut” problem for tial in k. (Specifically, they are 0((4k) kn 2k-1 logn).) That k >2 has been a subject of discussion in the combinatorics such exponential behavior is likely to be unavoidable fol- community for years (closely-related variants were pro- lows horn the next result. posed as early as 1%9 by T. C. Hu [14,p.150]). A variety Theorem 2. If k is not@d, the Multiway Cut problem of applications have been suggested, most having to do for planar graphs is NP-hard even if all edge weights are equal to 1. 1University of Bonn. CurrantAddress:Departmentof ComputerScience, Universityof Sidney,New South Wales, Australia For the Multiway Cut problem in arbitrsry graphs, NP- 2AT&T Bell Laboratories, Murray Hill, NJ 07974 hardness sets in much earlier. 3Department of Computer Ssience and Engineering, University of Califor- Theorent 3. The Multiway Cut problem for arbitrary nia at San Diego 4 Bellcore, Morristown, NJ 07960 graphs is NP-hard for alljixed k 23 and all edge weights Permission to copy without fee all or part of this material is equal to 1. grantad provided that the copias are not made or distributed for This theorem is proved using a‘ ‘gadget” that has inter- direct commercial advantage. the ACM copyright notice and the title of the publication and its date appear, and notice k ghren esting properties on its own (as a counterexample to a con- that copying is by permission of the Association for Computing jecture about the possible submodularity of 3-Way Cut). Machinary. To copy otherwise, or to republish, raquires a fae The ttvarem’s negative consequences are partially miti- and/or specific permission. 24th ANNUAL ACM STOC - 5/92/VICTORIA, B. C., CANADA 01992 ACM 0-89791-51 2-7/9210004/0241 . ..$1.50

241 gated by technical lemmas that may yield substantial reduc- and lb). Section 3 elaborates on the negative result for the tions in the sizes of instances encountered in practice. planar case (Jleorem 2). Section 4 covers our results for Finally, we have the following two approximation general graphs (Theorems 3,4, and 5 and associated techni- results, one positive and one negative. cal lemmas). A concluding Section 5 discusses additional variants and generalizations of Multiway Cut to which our Theorem 4. There is a polynomial-time approximation techniques can apply, and points out some of the remaining for the Multiway Cut problem that for arbitrary open problems in the area. Because of space limitations, graphs and arbitrary k is guaranteed to fmd cuts that are we have omitted most of the proofs in this extended within 2(k - 1)/k of optimal. abstract. A full version of this paper containing all the Theorem 5. For anyjixedk23, thek-Way Cut prob- proofs is available from the authors. lem is MAX SNP-hard (and hence unlikely to have a poly- nomial time approximation scheme). 2. Algorithms for The Planar Case The results presented here can be contrasted to those of Our main result for planar graphs (Theorem 1) says that [11,13,19], which concern what might be called the Multi- for all fixed k, the Multiway Cut problem is solvable in way Split problem. In this problem we are given G, k, and polynomial time. This is in contrast to Theorem 3, which w as above (but not S), and are asked merely for a mini- says that for arbitrary graphs, the problem is NP-hard for mum weight set of edges E’ whose removal separates the any fixed k 23. The key advantage we gain from planarity graph into at least k nonempty connected components. It is lies in the existence of a planar dual to our given graph G. reported in [11] that although this problem is NP-hard for We will assume without loss of generality that our graph arbitrary k, it is solvable in polynomial time for each fixed G = (V,E) is connected and that we have fixed an embed- k >2., even for arbitrary graphs. The running time is ding of it on the plane. We will use a superscript D to O(nk 12-k+ll12 ). Fork= 3 and unweighed planar graphs, denote a dual object. Thus GD is the dual graph of G. If F a faster O(n 2) algorithm is presented in [13]. Thus the is a subset of the edges of G, F~ is the corresponding set of Multiway Split problem is significantly easier than the edges of GD. (Nottx FD is not the dual of the subgraph problem we study here, although we note that for fixed (V,F) of G.) k 26, our planar Multiway Cut algorithm will provide a We start with Theorem la and the case of k = 3, and better method for solving the planar Multiway Split prob- then show how our proof techniques can be generalized to lem than will the general Multiway Split algorithms of cover the case of general fixed k (Theorem lb). [11]: Simply run our algorithm for all possible sets S of k vertices and take the least-weight solution found. A factor proportional to nk is added to our running time, but the 2.1. Planar 3-Way Cuts resulting time lxmnd is still O (n3k-1 logn). Reference [19] Figure 1 shows a graph G with a 3-way cut C, together concerns approximation results for the Multiway Split with the duals GD and CD of each. The thicker edges in problem, showing that the bounds we obtain in Theorem 4 the figure are those of C and CD, respectively. Note that for Multiway Cut can be obtained for Multiway Split with- the edges of CD partition the geometric embedding of GD out having to apply our result to all possible sets of k ver- into three regions. (In the case of Figure 1, two of these tices. regions are single faces of GD, but the other is the union of To avoid bibliographic confusion, we should mention several faces.) Let us say that a of G is in a given that, with the exception of ‘Ilmrem 5, the results in the ~gion if the face of GD to which the vertex corresponds is current paper were first announced in 1983 in an unpub- part of that region. Then observe that in the figure, each of lished but widely circulated extended abstract of the same the terminals of G is in a separate region of CD. This is title [3]. The abstract has since been widely cited, both in clearly a general property C is a 3-way cut of a graph G if the above-mentioned work on Multiway SpliC and in and only if the terminalss 1, S2, S3 are in different regions follow-up work on the Multiway Cut problem itsek In [1], of CD. Thus if D is an optimal 3-way cut, CD has exactly Chopra and Rao observe, as we failed to do in our original three regions, each one containing a distinct terminat. Fur- abstract, that for trees and 2-rrees, the general k-Way Cut thermore, removing any edge from CD must merge two problem can be solved in linear time by a straightforward tegions, as otherwise the corresponding edge of C is not dynamic programming algorithm. (This can be generatizcd needed in the cut. to graphs of bounded -width for any fixed bound, by For a general instance of the 3-way cut problem, there standard techniques.) The facets of the Multiway Cut poly- are two topologically distinct possibilities for an optimal hedron are studied in [1,2], An interesting generalization cut CD. of the Muhiway Cut problem, about which we shall have Cut Type I. CD consists of two edge-disjoint cycles. See more to say in our concluding section, is studied in [4,5]. Figure 2a,b. Note that the cycles may have one vertex in The paper is organized as foltows. In Section 2 we common and/or one may lie inside the other, as in cover the positive results for the planar case (Theorem la Figure 2b. They cannot have more than one vertex in com-

242 (a) (b)

FIOURE1. A planar3-way cut (a) and its dual (b). men, however, as this would imply that CD had more than sum of the weights of the hvo smallest of these the isolat- three regions. ing cuts. If the two smallest are edge-disjoint, then their union is optimal among all 3-way cuts of Type I. If the two Cut Type II. Each pair of regions of CD shares an edge. smallest are not edge-disjoint, then their union is a 3-way SeeFigure 2c. cut that has strictly smaller weight (since all edge weights For Type I cuts, the cut C consists of hvo edge-disjoint are by assumption positive). Consequently, the best 3-way cuts (corresponding to the two cycles of CD), each isolating cut is not of Type I. one of the three terminals from the other two. The notion Our procedure for Type II cuts is significantly more of such an “isolating cut” will also be of use in treating the complicated. Suppose we have an optimal 3-way cut that is case of Type II cuts. We define it formally (and generalize of Type II. Look again at Figure 2c. The cycle that bounds it to arbitrary k) as follows. each region corresponds to an isolating cut for the terminal Definition. For a given tem”nal Si, an isolating cut for contained in that region, but these isolating cuts are not si is any set of edges that cuts all paths between si and all necessarily optimal, as they overlap. Consider the two ver- the other terminals. ti~stitmofde~3tiC~mdwekbld aandbin the figure. The following lemma allows us to fix one of the Note thata minimum weight isolating cut for si can be three paths connecting a and b in GD. constructed by merging all the terminals other than si into a Lemma 2.1. Suppose that the dual of an optimal 3-way special vertex so, and then finding a minimum si - so cut in cut C is of Type II and a and b are the two vertices of the resulting graph by a standard 2-terminal minimum cut &gree 3 in CD. Let P be any shortest path from a to b in algorithm. GD. Then there is an optimal 3-way cut Co that is of Type We shall now &scribe how to find an optimal 3-way II, has a and b as its two vertices of 3 in C~, and cut. We provide procedures that work for each type of cut. such that P is one of the three paths that join a to b in Cfl. Each procedure either returns the best cut of the corre- In light of Lemma 2.1, our procedure for Type II cuts sponding type, or else reports (correctly) that any optimal can work by repeatedly calling a subroutine, once for each cut is of the other type. potential pair a,b of degree-3 vertices in CD. The subrou- Our procedure for Type I cuts is straightforward. We tine either constructs a minimum weight 3-way cut C which simply compute the three minimum weight isolating cuts is of Type II and has a and b as the two degree-3 vertices in for s ~, 52, and S3 respectively, Note that a minimum CD, or reports (correctly) that no minimum weight 3-way weight Type I cut must have weight at least as large as the cut has that form. The subroutine proceeds as follows

(a) iilm(c) (b)

FIGURE 2. Types of 3-way cuts: Typo I (a) and (b), Type II (c).

243 First, construct a shortest path P between a and b in 3. Output the lightest 3-way cut on the list of potential GD. By Lemma 2.1 we may assume that P is contained in optima. CD. Delete the edges in G corresponding to the edges of P, Theorem la. Given a G with specijied obtaining a new graph H. In the embedding of this new ternu”nalss ~, S2, and S3, Procedure 3-Way outputs an opti- graph induced by our original embedding of G, all the mal 3-way cut, and can be implemented to run in time regions of G corresponding to vertices on P in GD are 0(n3 logn), where n is the number of vertices in G. merged into a single region. This corresponds in 11~ to coalescing all the vertices along the path P from u to b into a single vertex VP. This coalescence turns CD from a Type 2.2. Planar Multiway Cuts II cut into a Type I cut like the one in Figure 2b in which In this section we turn to the case of k-way cuts where the two edge-disjoint cycles shate a common vertex, in this k >3. The algorithm we present will work for all k 23 case Vp. (The two cycles need not however be nested as and will have a running time tha~ although exponential in they are in the figurq they can have disjoint interiors.) k, is polynomial whenever k is fixed. It can be viewed as a We can now apply our previously described procedure (major) generalization of the algorithm of the previous sec- for Type I cuts to H, obtaining a Type 1 cut C~, or a report tion for the k = 3 case. For our discussion here, it will be that the best 3-way cut for His notof Type I. In the latter convenient to assume that no two subsets of edges has the case, an optimal 3-way cut for G could not have been of same total weight. (we can make sure that the assumption Type II with the pair a,b as its degree-3 vertices, and we is satisfied in various ways. For instance, if A is the weight report this fact. In the former case, the cut C~ will, when of the lightest edge and the edges are ordered augmented with the edges of G corresponding to the edges el ,e2,. ... em, we could use the revised edge weights of P in GD, be a 3-way cut for G. It cannot be an optimal W’(f3i) = W(ei ) + A/2i.) The key consequence of the cut, however, unless C% has the &sired form of two edge- assumption is that optimal cuts, shortest paths, etc. are disjoint cycles with Vp as a single common vertex. Other- unique, so that we can refer to theoptimal cut etc. A less wise the edges corresponding to P can be deleted and a desirable consequence is that the cost of doing additions valid (and lighter) 3-way cut for G will remain. Thus if C~ and comparisons of edge weights may go up by a factor of does not have the desired form, we once again report that n, given the large number of bits needed to represent them, no optimal 3-way cut for G is of Type II with a, b as its two but given that our main goal here is to show that running degree-3 vertices. times are O(n’~) for some c, a factor of n will not make a Our overall algorithm for finding an optimal 3-way cut significant difference. Cm thUS proceed as fO1lOwS: In the k = 3 case, we observed that the dual CD of the optimal cut was a subgraph of GD that partitioned the Procedure 3-Way embedding of GD into three regions, each containing a dis- 1. Perform the Type I procedure on G. tinct terminal. We then reduced the problem to the compu- If a valid Type I cut is foun~ put it on the list of tation of 2-way cuts and shortest paths by first guessing potential optima. (i.e., trying all possibilities for) some information about CD. In particular, we guessed the (whether the 2. Construct the dual graph G~ and perform an all-pairs cut consisted of two edge-disjoint cycles or not) and (in the shortest path computation for G~. latter case) the identity of the two degree-3 nodes a and bin For each pair a,b of vertices in GD, do the following CD. 2.1. Let P be the shortest path in GD between a and For general k 23, we follow the same approach. b as constructed in step 2, and let H be the Assume as before that we have previously decided on some graph obtained from G by deleting the edges fixed embedding of G. Suppose C is the optimal k-way cut, corresponding to edges of P. and once again let CD be the dual of C viewed as a sub- graph of a predetermined planar embedding of GD. Then 2.2. Perform the Type I procedure on H. CD must partition the embedding of GD into precisely k 2.3 Let Vp be the coateseed vertex in HD corre- regions, each containing a distinct terminal. Our notion of sponding to the path P. If a valid Type I cut a topology for CD is derived as followx Consider the con- C~ for H is found and has a dual consisting of nected components of CD, and call such a component com- two edgedisjoint cycles having VP as their plex if it contains more than one vertex that has degree unique common vertex, do the following thr= Or more in CD. Let C~,C~, ..., C: bean enumem- tion of the complex components of CD, and for each i, 2.3.1 Let C~ be the 3-way cut for G consist- 1

244 N1 = {V2,V~,V~,V~,V~,V~2) N2 = {V~,V~,V~,V~,V~~,V~7,V~9,V2z,V2~

FIOURE3. The dual CD of an optimal cut C and its topology (Nl ,N2 ). minal.) Let N = U~=lNi. The topology of CD is simply degree three or more. The artalogue of Lemma 2.1 for this the (unordered) partition of N given by the sets general k case is that for each C?, i < q, we can efficiently N1,N2,. ... Nq. See Figure 3 for an example of a CD and identify a subtree T? of C? that spans all the vertices of Ni. its topology, consisting of two sets N1 and N2. In the This was the case in Lemma 2.1, where for N1 = {a,b) figure the vertices of degree three or greater are high- (Figure 2c), we identified a path between the two degree-3 lighted. Note that the degree-6 vertex v lfj does not partici- vertices a and b by doing a shortest path computation. For pate in the topology because its connected component con- the general case, we shall need both shortest paths and min- tains only one vertex of degree three or greater. imum spanning trees. Lemma 2.2. If G is a connected planar graph with n For a given topology, the trees T?, i < q, are con- vertices, let C be an optimal k-way cut for G, and let CD be structed as follows. We treat the sets Ni, i < q, in turn. the planar dual of C, viewed as a subgraph of GD. Then (Order is not important,) Given Ni$ we construct an auxil- the number of distinct possibilities for the topology of CD iary weighted Hi with Ni as its vertex set is O((2n)2k-4). and with the weight of the edge linking u and v being the Our algorithm for the general k-way cut problem will length of the shortest path in GD between u and v. Com- work by considering in turn each of the possibilities for the pute the minimum spanning ti T[Hi ] of Hi, and let T? topology of the optimal cut. For each we will invoke a sub- be the subgraph of GD formed by replacing each edge in routine analogous to those used in our 3-way cut algorithm. T[Hi ] by the corresponding shortest path in GD. We shaIl The subroutine will either output the shortest cut that has call T? the mu”nimum spamu”ng tree of Ni (although note the given topology, or else report (correctly) that the opti- that it may not even be a tree if CD does not have the given mal cut cannot have the given topology. In order to specify topology). Figure 4 portrays the CD of Figure 3 with the the subroutine, we will need to know some structural trees T? (chosen according to the correct topology) high- results about the topology of the optimum cut, lighted. @or future reference, the figure also indicates So suppose we are given a topology N1 ,N2,..., N~. which terminal is contained in which region of CD.) The If this is the optimal topology, then CD contains connected next lemma establishes the key properties satisfied by T? components C? ,C~, ..., C~,q’2 q, where for 1 S i

~GUXU34. The dual CD with the trees Tf’ highlighted and the lcwations of terminals indicated.

245 ~GURE 5. The graph CIO]~ obtained by coalescing the spanning trees ~ in CD.

I < i s q, be & co~lex connected components of CD, tial order

246 3. Let W* = 00 (our initial estimate of the optimal cut order to insure that every subset of edges had a unique weight), weight. For all possible permutations Sx(l) ,sn(z,, . . . . sxw It may well be that more efficient algorithms can be of the terminals, do the following. derived by careful algorithmic design and analysis, but the bounds we have presented adequately fuliill our goal of 3.1. Set C = T. showing that the k-way cut problem can be solved in poly- 3.2. For 1 S i < k – 1 do the following: nomial time for fixed k and planar graphs. Moreover, as the NP-completeness result of the next seetion implies, it is 3.2.1. Find a minimum isolating cut Ai for likely that any algorithms for the general problem will have ~Z(i) in G[i– 1]. exponential (or at least super-polynomial) running times. 3.2.2. Set C = C u Ai, and let G[i] be the /.NH Complexity of Planar Multiway Cut graph obtained by deleting the edges of Our proof of NP-completeness for the general planar Aifiom G[i-l]. multiway cut problem is via a transformation from PLA- NAR 3-SATISFIABILITY [16], using an elaborate compo- 3.3. If w(C) < W*, setW* = w(C) and C* = C nent design construction (details in the full paper). The (the current best cut with this topology). problem remains NP-complete even if all edge weights are 4. output c*. equal to 1 and no vertex degree exceeds 11 (a degree bound that should be reducible to 6 by a mom-complicated variant It should be clear from the above discussion that this on our proof). If one allows atlows edge weights to range subroutine has the desired properties, Its running time is over the set (1,2, 3,4, 5) rather than requiring them all to domimted by that for the minimum isolating cut computa- be equal, the degree bound can be Educed to 3. The prob- tions occurring at Step 3.2.1. As discussed, each such com- lem is of course trivial if the maximum degree is 2. putation can performed using a standard 2-terminal mini- mum cut algorithm in time O (n2 logn), assuming a machine model in which additions, subtractions, and com- 3. Multiway Cut for Fixed k and Arbitrary Graphs parisons take constant time. Given our proposed method This section covers our results about the multiway cut for imposing the restriction that all sets of edges have problem on arbitrary graphs. We begin with our NP- unique weights, however, such a model is inappropriate. completeness result for fixed k >3 and then discuss ways Even given the standard assumption that the original of coping with the implied complexity of the problem. instance has edge weights that fit into a single computer Note that it suffices to prove the problem NP-complete for word, our method for insuring the subset weight uniqueness k = 3, since the problem for higher values of k can trivially restriction gives rise to weights whose binary representa- be derived from that for k = 3. We discovered the key tions involve @(n) bits. With such large numbers, the time “gadget” needed our NP-completeness proof while pursu- bound for the isolating cut computations grows to ing what at first seemed like a promising algorithmic 0(n3 logn). We perform k – 1 such computations for each approach to the 3-Way Cut problem, based on results on of the k! permutations of the terminals, yielding total of submodular set functions by Grotschel, Lovdsz, and Schri- O(kk ) for each topology. jver [12]. The overall algorithm then consists of performing Pro- cedure CheckTopology for each possible topology, of 3.1. Cuts as Submodular Set Functions which there are 0((2n) 2k-4 ) by Lemma 2.2, and out- In order to understand the results of [12], we first need putting the best cut found for any non-rejected topology. some definitions. Let U be a finite set. A function~ defined Thus we have our claimed result for general fixed k, stated on the subsets of U is submodular if for any two subsets X here in slightly more precise form than given in the intro- and Y of U, f(X) + f(Y) > f(X n Y) + f(X U Y). duction: Grotschel, Lovdsz, and Schrijver [12] show that if a sub- Theorem lb. Given a planar graph G with n vertices modular set function~can be computed in polynomial time, and k specijied terminals, a minimum k-way cut can be con- then ~ can also be minimized, i.e., set Y with ~(Y) = strutted in time 0((4k) kn 2k-1 logn). min V(X): X c U) can be found, in polynomial time. Note that if we specialize this result to the previously (The algorithm involves an appropriate application of the considered case of k = 3, the time bound is 0(n5 Iogn), ellipsoid method.) substantially larger than the O (n 3logn ) of Theorem la, A paradigmatic example of a submodular set function This is a result of two factors: (1) A factor of n because we involves the usual (2-way) minimum cut problem. In this can’t in general find the needed isolating cuts using planar case, U is the set of nonterminal vertices V – (s 1,s2 ], and 2-terminal cut algorithms, as we could when k = 3, and so ~(X) is the total cost of the edges which have precisely one have to use general 2-terminal cut algorithms. (2) A factor endpoint in the set X u {s 1}. The submodularity of this of n because we needed to operate with @(n)-bit weights in function is easy to verify, as is the fact that

247 min~(X): X G U) is the weight of a minimum 2-way cut. c(i, j) be the cost of a minimum i,j-cut. The sets X and Y We of course aheady know how to minimize this function~ that cause~to violate submodularhy are defined as follows: in polynomial time without resorting to the ellipsoid Let X be the set of vertices connected tos 1 in an opti- method, but the formulation is suggestive. Could it be pos- mal 1,2 cut. (Note that by definition of i,j-cut, x is in X sible that 3-way cuts might also be computable as minima and y is not.) Let Y be the set of vertices connected tos 1 in of a submodukw set function? art optimal 2,1 cut. (Note that y is in Y and x is not.) By It is easy to define a set function for 3-way cuts that is definition, we have \(X) = c(1,2) and ~(Y) = c(2, 1). analogous to the one above for the 2-way case. Let U = We also must have ~(X u Y) 2 c(l,l) and ~(X n Y) 2 V - (S I ,Sz ,Sq ) be the set of nonterminal vertices. For any min{c(2,3) ,c(3,2) ,c(2,2) ,c(3,3)). ~US if ~ were sub- 3-way cut E’, let us say that a set X G U is associated with mochdar, we would need to have c(1,2) + c(2,1) 2 s ~ under E’ if (1) X contains neither S2 nor S3 and (2) every c(l,l) + min{c(2,3),c(3,2 ),c(2,2),c(3,3)). In light of edge of G with precisely one endpoint in X u {sl ) belongs the following lemma, however, this claii is false. to E’. Note thatif a 3-way cut E’ disconnects some ver- Lemma 4.1. For the graph C of Figure 6, the follow- tices from all three terminals, then more than one set can be ing properties hold: associated withs 1 under E’. (Under a minimum 3-way cut (a) c(1,2) = c(2,1) = c*, however, the set associated with s 1 is uniquely deter- (b) c(i,j) 2 c* + 1for all other pairs i, j, and mined.) For any subset X of U, let $(X) be the minimum (c) C(l,l) = C(2,2) = c* + 1. cost of a 3-way cut under which X is associated withs 1. It is easy to see that the minimum value for this function over 3.2. The NP-Completeness of 3-Way Cut all X G U equals the minimum weight for any 3-way cut. Moreover, we can use a polynomial-time algorithm for the As mentioned above, the graph C does more than sim- 2-way cut problem to evaluate~ in polynomial time Given ply mle out a promising algorithmic approach. It is the a subset X of U, find a minimum weight cut separating S2 key gadget in our NP-completeness for 3-WAY CUT, a from S3 in the graph obtained by deleting SI and all the local replacement transformation from the SIMPLE MAX vertices in X from G. Add to the weight of this cut the CUT problem [8,9]. One replaces each edge of the original weight of all edges with precisely one endpoint in graph with a copy of C, identifying the vertices x and y X u {sl ). Therefore, if~ were submodular (for all graphs), with the edge’s endpoints. Details are in the full paper. we could solve the 3-way cut problem in polynomial time. The graph constructed in our proof does not have Unfortunately, this is not the case. Consider the 9- bounded vertex degrees. TMs is unavoidable, so long as we vertex graph C depicted in Figure 6. Note that in addition assume all edge weights are equal. If k is fixed, all edge to the three terminals s 1,s2 ,s3, the graph contains two weights are equal, and there is a bound don vertex degree, specified vertices x and y. The 12 edges incident on the ter- then Muhiway Cut can be solved in polynomial time! minals have weight 4, as indicated in the figure. The other Observe that in thk case the weight of a cut is simply the 6 edges, unlabeled in the figure, have weight 1. Let c* be number of edges it contains, and an optimal cut can contain the cost of an optimal 3-way cut for C. For each i ,j, no more than kd edges (since the cut that simply breaks all 1

3.3. Reducing the Instance Size The results of Sections 4.1 and 4.2 effectively dash any hope of finding optimal k-way cuts, k z 3 efficiently by means of 2-way cut (i.e. max flow) algorithms. Such algo- rithms may still be useful, however, as we shall see in this and the next section. Recall that an isolating cut for a ter- minal si is a set of edges that separates si from the other 4 two terminals, and that minimum weight isolating cuts can be found in O (nmlog(n2/nz)) time by performing max flow computations in a modified graph. The following HGURE 6. Graph C: Submodularity counterexsmple Lemma implies that the computation of minimum weight and NP-completeness gadget. isolating cuts can be used to reduce the number of vertices

248 in an instance. Suppose G = (V,E) is a connected graph 3.4. Near-Optimal Multiway Cuts with s~ltied te~mds ~1,$2, ..., sk. If one is willing to settle for cuts that are only near- optimrd, one can exploit a bit further our ability to construct Lemma 4.2. Suppose i = {1,2,...,kJ,k23. Let Ei be optimum isolating cuts. Consider the following straightfor- a minimum weight isolating cut for terminal si, and let Vi ward heuristic. be the set of vertices that rew”n connected to si when the Isolation Heuristic edges of Ei are removedfiom G. Then there exists an opti- mal k-way cut for G that leaves all the vertices of Vi con- 1. For ~ < i < k construct a minimum weight isolating nected to si. cut Ei for terminal si. 2. Determine h such that ~A has maximum weight Using Lemma 4.2, we can reduce the number of ver- among dl the Ei’s. tices in our instance by IVi -1 ~ Simply construct a new graph in which all the vertices of Vi are merged into the 3. ht ~ be the union of dl cuts ~1 except ~h. terminal si. An optimal k-way cut for this shrunken graph 4. Return ~. will induce an optimal cut for the original one. Note that the Isolation Heuristic clearly outputs a k-way In order to get the maximum effect from applying cut. Moreover, it can be implemented to run in Lemma 4.2 in this way, we should start with the minimum 0(knmlog(n2/m) time by using the max flow algorithm of isolating cut for si such that Vi is as big as possible. Let us [10] to compute each of the k required isolating cuts. This say that a set Vi is an isoiation set for a terminal Si if it is is the heuristic to which we referred in Theorem 4 of the the set of vertices left connected to si by some minimum Introduction. A more precise statement of that theorem can weight isolating cu~ Let us call it an optimum isolation set now be given, for si if it has maximum cardinality over all isolation sets Theorem 4. The Isolation Heuristic constructs a k-way for si. From observations made in [6, pp.10-13], it can be cut whose weight is guaranteed to be no more than seen that the optimum isolation set for a given terminal is 2(k - 1)/k times the optimal weight. unique and contains all other isolation sets for that termi- Proof. We first consider the upper bound, Let ~ bt_an opti- nal. It can be found by performing one maximum-flow mal k-way, and let W = w(~). For 1 S i < k, let ~i be the computation followed by some linear-time post-processing. set of vertices left connected to si by ~, and let Ei be the A corollary of the following Lemma is that k optimum iso- setof edges in ~ with one endpoint in ~i. Note first that lating set computations suffice to shrink G as far as it can for ea~h i, the set fii is an isolating cut for si. Hence w(zi) go. 2 w(Ei). Thus Lemma 4.3. Let Vi be the optimum isolation set for si, I < i

249 schemes are known, such as MAX 3-SAT, the problem of “Colored Multiway Cut” problem can be more general. finding a truth assignment for a (not-necessarily satisfiable) (The above merging trick need not for instance preserve instance of 3-SAT that maximizes the number of satisfied planarity or acyclicity.) Nevertheless, the dynamic pro- clauses. See the full paper for a more-detailed explanation gramming algorithm mentioned in the Introduction for of these matters. MuMway Cut on trees extends in a natural way to the Col- ored Multiway Cut problem, yielding an O (nk) algorithm, 4. Related Results and Open Problems as Erd6s and Sz4kely observe. This in turn implies that if Our NP-completeness results in Sections 3 and 4 can be G is such that &leting all the terminals renders it acyclic, adapted to several related problems of interest. In 1969, T. then Multiway Cut can itself still be solved in O(nk) time. C. Hu [14] raised the question of the complexity of the fol- (Simply split ~ch terminal si into &gree(si ) separate ver- lowing problem. Suppose we are given a list of vertex tices, one for each edge incident on si, assign color i to all ptis (Ui, Vi), 1< is k, and are asked to find a minimum the derived vertices, and apply the abovementioned algo- c(u~,u*,...,~&,vl,v2,..o,v~) cut, i.e., a minimum weight rithm for Colored Multiway Cut on trees to the resulting set of edges separating =h pti of vertices ~i, vi, graph [5].) 1< i

250 2-way cuts based on partitions of the set of terminals into I-MmcetonUniversity Press,F%mceton,NJ, 1962. sets of size four. It can be shown that the average weight of 7. G. N. FREDERICXSON,4‘Fast algorithms for shortest paths in these cuts is at most 4/7 times the weight of art optimal 8- planar graphs, with applications,” SIAM J. Comput. 16 way cut, and that there exists a set of three of these cuts (1987), 1004-1022. whose union is art 8-way cut and whose total weight is no 8. M. R. GAMY ANDD. S. JOHNSON,Computers and Intractabil- more than average. This yields the claimed bound. More- ity: A Gw”de to the Theory of NP-Completeness, W. H. Free- ma New York, 1979. over, the running time is once again an improvement on the 9. M. R. GARRY,D. S. JOHNSON,AND L. STOCKMEYZR,“Some Isolation Heuristic, which in this case would require eight simplified NP-complete graph problems,” Theor. Comput. max flow computations. This is because we can show that Sci. 2 (1976), 237-267. it suffices to restrict attention to just seven of the 35 possi- 10. A. V. GOLDBERGAND R. E. TARJAN,“A new approach to the ble partitions of the eight terminals into sets of size four maximum-flow problem,” J. fiSSOC. bmput. Mach. 35 (the seven being derived from the rows of a Hadamard (1988), 921-940. matrix). 11.0. GOLDSCHWDTAND D. S. HOCHBAUM “Polynomial algo- Unfortunately, the above approach does not yield rithm for the k-cut problem,” in “Proceedings 29th Ann. Syrnp. on Foundations of Computer Science,” IEEE Com- improvements over the Isolation Heuristic for any values of puter Society, Los Angeles, Calif., 1988,444-451. k other than 4 and 8. Is there some general technique that 12. M. GR&SCHEL, L. LOV~SZ, AND A. SCHRIJVER,“The ellip- will improve on the Isolation Heuristic for arbitrarily large soid method and its consequences in combinatorial optimiza- values of k? What about simply beating our bound for the tion,” Combinatorics 1 (1981), 169-198. caseofk =3? 13. D. S. HOCHBAUMAND D. B. SHMOYS,“An 0( IV12)algo- Turning to our optimization algorithms for the planar rithm for the planar 3-cut problem,” SL4M J. Algebraic and case, the obvious question is whether the running times can Discrete Methods 6 (1985), 707-712. be improved, although for the case of general k the 14. T. C. I-Iu, Integer Programming and Network F1OWS, improvement would have to be substantial to be interesting. Addison-Wesley Publishing Co., Redmg, MA, 1969. For instance, although we would expect any algorithm to be 15. E. L. LAWI.ER,Combinatorial Optimization: Networks and h4atroids, HoIt, Rinehart and Winsto~ New York, 1976. exponential in k, the exponent containing k might not have 16. D. LIECHTENSTEIN,“Planar formulae and their uses,” SIAM J. to be attached to n. Could there be an algorithm whose Comput. running time was ckna, where a was independent of k? 11 (1982),329-343. 17. C. H. PAPADIhn’raIouANDK. SI’EIOUTZCombinatorial Opti- mization: Algorithms and CompLmity, Prentice-Hall, Inc., REFERENCES Englewood Cliffs, NJ, 1982. 18. C. H. PAPADIhtrTRIOUAND M. YANNAKAXIS, “Optimization, 1. S. CHOPRAAND M. R. Mo, “On the multiway cut polyhe- approximatio~ and complexity classes,” J. Comput. System dron,” Networks 21 (1991), 51-89. Sci. 43 (1991), 425-440. 2. W. H. CUNNINGHAM “The optimal multiterminal cut prob- 19. H. SARANAND V. V. VAZIRANI, “Finding k-cuts within twice lem,” DIMACS Series in Disc. Math. and Theor. Comput. the optimal,” in ‘ ‘Pzoceedmgs 32nd AuL Symp, on Founda- Sci. 5 (1991), 105-120. tions of Computer Science,” IEEE Computer Society, Los 3. E. DMIIJMUS, D. S. JOHNSON,C. H. pAPADIHOU, P. D. Angeles, Cslif., 1991,743-751. SEYMOUR, AND M. YANNAXAXIS, “The complexity of multi- 20. H. S. STONE,“Multiprocessor scheduling with the aid of net- way cuts,” extended abstract (1983). work ftOW alg;riduns,” IEEE - Trans. Soj?ware 4. P. L. M& AND L. A. SZEXELY, “Evolutionary trees: An Engirwering SE-3 (1977), 85-93. integer mukicommodity msx-flow rein-cut theorem,” Adv. in 21 M. YANNAKAKLS,P. C. KANELLAIUS,S. c. COSMADAIGS,ANO Appl. Math., to appear. C. H. PAPADIMITRIOU,“Cutting snd partitioning a graph after 5. P. L. EIU)?SAND L. A. SZEKELY, “On weighted multiway a fixed patt~” in “Automata, Languages, and Program- cuts,” unpublished manuscript (1991). ming,” Lecture Notes in Computer Science, Vol. 154, 6. L. R. FORD,JR, ANII D. R. FULKERSON,Flows in Networks, Springer, Berlin, 1983,712-722.

251