# 随机算法 (Fall 2011)/Randomized Min-Cut

Let ${\displaystyle G(V,E)}$ be a graph. Suppose that we want to partition the vertex set ${\displaystyle V}$ into two parts ${\displaystyle S}$ and ${\displaystyle T}$ such that the number of crossing edges, edges with one endpoint in each part, is as small as possible. This can be described as the following problem: the min-cut problem.

For a connected graph ${\displaystyle G(V,E)}$, a cut is a set ${\displaystyle C\subseteq E}$ of edges, removal of which causes ${\displaystyle G}$ becomes disconnected. The min-cut problem is to find the cut with minimum cardinality. A canonical deterministic algorithm for this problem is through the max-flow min-cut theorem. A global minimum cut is the minimum ${\displaystyle s}$-${\displaystyle t}$ min-cut, which is equal to the minimum ${\displaystyle s}$-${\displaystyle t}$ max-flow.

Do we have to rely on the "advanced" tools like flows? The answer is "no", with a little help of randomness.

# Karger's Min-Cut Algorithm

We will introduce an extremely simple algorithm discovered by David Karger. The algorithm works on multigraphs, graphs allowing multiple edges between vertices.

We define an operation on multigraphs called contraction: For a multigraph ${\displaystyle G(V,E)}$, for any edge ${\displaystyle uv\in E}$, let ${\displaystyle contract(G,uv)}$ be a new multigraph constructed as follows: ${\displaystyle u}$ and ${\displaystyle v}$ in ${\displaystyle V}$ are replaced by a singe new vertex whose neighbors are all the old neighbors of ${\displaystyle u}$ and ${\displaystyle v}$. In other words, ${\displaystyle u}$ and ${\displaystyle v}$ are merged into one vertex. The old edges between ${\displaystyle u}$ and ${\displaystyle v}$ are deleted.

Karger's min-cut algorithm is described as follows:

MinCut(multigraph ${\displaystyle G(V,E)}$)

• while ${\displaystyle |V|>2}$ do
• choose an edge ${\displaystyle uv\in E}$ uniformly at random;
• ${\displaystyle G=contract(G,uv)}$;
• return the edges between the only two vertices in ${\displaystyle V}$;

A better way to understand Karger's min-cut algorithm is to describe it as randomly merging sets of vertices. Initially, each vertex ${\displaystyle v\in V}$ corresponds to a singleton set ${\displaystyle \{v\}}$. At each step, (1) a crossing edge (edge whose endpoints are in different sets) is chosen uniformly at random from all crossing edges; and (2) the two sets connected by the chosen crossing-edge are merged to one set. Repeat this process until there are only two sets. The crossing edges between the two sets are returned.

# Analysis

For a multigraph ${\displaystyle G(V,E)}$, fixed a minimum cut ${\displaystyle C}$ (there might be more than one minimum cuts), we analyze the probability that ${\displaystyle C}$ is returned by the MinCut algorithm. ${\displaystyle C}$ is returned by MinCut if and only if no edge in ${\displaystyle C}$ is contracted during the execution of MinCut. We will bound this probability ${\displaystyle \Pr[{\mbox{no edge in }}C{\mbox{ is contracted}}]}$.

 Lemma 1 Let ${\displaystyle G(V,E)}$ be a multigraph with ${\displaystyle n}$ vertices, if the size of the minimum cut of ${\displaystyle G}$ is ${\displaystyle k}$, then ${\displaystyle |E|\geq nk/2}$.
Proof.
 It holds that every vertex has at least ${\displaystyle k}$ neighbors, because if there exists ${\displaystyle v}$ with ${\displaystyle neighbors, then the ${\displaystyle edges adjacent to ${\displaystyle v}$ disconnect ${\displaystyle v}$ from the rest of ${\displaystyle G}$, forming a cut of size smaller than ${\displaystyle k}$. Therefore ${\displaystyle |E|\geq kn/2}$.
${\displaystyle \square }$
 Lemma 2 Let ${\displaystyle G(V,E)}$ be a multigraph with ${\displaystyle n}$ vertices, and ${\displaystyle C}$ a minimum cut of ${\displaystyle G}$. If ${\displaystyle e\not \in C}$, then ${\displaystyle C}$ is still a minimum cut of ${\displaystyle contract(G,e)}$.
Proof.
 We first show that no edge in ${\displaystyle C}$ is lost during the contraction. Due to the definition of contraction, the only edges removed from ${\displaystyle G}$ in a contraction ${\displaystyle contract(G,e)}$ are the parallel-edges sharing both endpoints with ${\displaystyle e}$. Since ${\displaystyle e\not \in C}$, none of these edges can be in ${\displaystyle C}$, or otherwise ${\displaystyle C}$ cannot be a minimum cut of ${\displaystyle G}$. Thus every edge in ${\displaystyle C}$ remains in ${\displaystyle G}$. It is then obvious to see that ${\displaystyle C}$ is a cut of ${\displaystyle contract(G,e)}$. All paths in a contracted graph can be revived in the original multigraph by inserting the contracted edges into the path, thus a connected ${\displaystyle contract(G,e)-C}$ would imply a connected ${\displaystyle G-C}$, which contradicts that ${\displaystyle C}$ is a cut in ${\displaystyle G}$. Notice that a cut in a contracted graph must be a cut in the original graph. This can be easily verified by seeing contraction as taking the union of two sets of vertices. Therefore a contraction can never reduce the size of minimum cuts of a multigraph. A minimum cut ${\displaystyle C}$ must still be a minimum cut in the contracted graph as long as it is still a cut. Concluding the above arguments, we have that ${\displaystyle C}$ is a minimum cut of ${\displaystyle contract(G,e)}$ for any ${\displaystyle e\not \in C}$.
${\displaystyle \square }$

Let ${\displaystyle G(V,E)}$ be a multigraph, and ${\displaystyle C}$ a minimum cut of ${\displaystyle G}$.

Initially ${\displaystyle |V|=n}$. After ${\displaystyle (i-1)}$ contractions, denote the current multigraph as ${\displaystyle G_{i}(V_{i},E_{i})}$. Suppose that no edge in ${\displaystyle C}$ has been chosen to be contracted yet. According to Lemma 2, ${\displaystyle C}$ must be a minimum cut of the ${\displaystyle G_{i}}$. Then due to Lemma 1, the current edge number is ${\displaystyle |E_{i}|\geq |V_{i}||C|/2}$. Uniformly choosing an edge ${\displaystyle e\in E_{i}}$ to contract, the probability that the ${\displaystyle i}$th contraction contracts an edge in ${\displaystyle C}$ is given by:

{\displaystyle {\begin{aligned}\Pr _{e\in E_{i}}[e\in C]&={\frac {|C|}{|E_{i}|}}&\leq |C|\cdot {\frac {2}{|V_{i}||C|}}&={\frac {2}{|V_{i}|}}.\end{aligned}}}

Therefore, assuming that ${\displaystyle C}$ is intact after ${\displaystyle (i-1)}$ contractions, the probability that ${\displaystyle C}$ survives the ${\displaystyle i}$th contraction is at least ${\displaystyle 1-2/|V_{i}|}$. Note that ${\displaystyle |V_{i}|=n-i+1}$, because each contraction decrease the vertex number by 1.

The probability that no edge in the minimum cut ${\displaystyle C}$ is ever contracted is:

{\displaystyle {\begin{aligned}&\quad \,\prod _{i=1}^{n-2}\Pr[\,C{\mbox{ survives all }}(n-2){\mbox{ contractions }}]\\&=\prod _{i=1}^{n-2}\Pr[\,C{\mbox{ survives the }}i{\mbox{-th contraction}}\mid C{\mbox{ survives the first }}(i-1){\mbox{-th contractions}}]\\&=\prod _{i=1}^{n-2}\left(1-{\frac {2}{|V_{i}|}}\right)\\&=\prod _{i=1}^{n-2}\left(1-{\frac {2}{n-i+1}}\right)\\&=\prod _{k=3}^{n}{\frac {k-2}{k}}\\&={\frac {2}{n(n-1)}}.\end{aligned}}}

Therefore, we prove the following theorem,

 Theorem For any multigraph with ${\displaystyle n}$ vertices, the MinCut algorithm returns a minimum cut with probability at least ${\displaystyle {\frac {2}{n(n-1)}}}$.

Run MinCut independently for ${\displaystyle n(n-1)/2}$ times and return the smallest cut returned. The probability that this the minimum cut is found is:

{\displaystyle {\begin{aligned}1-\Pr[{\mbox{failed every time}}]&=1-\Pr[{\mbox{MinCut fails}}]^{n(n-1)/2}\\&\geq 1-\left(1-{\frac {2}{n(n-1)}}\right)^{n(n-1)/2}\\&\geq 1-{\frac {1}{e}}.\end{aligned}}}

A constant probability!