In the first lecture we discussed the Max Cut problem, which is NP-complete, and we presented a very simple algorithm that gives a approximation. Today we will discuss the Min Cut problem, which is in P, and we will present a very simple randomized algorithm to solve it exactly.
My reasons for presenting this algorithm are: (1) it illustrates that non-trivial optimization problems can sometimes be solved by very simple algorithms, (2) the analysis is quite interesting, and (3) most importantly, it has useful consequences that will allow us to present an even more amazing result in the next lecture.
1. Minimum Cuts
Let be an undirected graph. As before, for every we define
The Min Cut problem is to solve
Here we are minimizing over all subsets of the vertices, except for and because those two uninteresting sets have . The Min Cut problem is equivalent to the problem
To see the equivalence, note that any set is a disconnecting set , and given any disconnecting set , we can find a cut by letting be any connected component in .
You should not confuse the Min Cut problem and the Min – Cut problem. In the latter problem, there are two distinguished vertices and we must solve
This problem can be solved by network flow techniques, since the Max-Flow Min-Cut theorem tells us that the solution equals the maximum amount of flow that can be sent from to .
In fact, this gives us a solution to the Min Cut problem as well, because there is a reduction from the Min Cut problem to the Min – Cut problem. It is easy to see that the solution to the Min Cut problem equals the minimum over all pairs of the solution to the Min – Cut problem. (There are more efficient reductions.)
We will present a remarkable randomized algorithm for solving the Min Cut problem which does not use a reduction to the Min – Cut problem. Instead it randomly contracts edges in the graph.
1.1. Edge Contractions
Let be a multigraph, meaning that we allow to contain multiple “parallel” edges with the same endpoints. Suppose that is an edge. To contract the edge means to apply the following operations:
- Add a new vertex .
- For every edge or we add a new edge . This can create new parallel edges, because it might be the case that and both existed, in which case we will create twonew edges .
- Every edge with an endpoint at either or is deleted.
- The vertices and are deleted.
The graph that results from this operation is written .
This process essentially “merges” the two vertices and into a “supervertex” which corresponds to the pair of vertices . After performing several contraction operations, a vertex in the contracted graph is actually a supervertex corresponding to the set of nodes that were contracted together to form . More formally, letting be the original graph, each supervertex in the contracted graph corresponds to a set of vertices . These sets form a partition of , meaning that they are pairwise disjoint and their union is .
The following figure shows the result of contracting the edges , and . In each supervertex we show the set of vertices from the original graph that were contracted together to form the supervertex.
Proof: This follows by induction on the number of contraction operations.
In the example above, and are in the same supervertex, and the path –– in the original graph had all of its edges contracted.
Proof: Consider any set of supervertices in the contracted graph. Let be the corresponding set of vertices in . The edges between and in are in bijective correspondence with the edges between and in . Therefore the size the cut in equals the size of in . So every cut in has at least as many edges as the minimum cut in .
1.2. Computing Minimum Cuts by the Contraction Algorithm
The following randomized algorithm outputs a cut (possibly a minimum cut).
- Input:A graph .
- Output:A cut for some non-empty set .
- While the graph has more than two (super) vertices remaining
- Pick an edge uniformly at random
- Let be one of the two remaining supervertices. Output the cut , where is the set of vertices in the original graph that were contracted together to form the supervertex .To analyze this algorithm we must show that it has decent probability of outputting a minimum cut. Our main result is:
Continuing our example above, the algorithm might decide to contract one of the edges between and (say, the edge in the original graph). The resulting graph is shown below. Then the algorithm outputs the cut , which is the same as the cut , and contains two edges. However, this is not a minimum cut of as the cut contains just one edge.
Before proving the theorem we need two more preliminary claims.
Proof: Every vertex must have degree at least , otherwise the edges incident on that vertex would constitute a cut of size less than . Any graph where the minimum degree is at least must have at least edges, since the sum of the vertex degrees is exactly twice the number of edges (by the handshaking lemma.)
Proof: direction: If an edge is contracted then the vertices and will belong to the same supervertex from that point onwards. Therefore the set either contains both and , or neither of them. In either case .
direction: Suppose no edge in is contracted by the algorithm. Consider any pair of nodes and in the original graph. If the algorithm contracts and into the same supervertex, then Claim 1 tells us that there is a – path that consists entirely of contracted edges. But this path must intersect the cut , which contradicts our hypothesis that no edge in was contracted.
So, for every pair of nodes and , these two nodes belong to different supernodes in the contracted graph. At the end of the algorithm there are only two supernodes, so one of them must correspond to and the other to its complement .
Proof: (of Theorem 1) Recall that we fix an arbitrary minimum cut , and we must show that the algorithm has reasonable probability of outputting that particular minimum cut . By Claim 4, this happens if and only if no edge in is contracted. Since the contracted edges are randomly chosen, we can analyze the probability that any of those contracted edges lie in .
Each contraction operation decreases the number of vertices by one. So in the th iteration there are exactly vertices. What can we say about the probability of contracting an edge in during the th iteration?
Let denote the minimum size of any cut in the original graph, so . The graph in the th iteration has minimum cut size at least , by Claim 2, and so it has at least edges, by Claim 3. So the probability that the randomly chosen edge in the th iteration lies in is at most
This is true even if we assume that we never picked an edge of in any previous iteration. Formally, let be the event that in the th iteration, the randomly chosen edge lies in . Let be the complementary event. Then, we have argued that
So, the probability that the algorithm never contracts an edge in is
So, by Claim 4, the probability that the algorithm outputs the cut is at least .
Theorem 1 only proves that the algorithm has a very small probability of outputting the minimum cut . As usual, we can boost the probability of success by performing independent trials.
Corollary 2 Fix any . Running the contraction algorithm times will find a minimum cut with probability at least .
Proof: Fix a minimum cut . The probability that we fail to find this cut during trials is at most
This gives a randomized, polynomial algorithm to compute a minimum cut.
The contraction algorithm is interesting not only because it gives a simple method to compute minimum cuts, but also because there are several interesting corollaries and extensions. We now discuss a few of those.
Corollary 3 In any undirected graph the number of minimum cuts is at most .
Proof: Let be the minimum cuts of the graph. Let be the event that is output by the algorithm. Since these are disjoint events, . We showed above that for every , which implies that .
This bound is tight as the -cycle has exactly minimum cuts. The next corollary proves a similar result for approximate minimum cuts. For any , a cut is called an -minimum cut if its number of edges is at most times larger than a minimum cut.
Finally, we state a generalization of the previous corollary which we will use next time. For every edge let denote the edge-connectivity of , which is the minimum size of a cut containing . Formally,
Theorem 5 Let be a graph. Let be arbitrary and let . Then, for every real ,