<s>
In	O
graph	O
theory	O
,	O
the	O
Stoer	B-Algorithm
–	I-Algorithm
Wagner	I-Algorithm
algorithm	I-Algorithm
is	O
a	O
recursive	O
algorithm	O
to	O
solve	O
the	O
minimum	O
cut	B-Algorithm
problem	O
in	O
undirected	O
weighted	O
graphs	O
with	O
non-negative	O
weights	O
.	O
</s>
<s>
At	O
each	O
phase	O
,	O
the	O
algorithm	O
finds	O
the	O
minimum	O
-	O
cut	B-Algorithm
for	O
two	O
vertices	O
and	O
chosen	O
at	O
its	O
will	O
.	O
</s>
<s>
The	O
minimum	O
cut	B-Algorithm
found	O
in	O
all	O
phases	O
will	O
be	O
the	O
minimum	O
weighted	O
cut	B-Algorithm
of	O
the	O
graph	O
.	O
</s>
<s>
A	O
cut	B-Algorithm
is	O
a	O
partition	O
of	O
the	O
vertices	O
of	O
a	O
graph	O
into	O
two	O
non-empty	O
,	O
disjoint	O
subsets	O
.	O
</s>
<s>
A	O
minimum	O
cut	B-Algorithm
is	O
a	O
cut	B-Algorithm
for	O
which	O
the	O
size	O
or	O
weight	O
of	O
the	O
cut	B-Algorithm
is	O
not	O
larger	O
than	O
the	O
size	O
of	O
any	O
other	O
cut	B-Algorithm
.	O
</s>
<s>
For	O
an	O
unweighted	O
graph	O
,	O
the	O
minimum	O
cut	B-Algorithm
would	O
simply	O
be	O
the	O
cut	B-Algorithm
with	O
the	O
least	O
edges	O
.	O
</s>
<s>
For	O
a	O
weighted	O
graph	O
,	O
the	O
sum	O
of	O
all	O
edges	O
 '	O
weight	O
on	O
the	O
cut	B-Algorithm
determines	O
whether	O
it	O
is	O
a	O
minimum	O
cut	B-Algorithm
.	O
</s>
<s>
In	O
practice	O
,	O
the	O
minimum	O
cut	B-Algorithm
problem	O
is	O
always	O
discussed	O
with	O
the	O
maximum	B-Algorithm
flow	I-Algorithm
problem	I-Algorithm
,	O
to	O
explore	O
the	O
maximum	O
capacity	O
of	O
a	O
network	B-Architecture
,	O
since	O
the	O
minimum	O
cut	B-Algorithm
is	O
a	O
bottleneck	O
in	O
a	O
graph	O
or	O
network	B-Architecture
.	O
</s>
<s>
The	O
cut	B-Algorithm
is	O
called	O
an	O
-	O
cut	B-Algorithm
if	O
exactly	O
one	O
of	O
or	O
is	O
in	O
.	O
</s>
<s>
The	O
minimal	O
cut	B-Algorithm
of	O
that	O
is	O
also	O
an	O
-	O
cut	B-Algorithm
is	O
called	O
the	O
-	O
min-cut	O
of	O
.	O
</s>
<s>
This	O
algorithm	O
starts	O
by	O
finding	O
an	O
and	O
a	O
in	O
,	O
and	O
an	O
s-t	O
min-cut	O
of	O
.	O
</s>
<s>
For	O
any	O
pair	O
,	O
there	O
are	O
two	O
possible	O
situations	O
:	O
either	O
is	O
a	O
global	O
min-cut	O
of	O
,	O
or	O
and	O
belong	O
to	O
the	O
same	O
side	O
of	O
the	O
global	O
min-cut	O
of	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
global	O
min-cut	O
can	O
be	O
found	O
by	O
checking	O
the	O
graph	O
,	O
which	O
is	O
the	O
graph	O
after	O
the	O
merging	O
of	O
vertices	O
and	O
.	O
</s>
<s>
shrink	O
by	O
merging	O
the	O
two	O
vertices	O
(	O
s	O
,	O
t	O
)	O
added	O
last	O
(	O
the	O
value	O
of	O
"	O
cut-of-the-phase	O
"	O
is	O
the	O
value	O
of	O
minimum	O
s	O
,	O
t	O
cut	B-Algorithm
.	O
)	O
</s>
<s>
So	O
,	O
in	O
a	O
single	O
phase	O
,	O
a	O
pair	O
of	O
vertices	O
and	O
,	O
and	O
a	O
min	O
cut	B-Algorithm
is	O
determined	O
.	O
</s>
<s>
If	O
there	O
is	O
a	O
minimum	O
cut	B-Algorithm
of	O
separating	O
and	O
,	O
the	O
is	O
a	O
minimum	O
cut	B-Algorithm
of	O
.	O
</s>
<s>
If	O
not	O
,	O
then	O
the	O
minimum	O
cut	B-Algorithm
of	O
must	O
have	O
and	O
on	O
a	O
same	O
side	O
.	O
</s>
<s>
In	O
addition	O
,	O
the	O
MinimumCut	O
would	O
record	O
and	O
update	O
the	O
global	O
minimum	O
cut	B-Algorithm
after	O
each	O
MinimumCutPhase	O
.	O
</s>
<s>
After	O
phases	O
,	O
the	O
minimum	O
cut	B-Algorithm
can	O
be	O
determined	O
.	O
</s>
<s>
In	O
this	O
phase	O
,	O
the	O
weight	O
of	O
cut	B-Algorithm
is	O
5	O
,	O
which	O
is	O
the	O
summation	O
of	O
edges	O
(	O
1	O
,	O
2	O
)	O
and	O
(	O
1	O
,	O
5	O
)	O
.	O
</s>
<s>
The	O
minimum	O
cut	B-Algorithm
is	O
5	O
,	O
so	O
remain	O
the	O
minimum	O
as	O
5	O
.	O
</s>
<s>
The	O
global	O
minimum	O
cut	B-Algorithm
has	O
edge	O
(	O
2	O
,	O
3	O
)	O
and	O
edge	O
(	O
6	O
,	O
7	O
)	O
,	O
which	O
is	O
detected	O
in	O
step	O
5	O
.	O
</s>
<s>
To	O
prove	O
the	O
correctness	O
of	O
this	O
algorithm	O
,	O
we	O
need	O
to	O
prove	O
that	O
the	O
cut	B-Algorithm
given	O
by	O
MinimumCutPhase	O
is	O
in	O
fact	O
a	O
minimum	O
cut	B-Algorithm
of	O
the	O
graph	O
,	O
where	O
s	O
and	O
t	O
are	O
the	O
two	O
vertices	O
last	O
added	O
in	O
the	O
phase	O
.	O
</s>
<s>
Therefore	O
,	O
a	O
lemma	O
is	O
shown	O
below:Lemma	O
1	O
:	O
MinimumCutPhase	O
returns	O
a	O
minimum	O
-cut	O
of	O
.Let	O
be	O
an	O
arbitrary	O
cut	B-Algorithm
,	O
and	O
be	O
the	O
cut	B-Algorithm
given	O
by	O
the	O
phase	O
.	O
</s>
<s>
in	O
opposite	O
sides	O
of	O
the	O
cut	B-Algorithm
.	O
</s>
<s>
is	O
the	O
cut	B-Algorithm
induced	O
by	O
.	O
</s>
<s>
is	O
simply	O
all	O
vertices	O
added	O
to	O
before	O
,	O
and	O
the	O
edges	O
between	O
these	O
vertices	O
and	O
are	O
the	O
edges	O
that	O
cross	O
the	O
cut	B-Algorithm
.	O
</s>
<s>
Therefore	O
,	O
as	O
shown	O
above	O
,	O
for	O
active	O
vertices	O
and	O
,	O
with	O
added	O
to	O
before	O
:	O
by	O
induction	O
,	O
since	O
contributes	O
to	O
but	O
not	O
to	O
(	O
and	O
other	O
edges	O
are	O
of	O
non-negative	O
weights	O
)	O
Thus	O
,	O
since	O
is	O
always	O
an	O
active	O
vertex	O
since	O
the	O
last	O
cut	B-Algorithm
of	O
the	O
phase	O
separates	O
from	O
by	O
definition	O
,	O
for	O
any	O
active	O
vertex	O
:Therefore	O
,	O
the	O
cut	B-Algorithm
of	O
the	O
phase	O
is	O
at	O
most	O
as	O
heavy	O
as	O
.	O
</s>
<s>
By	O
using	O
the	O
Fibonacci	B-Application
heap	I-Application
we	O
can	O
perform	O
an	O
ExtractMax	O
operation	O
in	O
amortized	O
time	O
and	O
an	O
IncreaseKey	O
operation	O
in	O
amortized	O
time	O
.	O
</s>
<s>
Below	O
is	O
a	O
concise	O
c++	O
implementation	O
of	O
the	O
Stoer	B-Algorithm
–	I-Algorithm
Wagner	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
