A deterministic near-linear time algorithm for finding minimum cuts in planar graphs Parinya Chalermsook∗
Jittat Fakcharoenphol∗
Abstract We present a simple deterministic O(n log2 n)-time divideand-conquer algorithm for finding minimum cuts in planar graphs. This can be compared to a randomized algorithm for general graphs by Karger that runs in time O(m log3 n) and also a deterministic algorithm for general graphs by Nagamochi and Ibaraki that runs in time O(mn + n2 log n). We use shortest paths in the dual graphs to partition the problem, and use the relationship between minimum cuts in primal graphs and shortest paths in dual graphs to find minimum cuts that cross the partitions efficiently.
1 The problem The minimum cut problem is to find the cut that minimizes the weighted sum of edges whose ends are separated by the cut. The size of the minimum cut is the weighted edge-connectivity of the graph. The best running time for the algorithm for this problem is due to Karger [3] who improving the result by Karger and Stein [4] to get an O(m log3 n) randomized algorithm. Although his algorithm works in general graphs, it is also the previous best known for planar graphs. The best known deterministic algorithm by Nagamochi and Ibaraki runs in time O(mn + n2 log n). We refer to [3, 4] for the history of the problem. For planar graphs, we give a simple deterministic divide-and-conquer algorithm that runs in time O(n log2 n). We note that in the unweighted planar graphs, the sizes of the minimum cuts are at most 5; thus, one can use better algorithms by Alon, Yuster, and Zwick [1]. 2 The algorithm Our algorithm is a divide-and-conquer one. To find the minimum cut of graph G, we first find a dividing cut ¯ with some structural property that determines (S, S) two smaller subproblems, G1 and G2 , which are constructed as follows. The nodes of G1 are nodes in S ∗ Dept of Computer Engineering, Kasetsart University, Bangkok 10900, Thailand. Emails: {fengpycs,jtf}@ku.ac.th,
[email protected] Work done while the second author was a graduate student at UC Berkeley and supported by the DPST scholarship and NSF grant CCR-0105533; he would like to thank Satish Rao for discussion.
Danupon Nanongkai∗
with a special supernode v1 which connects to all nodes ¯ The graph G2 are adjacent to edges between S and S. constructed similarly with another v2 as a supernode. In this dividing step, we ensure that the size of the subproblems decreases geometrically. We then recursively find the minimum cuts inside both subproblems. On the one hand, if the minimum cut lies entirely in one of these subproblems, we find it recursively. On the other hand, if the minimum cut lies across S, the structure of S allows us to find it efficiently. 2.1 Minimum cuts and a shortest path tree: the dividing step. This section describes the property of the dividing cut and how we find it in linear time. Recall that a cut in the primal graph corresponds to a cycle in the dual. This motivates us to use a shortest path tree in the dual graph to decompose the graph into two subgraphs. We note that the minimum cuts correspond to cycles of minimum length in the dual. The following lemma shows that we can use shortest paths in the dual to constrain the minimum cuts. We say that paths p1 and p2 cross if they share some node. The number of times that p1 and p2 cross is number of paths (including paths with no edges) of p1 ∩ p2 . Since a cut is a cycle in the dual graph, we can define the number of times a cut crosses any dual path similarly. The following lemma, stating that given a shortest path p in the dual graph, we only need to consider cuts which cross p at most once, can be proved using the property of shortest paths. Lemma 2.1. For any cut C in G which crosses any shortest path p in the dual G∗ of G more than once, there exists a cut C ′ which crosses p at most once with no longer length. The dividing cut that we use can be constructed from a shortest path tree in the dual as follows. For any graph G, consider its dual G∗ . Let T ∗ be a shortest path tree in G∗ which can be found in linear time using the algorithm by Henzinger, Klein, Rao, and Subramanian [2]. The dividing cut corresponds to some cycle S ∗ in G∗ with the following property: there are 3 nodes a, b, and c on S ∗ such that S ∗ can be decomposed
T∗
c
(a)
∗ Pca
∗ Pcb
a F ∗ b Pab
Fa c
(b) a F ∗ b Pab
Figure 1: (a) the dividing cut, (b) proof of lemma 2.3. ∗ ∗ ∗ ∗ ∗ into 3 paths, Pab , Pcb , and Pca where Pca and Pcb are ∗ ∗ paths in T and Pab is a path along some dual face F . (See Figure 1(a).) We note that from lemma 2.1, there ∗ and exists some minimum cut C that crosses each of Pca ∗ Pcb at most once. ¯ corresponding to S ∗ We will use a primal cut (S, S) to decompose the graph into two subgraphs. To find S ∗ , we triangulate G∗ , thus splitting some number of nodes in G. Then, we apply the following lemma.
Lemma 2.2. Given any spanning tree T in a triangulated planar graph G = (V, E), we can find, in linear time, the fundamental cycle determined by some nontree edge e and T that separates the graph into two subgraphs, one inside the cycle and another outside, each containing at most 2/3 fractions of the faces. Proof. (Sketch) A spanning tree T ′ in the dual graph can be formed from the dual edges corresponding to the non-tree edges. By assigning appropriate weights on the nodes of T ′ , an edge separator in T ′ , which exists because of the degree bound, corresponds to the edge e can be found. That proves the lemma.
Since the cut forms a cycle, or a closed curve, in the dual planar graph, it partitions the graph into 2 subgraphs. We now call the subgraph which contains the node vF as the inside of the cut. The other subgraph is called the outside of the cut. Because of this definition, we always use vF as the source for the max-flow computation. The problem remains to find the node on the other side. ∗ Let’s denote by e∗a the last edge on Pac adjacent to ∗ ∗ c . Let face Fa be the face outside S adjacent to e∗a . We want to show that the minimum cuts cannot cross the cut S and contains both F and Fa . Thus, we can find the minimum cut using a single max-flow computation from vF to vFa , where vFa is a node in G corresponding to Fa . We prove this fact in the following lemma. (See example in Figure 1(b).) Lemma 2.3. Any cycle C ∗ in G∗ separating G∗ into two subgraphs, the outside and the inside, which con∗ or tains F and Fa must either (1) cross the path Pac ∗ more than once, or (2) not cross the cycle S ∗ at all. Pbc Proof. Assume that C ∗ crosses S ∗ ; thus, it must cross ∗ S ∗ even number of times. It must cross either Pac or ∗ ∗ Pbc more than once if it crosses S more than two times. Therefore, we can assume that C ∗ only crosses S ∗ twice. ∗ ∗ once and Pbc once. The This implies that C ∗ crosses Pac lemma follows because C ∗ cannot contain both F and Fa . Therefore, to find the minimum cut crossing the dividing cut S, we run one max-flow computation from vF to vFa using the max-flow algorithm for planar graphs by Weihe [6] which runs in time O(n log n). This gives the main result as claimed.
We note the similarity of this lemma and the one in References Lipton and Tarjan’s separator algorithm [5]. [1] Noga Alon, Raphael Yuster, and Uri Zwick. ColorAfter applying this lemma on G∗ and T ∗ , we can coding. Journal of the ACM (JACM), 42(4):844–856, ∗ find the cycle S by noting that the non-tree edge e 1995. ∗ ∗ determines the path Pab and the paths on T = T are [2] Monika R. Henzinger, Philip N. Klein, Satish Rao, ∗ the other two shortest paths determining S . and Sairam Subramanian. Faster Shortest-Path Al2.2 Finding the minimum cut: the conquering step. We assume that we have the cut S and show how to find the minimum cut which crosses S using one max-flow computation in time O(n log n), yielding an O(n log2 n)-time algorithm. More specifically, we show how to find two nodes in G which are on the different sides of the minimum cut crossing the dividing ¯ cut (S, S). Recall that the dual cycle S ∗ corresponding to the dividing cut can be decomposed into three paths one of which lies on some dual face F . Let vF be the node in the primal graph corresponding to F .
[3] [4]
[5]
[6]
gorithms for Planar Graphs. Journal of Computer and System Sciences, 55(1):3–23, 1997. David R. Karger. Minimum cuts in near-linear time. Journal of the ACM (JACM), 47(1):46–76, 2000. David R. Karger and Clifford Stein. A new approach to the minimum cut problem. Journal of the ACM, 43(4):601–640, 1996. Richard J. Lipton and Robert E. Tarjan. A separator theorem for planar graphs. SIAM Journal on Applied Mathematics, 36:177–189, 1979. Karsten Weihe. Maximum (s, t)-flows in planar networks in O(|V | log |V |)-time. Journal of Computer and System Sciences, 55(3):454–476, 1997.