Minimum Cut in A Graph
Minimum Cut in A Graph
Y = y
_
=
Pr
_
(X = x) (Y = y)
_
Pr
_
Y = y
_ .
An equivalent, useful statement of this is that:
Pr
_
(X = x) (Y = y)
_
= Pr
_
X = x|Y = y
_
Pr
_
Y = y
_
Two events X and Y are independent, if P
_
X = x Y = y
_
= P
_
X = x
_
P
_
Y = y
_
. In partic-
ular, if X and Y are independent, then
Pr
_
X = x
Y = y
_
= Pr
_
X = x
_
.
Let
1
, . . . ,
n
be n events which are not necessarily independent. Then,
Pr
_
n
i=1
i
_
= Pr
_
1
_
Pr
_
1
_
Pr
_
2
_
. . . Pr
_
1
. . .
n1
_
2 Algorithm
The basic operation, is edge contraction:
X Y
Z
The new graph is denoted by G/xy.
Operation can be implemented in O(n) time for a graph with n vertices (how?).
Observation 2.1 The size of the in G/xy is at least as large as the cut in G (as long as G/xy as at
least one edge). Since any cut in G/xy has a corresponding cut of the same cardinality in G.
Observation 2.2 Let e
1
, . . . , e
n2
be a sequence of edges in G, such that none of them is in the min-
cut, and such that G
= G/{e
1
, . . . , e
n2
} is a single multi-edge. Then, this multi-edge correspond
to the min-cut in G.
2
Idea: Let us nd a sequence of edges e
1
, . . . , e
n2
, such that G/{e
1
, . . . , e
n2
} corresponds to the
minimum cut.
Problem: Argumentation is circular, how can we nd a sequence of edges that are not in the cut
without knowing what the cut is???
Lemma 2.3 If a graph G has a min-cut of size k, and it has n vertices, then |E(G)| kn/2.
Proof: Vertex degree is at least k. Now count the number of edges...
Lemma 2.4 If we pick in random an edge e from a graph G, then with probability at most 2/n it
belong to the min-cut.
Proof: There are at least nk/2 edges in the graph and exactly k edges in the cut. Thus, the proba-
bility of picking an edge from the min-cut is small then k/(nk/2) = 2/n.
Algorithm MinCutInner(G)
G
0
G
i = 0
while G
i
has more than two vertices do
Pick randomly an edge e
i
from the edges of G
i
G
i+1
G
i
/e
i
i i +1
Let (S,V S) be the cut in the original graph corresponding to G
i
return (S,V S)
Observation 2.5 MinCutInner runs in O
_
n
2
_
time.
Observation 2.6 The algorithm always outputs a cut, and the cut is not smaller than the minimum
cut.
Lemma 2.7 MinCutInner outputs the min cut in probability 2/n(n1).
Proof: Let
i
be the event that e
i
is not in the min-cut of G
i
. Clearly, MinCut outputs the minimum
cut if
0
, . . . ,
n3
all happen (namely, all edges picked are outside the min cut).
By the above lemma,
Pr
_
1
. . .
i1
_
1
2
|V(G
i
)|
= 1
2
ni
Thus,
Pr
_
0
. . .
n2
_
= Pr
_
0
_
Pr
_
0
_
Pr
_
1
_
. . . Pr
_
n3
0
. . .
n4
_
3
Thus,
Pr
_
0
. . .
n2
_
n3
i=0
_
1
2
ni
_
=
n3
i=0
ni 2
ni
=
n2
n
n3
n1
n4
n2
. . .
=
2
n (n1)
.
Denition 2.8 (informal) Amplication is the process of running an experiment again and again
till the things we want to happed with good probability.
Let MinCut be the algorithm that runs MinCutInner n(n 1) times and return the minimum cut
computed.
Lemma 2.9 The probability that MinCut fails to return the min-cut is < 0.14.
Proof: The probability of failure is at most
_
1
2
n(n1)
_
n(n1)
exp
_
2
n(n1)
n(n1)
_
= exp(2) < 0.14,
since 1x e
x
for 0 x 1, as you can (and should) verify.
Theorem 2.10 One can compute the min-cut in O(n
4
) time with constant probability to get a
correct result. In O
_
n
4
logn
_
time the min-cut is returned with high probability.
Note: that the algorithm is extremely simple, can we push the basic idea further and get faster
algorithm? (or alternatively, can we complicate things, and get a faster algorithm?)
So, why is the algorithm needs so many executions? Because the probability deteriorates very
quickly once the graph becomes small. The probability for success in contracting the graph till it
has t vertices is:
Pr
_
0
. . .
nt1
_
nt1
i=0
_
1
2
ni
_
=
nt1
i=0
ni 2
ni
=
n2
n
n3
n1
n4
n2
. . . =
t(t 1)
n (n1)
.
Thus, as long as t is large (that is t n/c, where c is a constant), the probability of hitting the cut
is pretty small.
Observation 2.11 As the graph get smaller, the probability to make a bad choice increases.
Observation 2.12 Intuitive idea: Run the algorithm more times when the graph get small.
Contract( G, t )
while |V(G)| >t do
Pick a random edge e in G.
G G/e
return G
4
Namely, Contract( G, t) shrinks G till it has only t vertices.
FastCut(G = (V, E))
INPUT: G multigraph
begin
n |V(G)|
if n 6 then
compute min-cut of G using brute force and return cut.
t n/
2
H
1
Contract(G, t)
H
2
Contract(G, t) /* Contract is randomized!!! */
X
1
FastCut(H
1
)
X
2
FastCut(H
2
)
return the smaller cut out of X
1
and X
2
.
end
Lemma 2.13 The running time of FastCut(G) is O
_
n
2
logn
_
, where n =|V(G)|.
Proof: Well, we perform two calls to Contract(G, t) which takes O(n
2
) time. And then we
perform two recursive calls, on the resulting graphs. We have:
T(n) = O
_
n
2
_
+2T
_
n
2
_
The solution to this recurrence is O
_
n
2
logn
_
as one can easily (and should) verify.
Exercise 2.14 Show that one can modify FastCut so that it uses only O(n
2
) space.
Lemma 2.15 The probability that Contract(G, t) had not contracted the min-cut is at least 1/2.
Theorem 2.16 FastCut nds the min-cut with probability larger than (1/logn).
Proof: Let P(t) be the probability that the algorithm succeeds on a graph with t vertices.
The probability to succeed in the rst call on H
1
is the probability that Contract did not hit
the min cut (this probability is larger than 1/2 by the above lemma), times the probability that the
algorithm succeeded on H
1
(those two events are independent. Thus, the probability to succeed on
the call on H
1
is at least (1/2) P(t/
2
_
.
The probability to fail on both H
1
and H
2
is smaller than
_
1
1
2
P
_
t
2
__
2
.
And thus, the probability for the algorithm to succeed is
P(t) 1
_
1
1
2
P
_
t
2
__
2
= P
_
t
2
_
1
4
_
P
_
t
2
__
2
.
5
We need to solve this recurrence. Divide both sides of the equation by P
_
t/
2
_
we have:
P(t)
P(t/
2)
1
1
4
P(t/
2)
It is now easy,
1
to verify that this inequality holds for P(t) = 1/logt. Indeed,
1/logt
1/log(t/
2)
1
1
4(log(t/
2))
logt log
2
logt
4(logt log
2) 1
4(logt log
2)
Let = logt. Then,
log
4(log
2) 1
4(log
2)
4(log
2)
2
4(log
2)
8log
2+4log
2
2 4log
2
4log
2+4log
2
2 0
_
2log
2
_
2
0,
which is denitely true. Thus, we just veried that P(t) 1/logt, for t large enough. We conclude,
that the algorithm succeeds in nding the min-cut in probability 1/logt = 1/logn.
Exercise 2.17 Prove, that running of FastCut c log
2
n times, guarantee that the algorithm out-
puts the min-cut with probability 11/n
2
for c a constant large enough.
3 Notes
The MinCutInner algorithm was developed by David Karger during his PhD thesis in Stanford.
The fast algorithm is a joint work with Stein. David Karger is currently a processor to CS in MIT.
Clifford Stein is a coauthor of CLRS [CLRS01], and he is currently in Columbia university.
The basic algorithm of the min-cut is described in [MR95, pages 79], the faster algorithm is
described in [MR95, pages 289295].
References
[CLRS01] T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introduction to Algorithms.
MIT Press / McGraw-Hill, Cambridge, Mass., 2001.
[MR95] R. Motwani and P. Raghavan. Randomized Algorithms. Cambridge University Press,
New York, NY, 1995.
1
easy = I did it in less than ve days.
6