Finding minimum 3-way cuts in hypergraphs Mingyu Xiao Department of Computer Science and Engineering The Chinese University of Hong Kong Hong Kong SAR, CHINA Email:
[email protected] Abstract. The minimum 3-way cut problem in an edge-weighted hypergraph is to find a partition of the vertices into 3 sets minimizing the total weight of hyperedges with at least two endpoints in two different sets. In this paper we present some structural properties for minimum 3-way cuts and design an O(dmn3 ) algorithm for the minimum 3-way cut problem in hypergraphs, where n and m are the numbers of vertices and edges respectively, and d is the sum of the degrees of all the vertices. Our algorithm is the first deterministic algorithm finding minimum 3-way cuts in hypergraphs.
1
Introduction
Given a hypergraph G = (V, E) with nonnegative hyperedge weights, and an integer k, a k-way cut for G is a subset of hyperedges whose deletion separates the graph into k nonempty components, and the minimum k-way cut problem is to find a k-way cut minimizing the total weight of it. In the literature k-way cuts are also referred as k-cuts or multi-component cuts. The minimum k-way cut problem is an extension of the classical minimum cut problem, and it has great applications in the area of VLSI system design, parallel computing systems, clustering, network reliability and finding cutting planes for the travelling salesman problems. The minimum k-way cut problem in graphs was well studied during the past twenty years. First, Goldschmidt and Hochbaum [5] proved that this problem is NP-hard when k is part of the input and presented a polynomial algorithm for 2 fixed k with running time O(nk T (n, m)), where T (n, m) is the time required to compute a minimum cut or maximum flow in an edge-weighted graph. Recently √ Kamidoi et al. [8] improved the running time bound to O(n4k/(1−1.71/ k)−34 T (n, m)). Karger and Stein [10] proposed a Monte Carlo algorithm with O(n2(k−1) log3 n) time. It seems that all the above algorithms do not work in hypergraphs and no solid results in hypergraphs for k > 2 are known. When k is a small number, the problem has also drawn much attention. The minimum 2-way cut problem is commonly known as the minimum cut problem. Another version of the minimum 2-way cut problem is the minimum (s, t) cut problem, which asks us to find a minimum cut that splits two given vertices s and t. These two problems are classical and fundamental problems in
2
Mingyu Xiao
the subject of graph connectivity. For graphs, the minimum cut problem can be solved in O(mn + n2 log n) time by Nagamochi and Ibaraki’s algorithm [17] or Stoer and Wagner’s algorithm [21], and the minimum (s, t) cut problem can be solved in O(mn log n2 /m) time by Goldberg and Tarjan’s algorithm [4] and O(min{n2/3 , m1/2 }m log(n2 /m) log U ) time by Goldberg and Rao’s algorithm [3], where U is the maximum capacity of the edge. For hypergraphs, there are also some good results on them. Klimmek and Wagner [13] and Mak and Wong [16] extended Stoer and Wagner’s algorithm [21] to hypergraphs and gave an O(dn + n2 log n) algorithm for the minimum cut problem in hypergraphs, where d is the sum of the degrees of all the vertices. Lawler [14] showed that a minimum (s, t) cut in a hypergraph can be computed by using one maximum flow computation in an auxiliary digraph with n + 2m vertices and 2d + m edges. Then a minimum e (s, t) cut in a hypergraph can be found in O(dm) time. In the remainder of the paper, we use T (n, m) and T (n, m, d) to denote the running times of computing a minimum (s, t) cut in a graph and a hypergraph respectively. For the minimum 3-way cut problem in graphs, Kapoor [9] and Kamidoi et al. [7] showed that it can be solved by using O(n3 ) maximum flow computations. Burlet and Goldschmidt [1] and Nagamochi and Ibaraki [18] improved the result to O(n2 ). Furthermore, Nagamochi et al. [18], [19] proved that the minimum k e k-way cut problem can be solved in O(mn ) time for k = 4, 5, 6. Unfortunately, we do not find many results in hypergraphs for k ≥ 3. In fact, Nagamochi et al. [18] considered the minimum {3, 4}-way cuts in hypergraphs, but their measure is different, which makes their problem easier. Currently the frequently used algorithms in VLSI system design to partition a hypergraph are some heuristic algorithms without any theoretic guarantee, such as hMETIS [11] and other algorithms based on multilevel partitioning framework [12]. Effective algorithms for minimum 3-way cuts in hypergraphs have potential applications in VLSI system design. A deeper understanding of the structure of 3-way cuts will help us investigating the structure of the general k-way cut problem. Motivated by these, in this paper we study the minimum 3-way cut problem in hypergraphs. Roughly speaking, there are three techniques frequently used to design algorithm for finding minimum 3-way cuts, as well as minimum k-way cuts, in graphs. The first one is based on searching minimum (S, T ) cuts. The first algorithm for the general k-way cut problem presented by Goldschmidt and Hochbaum [5] is an example. They proved that there are 4 vertices a, b, c, d such that the minimum ({a, b}, {c, d}) cut is contained in a minimum 3-way cut. If we try all the O(n4 ) possibilities by taking each one as a subset of a 3-way cut and finding a such 3-way cut with weight minimized, then we can get a minimum 3-way cut by selecting a lightest one among all the O(n4 ) 3-way cuts. Later Kapoor [9] improved this method to O(n3 ) maximum flow computations. The second technique is enumerating all small 2-way cuts (We will simply call a 2-way cut a cut). We sort all cuts in the graph in the order of nondecreasing weights. If we try on each cut by taking it as a subset of a 3-way cut, finally we will meet a cut contained in a minimum 3-way cut and then get a minimum 3-way cut.
Finding minimum 3-way cuts in hypergraphs
3
Nagamochi et al. [18] proved that at least one of the first O(n) small cuts is contained in a minimum 3-way cut and the first O(n) cuts can be enunciated by using O(n2 ) maximum flow computations. So a minimum 3-way cut can be found in O(n2 T (n, m)) time. Levine [15] proved that a minimum 3-way cut can be found by considering the first O(n) small cuts of all the 4/3-minimum cuts in 3 graphs. Since Karger and Stein’s algorithms [10] can find all the 4/3-minimum cuts and a minimum cut in O(n2 log n) and O(m log3 n) time with high probability respectively, Levine got a Monte Carlo algorithm finding minimum 3-way cuts with time bound O(mn log3 n). The last technique is based on ‘divide-andconquer’, such as Kamidoi et al.’s algorithm [7]. We first find a proper cut of the graph that is noncrossing with a minimum 3-way cut, then we can find minimum 3-way cuts in two smaller graphs. The hard part of this method is that the proper cut is not always easy to get and sometimes we will turn to the second technique to find one. All of the above algorithms can not be extended to the problem in hypergraphs directly. We look at one of the fastest algorithms for finding minimum 3-way cuts in graphs presented by Nagamochi et al. [18]. Their algorithm is based on the observation that at least one of the first r cuts {C1 , · · · , Cr } in the order of nondecreasing weights is contained in a minimum 3-way cut, where r is the first integer such that Cr is crossing with Cq (1 ≤ q < r). We give an example in Figure 1 to show that this theorem does not hold in hypergraphs. G = (V, E) is a hypergraph with 6 vertices and 6 hyperedges, V = {a, b, c, d, e, f }, E = {abc, cdef, cd, de, ef, cf }, and w(abc) = 4.5, w(cdef ) = 2, w(cd) = w(de) = w(ef ) = e(cf ) = 1. [{a, b, c, d}, {e, f }] and [{a, b, c, f }, {d, e}] are the first two small cuts and they are crossing, but none of them is contained in the minimum 3-way cut [{a}, {b}, {c, d, e, f }]. In this paper, based on the idea of Kamidoi et al.’s divided-and-conquer algorithm [7], we define a class of cuts called k-way free cuts (See Definition 3) and present a framework of designing algorithms for the minimum k-way cut problem in hypergraphs by finding k-way free cuts. Then we prove that minimum 3-way cuts in hypergraphs can be found by using O(n3 ) hypergraph minimum (s, t) cut computations.
a
c
1
1
2
4.5 b
f
1
d 1 e
The first two small cuts: [{a, b, c, d}, {e, f}] and [{a, b, c, f}, {d, e}]. The minimum 3-way cut: [{a}, {b}, {c, d, e, f}].
Fig. 1. The first two small cuts not being contained in a minimum 3-way cut
4
Mingyu Xiao
2
Preliminaries
Let G = (V, E) be an edge-weighted hypergraph with |V | = n vertices and |E| = m hyperedges. For any hyperedge e ∈ E, V (e) denotes the set of endpoints of e. An induced sub hypergraph H = G[V 0 ] with V 0 ⊆ V is a sub hypergraph with hyperedges whose endpoints in V 0 . For any hyperedge subset C ⊆ E, w(C) denotes the total weight of the hyperedges in C. Let X1 , X2 , · · · , Xk ⊂ V be k (2 ≤ k ≤ n) disjoint nonempty subsets of vertices, then [X1 , X2 , · · · , Xk ] denotes the set of hyperedges crossing at least two different vertex sets of {X1 , X2 , · · · , Xk } (Hyperedges that the endpoints of each of them are in at least two different sets of {X1 , X2 , · · · , Xk }). We also define another important hyperedge set: Sk e(X1 , X2 , · · · , Xk ) = {e|e ∈ [X1 , X2 , · · · , Xk ]&V (e) ⊆ i=1 Xi }. There is an illustration for these two notations in Figure 2. Let V = {a, b, c, d, e} and E = {ab, abc, abe, ae, bde, cd}. Then [{a, b}, {c}, {d}] = {abc, bde, cd} and e({a, b}, {c}, {d}) = Sk {abc, cd}. When i=1 Xi = V , i.e., {X1 , X2 , · · · , Xk } is k-partition of V , we say [X1 , X2 , · · · , Xk ] is a k-way cut of the hypergraph and Xi is a component of the k-way cut. Over all the k-way cuts those with the minimum weight are called minimum k-way cuts. A 2-way cut [X, X] is also simply called a cut of the hypergraph, where X = V − X. If we require a special vertex s in X and a special vertex t in X, then such kind of cuts are called (s, t) cuts. Generally for any two disjoint sets of vertices S and T , a group of hyperedges is called an (S, T ) cut, if deleting it splits S away from T . Merging some vertices means identifying these vertices as a new vertex while keeping all the hyperedges incident on them (we also need to update the hyperedges: combining ‘parallel’ hyperedges with weight being the sum of all the weights and deleting self-loops). For a vertex subset X ⊂ V , GX stands for the graph generated by merging X = V − X into a single vertex. This notation is frequently used in this paper. Sometimes a singleton set {s} is simply written as s, w([X1 , X2 , · · · , Xk ]) as w(X1 , X2 , · · · , Xk ), and w(e(X1 , X2 , · · · , Xk )) as we (X1 , X2 , · · · , Xk ).
a
5 vertices: a, b, c, d, e b
e
d
c
6 hyperedges: ab, abc, abe, ae, bde, cd [{a, b}, {c}, {d}] = {abc, bde, cd} e({a, b}, {c}, {d}) = {abc, cd}
Fig. 2. An illustration for notations [] and e()
Definition 1. Two cuts [X, X] and [Y, Y ] are noncrossing if X ⊆ Y or X ⊆ Y . Otherwise, we say that they are crossing.
Finding minimum 3-way cuts in hypergraphs
5
Note that when X = Y or X = Y , the two cuts are the same. Some references exclude this case in their definition of noncrossing. The properties of noncrossing between two cuts are studied in many references [6], [2]. Here we extend the definition of noncrossing to describe a relation between a cut and a k-way cut. Definition 2. A cut [X, X] and a k-way cut [Y1 , Y2 , · · · , Yk ] are noncrossing if there exists i ∈ {1, 2, · · · , k} such that X ⊆ Yi or X ⊆ Yi . Otherwise, we say that they are crossing. Lemma 1. Given a hypergraph G and two vertices u and v in G, let G0 be the hypergraph after merging u and v into a new vertex, Ck0 be a minimum k-way cut of G0 and Ck be the corresponding hyperedge set of Ck0 in G. If there is a minimum k-way cut C of G such that u and v are in a same component of C, then Ck is also a minimum k-way cut of G. Proof. Let C 0 be the corresponding hyperedge set of C in G0 . u and v are in a same component of C, so C 0 is a k-way cut of G0 . Ck0 is a minimum k-way cut of G0 , and then w(Ck ) = w(Ck0 ) ≤ w(C 0 ) = w(C). Thus, Ck is a minimum k-way cut of G. Lemma 2. Given a hypergraph G and a cut C = [X, X] of G, let CX and CX be a minimum k-way cut of GX and GX respectively, where GX is the graph obtained by merging X into a single vertex and GX is the graph obtained 0 0 by merging X into a single vertex. And let CX and CX be the corresponding edge sets of CX and CX in G respectively. If there is a minimum k-way cut 0 0 or CX is a minimum k-way cut of G. noncrossing with cut C, then either CX Proof. Assume that minimum k-way cut Ck = [Y1 , Y2 , · · · , Yk ] is noncrossing with cut C. Then there exists i ∈ {1, 2, · · · , k} such that X ⊆ Yi or X ⊆ Yi . According to Fact 1, when X ⊆ Yi , we can merge X into a single vertex; when X ⊆ Yi , we can merge X into a single vertex. Thus, the lemma holds. Lemma 2 provides a prospective divide-and-conquer method to find a minimum k-way cut in hypergraphs. If we get a proper cut which is noncrossing with a minimum k-way cut and each component of the cut contains at least two vertices, then we can find a minimum k-way cut by searching on two smaller graphs. This idea is one of the main ideas we used to find minimum 3-way cuts in this paper. For convenience, we give the following definition. Definition 3. A cut is k-way free, if there exists a minimum k-way cut noncrossing with it. Note that k-way free is just used to describe cuts, but not for k-way cuts for k ≥ 3. To find a minimum k-way cut, we need to find proper k-way free cuts. In Section 3.2, we first present some structural properties of minimum 3-way cuts, which provide us some ways to get 3-way free cuts. The detailed algorithm and running time analysis are presented in Section 4. In Section 3.1, we first give some properties for hyperedges, which will be used in our main proofs.
6
3 3.1
Mingyu Xiao
Properties Hyperedge’s Properties
S Lemma 3. Let {X1 , X2 , · · · , Xk } {Y1 } be a group of disjoint nonempty subsets of vertices in a hypergraph, then [X1 + Y1 , X2 , · · · , Xk ] ⊇ [X1 , X2 , · · · , Xk ] + e(Y1 , X2 + · · · + Xk ). S If {X1 , X2 , · · · , Xk } {Y1 } is a partition of the vertex set, then [X1 + Y1 , X2 , · · · , Xk ] = [X1 , X2 , · · · , Xk ] + e(Y1 , X2 + · · · + Xk ). S Lemma 4. Let {X1 , X2 , · · · , Xk } {Y1 , Y2 } be a group of disjoint nonempty subsets of vertices in a hypergraph, then [X1 +Y1 , X2 +Y2 , X3 , · · · , Xk ] ⊇ [X1 , · · · , Xk ]+e(Y1 +Y2 , X3 +· · ·+Xk )+e(Y1 , X2 )+e(X1 , Y2 ). Fact 3 and Fact 4 can be simply proved by enumerating all kinds of hyperedges and we just ignore the detailed proof steps here. These two facts are frequently used in the proofs in Section 3.2, and to make the proofs fluent we do not point out which fact being used each time. In fact, we only use the cases k = 2 and 3, which are somewhat intuitive. 3.2
Structural Properties
Lemma 5. In a hypergraph, any minimum cut is 3-way free. Proof. We need to prove that for any minimum cut C = [X, X] of G, there is a minimum 3-way cut C3 such that C and C3 are noncrossing. Let C30 = [Y1 , Y2 , Y3 ] T be an arbitrary minimum 3-way cut, and Zij = Xi Yj , (i = 1, 2, j = 1, 2, 3), where X1 = X and X2 = X (See Figure 3). If C and C30 are crossing, then ∃j ∈ {1, 2, 3} such that Z1j and Z2j are nonempty sets. Without loss of generality, we assume that they are Z11 and Z21 . At least one of Z13 and Z23 is not an empty set. Without loss of generality, we further assume that Z23 6= ∅. Case 1: Z22 6= ∅. We will prove that C3 = [Y1 + Z12 + Z13 , Z22 , Z23 ] is a satisfied minimum 3-way cut (See Figure 3). It is easy to see that C3 is a 3-way cut noncrossing with C. We only need to prove that C3 is minimum. [Z11 , Z11 ] = [Z11 , X2 ] + e(Z11 , Z12 + Z13 ) and [X1 , X2 ] = [Z11 , X2 ] + e(Z12 + Z13 , X2 ). [X1 , X2 ] is a minimum cut. w(Z11 , Z11 ) ≥ w(X1 , X2 ). So we (Z11 , Z12 + Z13 ) ≥ we (Z12 + Z13 , X2 ).
(1)
On the other hand, C3 = [Y1 + Z12 + Z13 , Z22 , Z23 ] = [Y1 , Z22 , Z23 ] + e(Z12 + Z13 , Z22 + Z23 ) and C30 = [Y1 , Y2 , Y3 ] ⊇ [Y1 , Z22 , Z23 ] + e(Y1 , Z12 + Z13 ). It is obvious that e(Z12 + Z13 , Z22 + Z23 ) ⊆ e(Z12 + Z13 , X2 ) and e(Z11 , Z12 + Z13 ) ⊆
Finding minimum 3-way cuts in hypergraphs Y1
Y2
Y3
X1
Z11
Z12
Z13
X2
Z 21
Z 22
7
Z 23
: the minimum 3-way cut C3 in Case 1.
Fig. 3. Case 1 of the proof
e(Y1 , Z12 + Z13 ). According to (1), we get that w(C3 ) ≤ w(C30 ). C3 is a minimum 3-way cut. Case 2: Z22 = ∅. For this case, Z12 6= ∅. Let C3 = [Z11 , Z12 , Z21 + Y3 ]. Like what we do in Case 1, we will prove that C3 is a satisfied minimum 3-way cut. [Z23 , Z23 ] = [X1 , Z23 ] + e(Z21 , Z23 ) and [X1 , X2 ] = [X1 , Z23 ] + e(X1 , Z21 ). (Z23 , Z23 ) ≥ w(X1 , X2 ). So we (Z21 , Z23 ) ≥ we (X1 , Z21 ).
(2)
C3 = [Z11 , Z12 , Z21 + Y3 ] = [Z11 , Z12 , Y3 ] + e(Z11 + Z12 , Z21 ), where e(Z11 + Z12 , Z21 ) = e(Z11 , Z21 )+e(Z12 , Z21 )+e(Z11 , Z12 , Z21 ) ⊆ e(Z12 , Z21 )+e(X1 , Z21 ). And C30 = [Y1 , Y2 , Y3 ] ⊇ [Z11 , Z12 , Y3 ]+e(Z12 , Z21 )+e(Z21 , Y3 ) ⊇ [Z11 , Z12 , Y3 ]+ e(Z12 , Z21 ) + e(Z21 , Z23 ). According to (2), we know that w(C3 ) ≤ w(C30 ). We have discussed all the cases and then finished the proof. Lemma 5 shows a noncrossing property between minimum cuts and minimum 3-way cuts. The noncrossing property between minimum (s, t) cuts and minimum 3-way cuts is a little weaker. Given two vertices s and t, the minimum (s, t) cut may not be 3-way free even in graphs. We give an example in Figure 4. G = (V, E) is a graph with 4 vertices and 4 edges, V = {a, b, s, t}, E = {ab, bt, st, as}, and w(ab) = 1, w(bt) = 2, w(st) = 3, w(as) = 2. It is easy to see that [a, b, {s, t}] is the unique minimum 3-way cut and [{a, s}, {b, t}] is the unique minimum (s, t) cut in the graph. They are crossing. In the next two lemmas we show some further properties between minimum (s, t) cuts and minimum 3-way cuts. Lemma 6. Given a hypergraph G and two vertices s and t in it, if there is a minimum 3-way cut whose removal disconnects s from t (s and t are in two different components of the 3-way cut), then any minimum (s, t) cut is 3-way free. Proof. The proof is based on the proof of Lemma 5. Let C30 = [Y1 , Y2 , Y3 ] be a minimum 3-way cut, and s and t be two vertices in two different components of C30 . Suppose C = [X1 , X2 ] is a minimum (s, t) cut, where X2 = X1 . Let T Zij = Xi Yj , (i = 1, 2, j = 1, 2, 3). Without loss of generality, we also assume
8
Mingyu Xiao
s
3
2
t
2
a
b
1 : the minimum ( s, t ) cut.
: the minimum 3-way cut.
Fig. 4. A minimum (s, t) cut not being 3-way free
that Z11 , Z21 6= ∅,s ∈ X1 , t ∈ X2 , and t ∈ Y3 . Then t ∈ Z23 and s is in either Z11 or Z12 . Case 1: s ∈ Z11 . The proof just follows the proof of Lemma 5, because [Z11 , Z11 ] and [Z23 , Z23 ] are still (s, t) cuts and the two cases in the proof of Lemma 5 still work. Case 2: s ∈ Z12 . When Z22 6= ∅, we exchange Y1 and Y2 and then it becomes Case 1. When Z22 = ∅, we only need to do Case 2 in the proof of Lemma 5. For this case, [Z23 , Z23 ] is still an (s, t) cut, so the proof is the same. Lemma 7. Given a hypergraph G and two disjoint vertex subsets S, T ⊂ V , if there is a minimum 3-way cut whose removal disconnects S from T , then any minimum (S, T ) cut is 3-way free. Proof. Let C30 = [Y1 , Y2 , Y3 ] be a minimum 3-way cut whose removal disconnects T S from T , C = [X1 , X2 ] be a minimum (S, T ) cut, and Zij = Xi Yj , (i = 1, 2, j = 1, 2, 3). Since removal of C30 will disconnect S from T , either S or T is contained in a component of C30 . Without loss of generality, we assume that S ⊆ Y1 . Furthermore, we assume that S ⊆ X1 and T ⊆ X2 . Then S ⊆ Z11 and S T ⊆ Z22 Z23 . When T is also contained in a component of C30 , by Fact 1 we can safely merge S into a single vertex and merge T into a single vertex. The minimum 3-way cut in the remaining graph is still a minimum 3-way cut in the original graph. And by Lemma 6 we know that there is a minimum 3-way cut noncrossing with C. Otherwise, we let T1 = T ∩ Y2 and T2 = T ∩ Y3 . T1 , T2 6= ∅. For this case, we can prove that C3 = [Y1 + Z12 + Z13 , Z22 , Z23 ] is a minimum 3-way cut noncrossing with C like what we do in Case 1 of the proof of Lemma 5. The reason is that T1 ⊆ Z22 6= ∅ and T2 ⊆ Z23 6= ∅, and [Z11 , Z11 ] is still an (S, T ) cut. If we want to use Lemma 2 to design algorithms, we first need to find a 3-free cut [X, X] such that neither X nor X only contains one vertex. The 3-way free cuts discussed above, including the minimum cuts and the minimum (s, t) cuts, may not have this property. For convenience, we give the following definition.
Finding minimum 3-way cuts in hypergraphs
9
Definition 4. A cut [X, X] is called a 2-size cut, if |X| ≥ 2 and |X| ≥ 2. Over all the 2-size cuts those with the minimum weight are called minimum 2-size cuts. Lemma 8. Let G be a hypergraph with more than 6 vertices. If G has a minimum 3-way cut such that each component of it has at least 2 vertices, then any minimum 2-size cut in G is 3-way free. Proof. Let the minimum 3-way cut T be C3 = [Y1 , Y2 , Y3 ], the minimum 2-size cut be C = [X1 , X2 ], and Zij = Xi Yj , (i = 1, 2, j = 1, 2, 3). We will prove the lemma by using Lemma 7. If there is a component of C3 being contained in a component of C, say Y1 ⊆ X1 , we can prove the lemma as the follows. Y1 has at least two vertices a and b. X2 has least two vertices c and d, and c, d ∈ Y2 ∪ Y3 . Let S = {a, b} and T = {c, d}. Removal of C3 will disconnect S from T and C is a minimum (S, T ) cut. By Lemma 7 we know the lemma holds. Otherwise, none of Zij (i = 1, 2, j = 1, 2, 3) is an emptyset. G has more than 6 vertices. At least one of Zij (i = 1, 2, j = 1, 2, 3) contains more than one vertex. Without loss of generality, we assume that two different vertices a, b ∈ Z11 . Z22 , Z23 6= ∅. Assume that c ∈ Z22 and d ∈ Z23 . Let S = {a, b} and T = {c, d}. We can also prove the lemma by using Lemma 7. Remark In Lemma 8, if graph G has right 6 vertices, the result may not hold. Here is an example. G = (V, E) is a hypergraph with 6 vertices and 5 hyperedges, V = {a, b, c, d, e, f }, E = {ad, be, cf, abc, def }, and w(ad) = w(be) = w(cf ) = 2.5, w(abc) = w(def ) = 4. [{a, d}, {b, e}, {c, f }] is the unique minimum 3-way cut and each component of it has two vertices. [{a, b, c}, {d, e, f }] is the unique minimum 2-size cut. They are crossing. Lemma 9. A minimum cut may not be k-way free, k ≥ 4. Two examples that minimum cuts are not being {4, 5}-way free are shown in Figure 5. In fact, Lemma 6, Lemma 7 and Lemma 8 also do not hold for minimum 4-way cuts.
1 3
3 4 2
2
3
3 3
3 1
: the minimum cut. : the minimum 4-way cut.
: the minimum cut. : the minimum 5-way cut.
Fig. 5. Minimum cuts not being {4, 5}-way free
10
4
Mingyu Xiao
The Algorithm
Using Lemma 2 and lemmas mentioned in Section 3.2, we can design various algorithms for the minimum 3-way cut problem in hypergraphs. But we should pay attention that when we meet a 3-way free cut [X, X] such that X or X contains only one vertex, then our algorithms may not work any more, because GX or GX will not be a smaller graph. At that time, we need to use Lemma 8. Next, we use Lemma 5 and Lemma 8 to design a recursive algorithm. We iteratively find a minimum cut C = [X, X] as a 3-way free cut, and then find minimum 3-way cuts in smaller hypergraphs GX and GX . When the 3-way free cut we found is not 2-size, we turn to Lemma 8. There is a 3-way free cut being 2-size or a minimum 3-way cut such that one component of it has only one vertex (Assume the graph has more than 6 vertices). For the former case, the recursive step can continue. And for the later case, we can find a solution directly by trying on each vertex. In fact, the algorithm only includes Step 1 and Step 4 of the following algorithm still works. The reason for it lies in Lemma 8. Step 2 and Step 3 can accelerate the algorithm sometimes but do not help in the running time analysis. Algorithm Hyper3waycut(G): 0. Initially let the solution set S be the whole edge set E. 1. If the graph has less than or equal to 6 vertices, find the solution directly and return it; otherwise, do 2. Find a minimum cut [X, X] of the graph. 3. If both of X and X have more than one vertex, update S ←− min{Hyper3waycut(GX ), Hyper3waycut(GX )}, where GX is the graph obtained by merging X into a single vertex and GX is the graph obtained by merging X into a single vertex. 4. Otherwise, do 4.1 For each vertex v in the current graph, find a minimum cut Cv in induced subgraph G[V − {v}] and update S ←− min{S, Cv ∪ [v, V − {v}]}. 4.2 Find a minimum 2-size cut [X, X] in the current graph and update S ←− min{S, Hyper3waycut(GX ), Hyper3waycut(GX )}. 5. Return S. In each iteration, we will find a 3-way free cut being 2-size in either Step 3 or Step 4.2 and divide the problem into two smaller problems. Now we consider how much time we will use in each iteration. First we compute a minimum cut in the hypergraph in Step 1. If one component of the cut has only one vertex, we will compute n minimum cuts in Step 4.1 and compute a minimum 2-size cut in Step 4.2. Via brute-force search, a minimum 2-size cut can be found by using O(n4 ) minimum (s, t) cut computations. In fact, we can improve it to O(n2 ) minimum (s, t) cut computations by enumerating small cuts. Vazirani and Yannakakis [22] presented an algorithm for finding all the cuts in a graph in the order of nondecreasing weights by building a 0-1 tree. And the delay between two successive outputs is at most n − 1 minimum (s, t) cut computations. This algorithm still works in hypergraphs. A hypergraph has at most n cuts not being 2-size. So at most we need to compute the first n+1 outputs to get a minimum 2-size cut. We
Finding minimum 3-way cuts in hypergraphs
11
can find a minimum 2-size cut by using O(n2 ) minimum (s, t) cut computations in hypergraphs. Suppose the current graph has n vertices and X has x vertices (2 ≤ x ≤ n−2). Then GX has x + 1 vertices and GX has n − x + 1 vertices. We get recurrence relation: C(n) ≤ C(x + 1) + C(n − x + 1) + O(n2 ),
(3)
where C(n) is the number of minimum (s, t) cut computations used when Hyper3waycut computes on a hypergraph with n vertices. It is easy to verify that C(n) = O(n3 ) satisfies (3). Theorem 1. Algorithm Hyper3waycut finds a minimum 3-way cut in a hy3 e pergraph in O(n3 T (n, m, d)) = O(dmn ) time.
5
Conclusion
In this paper, we have presented an O(dmn3 ) algorithm for finding minimum 3way cuts in hypergraphs. As far as we know, it is the first deterministic algorithm for solving the minimum 3-way cut problem in hypergraphs. k-way partitioning with minimum cost in hypergraphs is one of central problems in VLSI system design [20]. Effective algorithms for small k may have direct applications. But unfortunately most properties and algorithms for k-way cuts in graphs do not hold in hypergraphs, and currently there are not many known algorithms for hypergraphs except some heuristic algorithms without any theoretic guarantee. It would be interesting to find other fast algorithms for the k-way cut problem in hypergraphs, even when k is a small number. Furthermore, to prove the correctness of our algorithm, we present some properties of hypergraphs and minimum k-way cuts, which may be helpful for us to understand the structure of the minimum k-way cuts and differences between the k-way cut problems in graphs and hypergraphs. We note that some good properties for 3-way cuts do not hold for 4-way cut cases, and the algorithm presented in this paper can not be simply extended to the minimum 4-way cut problem in hypergraphs. It seems that other approaches or properties are needed for the minimum k-way cut problem for k ≥ 4.
References 1. M. Burlet, O. Goldschmidt, A new and improved algorithm for the 3-cut problem., Operations Research Letters 21 (5) (1997) 225–227. 2. R. F. Easley, D. Hartvigsen, Crossing properties of multiterminal cuts., Networks 34 (3) (1999) 215–220. 3. A. V. Goldberg, S. Rao, Beyond the flow decomposition barrier., J. ACM 45 (5) (1998) 783–797, a preliminary version appeared in FOCS’97. 4. A. V. Goldberg, R. E. Tarjan, A new approach to the maximum-flow problem, J. ACM 35 (4) (1988) 921–940.
12
Mingyu Xiao
5. O. Goldschmidt, D. Hochbaum, A polynomial algorithm for the k-cut problem for fixed k, Mathematics of Operations Research 19 (1) (1994) 24–37, a preliminary version appeared in FOCS’88. 6. R. E. Gomory, T. C. Hu, Multi-terminal network flows, J. SIAM 9 (4) (1961) 551–670. 7. Y. Kamidoi, S. Wakabayashi, N. Yoshida, A divide-and-conquer approach to the minimum k-way cut problem, Algorithmica 32 (2) (2002) 262–276. 8. Y. Kamidoi, N. Yoshida, H. Nagamochi, A deterministic algorithm for finding all minimum k-way cuts, SIAM Journal on Computing 36 (5) (2006) 1329–1341. 9. S. Kapoor, On minimum 3-cuts and approximating k-cuts using cut trees, in: Proceedings of the 5th International IPCO Conference on Integer Programming and Combinatorial Optimization, Springer-Verlag, London, UK, 1996. 10. D. R. Karger, C. Stein, A new approach to the minimum cut problem, Journal of the ACM 43 (4) (1996) 601–640, preliminary portions appeared in SODA’93 and STOC’93. 11. G. Karypis, V. Kumar, hmetis: A hypergraph partitioning package version 1.5, user manual, http://glaros.dtc.umn.edu/gkhome/fetch/sw/hmetis/manual.pdf (1998). 12. G. Karypis, V. Kumar, Multilevel k-way hypergraph partitioning, VLSI Design 11 (3) (2000) 285–300. 13. R. Klimmek, F. Wagner, A simple hypergraph min cut algorithm, Internal Report B 96-02 Bericht FU Berlin Fachbereich Mathematik und Informatik (1995). 14. E. L. Lawler, Cutsets and partitions of hypergraphs, Networks 3 (3) (1973) 275– 285. 15. M. S. Levine, Fast randomized algorithms for computing minimum {3,4,5,6}-way cuts, in: Proceedings of the 11th annual ACM-SIAM symposium on Discrete algorithms (SODA’00), Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2000. 16. W.-K. Mak, D. F. Wong, A fast hypergraph min-cut algorithm for circuit partitioning, Integration, the VLSI Journal 30 (1) (2000) 1–11. 17. H. Nagamochi, T. Ibaraki, Computing edge connectivity in multigraphs and capacitated graphs, SIAM Journal on Discrete Mathematics 5 (1) (1992) 54–66. 18. H. Nagamochi, T. Ibaraki, A fast algorithm for computing minimum 3-way and 4-way cuts, Mathematical Programming 88 (3) (2000) 507–520. 19. H. Nagamochi, S. Katayama, T. Ibaraki, A faster algorithm for computing minimum 5-way and 6-way cuts in graphs., in: Computing and Combinatorics(COCOON’99), 1999. 20. B. T. Preas, M. Lorenzetti, Physical Design Automation of VLSI Systems, Benjamin-Cummings, California, 1988. 21. M. Stoer, F. Wagner, A simple min-cut algorithm, Journal of the ACM 44 (4) (1997) 585–591, a preliminary version appeared in ESA’94. 22. V. V. Vazirani, M. Yannakakis, Suboptimal cuts: Their enumeration, weight and number, in: W. Kuich (ed.), Automata, Languages and Programming: Proc. of the 19th International Colloquium, Springer, Berlin, Heidelberg, 1992.