1.Graph
1.1 Two ingredients
(1)vertices aka(also known as)nodes(V)(顶点)
(2)edges(E) = pairs of vertices(边)
can be undirected [unordered pair] or directed [ordered pair] (aka arcs(弧线))
directed edges:
first endpoint:tail,second endpoint:head
Examples:road networks, the Web, etc
1.2 Cuts of Graphs
Definition: a cut of a graph(V,E) is a partition of V into two non-empty sets A and B.
Definition:the crossing edges of a cut(A,B)are those with
(1)the one endpoint (端点) in each of (A,B)[无向图]
(2)tail in A, head in B: A—->B.[有向图]
1.3 The Minimum Cut Problem(最小割问题)
(1)INPUT: An undirected graph G = (V,E).(无向图)
[parallel edges allowed]
(2)Goal:Compute a cut with fewest numbers of cross edges.(a min cut)
2. Random Contraction Algorithm(Karger)
While there are more than 2 vertices
(1) pick a remaining edge
(u,v)
(
u
,
v
)
uniformly at random.
(2)merge (or “contract”)
u
u
and into a single vertex.
(3)remove self-loops
return cut represented by final 2 vertices.(其中一个来自A,其中一个来自B)
2.1 The Setup
Question: what is the probility of success?
(1)Fix a graph G = (V,E) (n个顶点(vertices),m条边(edges)).
(2)Fix a minimum cut(A,B)
(3)Let k = # of edges crossing(A,B)。(Call these edges F,理解成最小割情况下: A,B两集合相连的边数)
2.2 What Could Go Wrong
(1)Suppose an edge of F is contracted at some point
(F中的某条边被收缩了,算法将不会输出(A,B))
(2)Suppose only edges inside A or inside B get contracted.
(若仅仅只有集合A或者集合B中内部的边被收缩,算法将会输出(A,B))
Thus.Pr[output is (A,B)] = Pr[never contracts an edge
of F]
Let
Si
S
i
= event that an edge of F contracted in iteration i.(对每次迭代中F中某条边被收缩的概率)
Goal:
Compute
Pr[¬S1∧¬S2∧¬S3∧......∧¬Sn−2]
P
r
[
¬
S
1
∧
¬
S
2
∧
¬
S
3
∧
.
.
.
.
.
.
∧
¬
S
n
−
2
]
(理解成所有
Si
S
i
事件不发生的概率的交集)
其中:
Pr[S1]=crossingedgesedges
P
r
[
S
1
]
=
c
r
o
s
s
i
n
g
e
d
g
e
s
e
d
g
e
s
2.3 The First Iteration
Key Observation: degree of each vertex is at least k.
(每个顶点的度:为每个顶点相连的边)
Reason: each vertex v defines a cut
({v}.V−{v})
(
{
v
}
.
V
−
{
v
}
)
.
Since
∑vdegree(v)=2m≥kn
∑
v
d
e
g
r
e
e
(
v
)
=
2
m
≥
k
n
.
We have
m≥kn2
m
≥
k
n
2
Since
Pr[S1]=km,Pr[S1]≤2n
P
r
[
S
1
]
=
k
m
,
P
r
[
S
1
]
≤
2
n
2.4 The Second Iteration
-
Recall:
Pr[¬S1∧¬S2]=Pr[¬S2|¬S1].Pr[¬S1]
P
r
[
¬
S
1
∧
¬
S
2
]
=
P
r
[
¬
S
2
|
¬
S
1
]
.
P
r
[
¬
S
1
]
其中:
Pr[¬S2|¬S1]=1−kremaingedges
P
r
[
¬
S
2
|
¬
S
1
]
=
1
−
k
r
e
m
a
i
n
g
e
d
g
e
s
Pr[¬S1]≥(1−2n)
P
r
[
¬
S
1
]
≥
(
1
−
2
n
)
Note: all nodes in contracted graph define cuts in G (with at least k crossing edges) all degrees in contracted graph are at least k. of remaining edges
≥12k(n−1)
≥
1
2
k
(
n
−
1
)
- Pr[¬S2|¬S1]≥1−2n−1 P r [ ¬ S 2 | ¬ S 1 ] ≥ 1 − 2 n − 1
All Iterations:
In general :
Pr[¬S1∧¬S2∧¬S3...∧¬Sn−2
P
r
[
¬
S
1
∧
¬
S
2
∧
¬
S
3
.
.
.
∧
¬
S
n
−
2
=Pr[¬S1]Pr[¬S2|¬S1]Pr[¬S3|¬S2∧¬S1]..Pr[¬Sn−2|¬S1∧...∧¬Sn−3]
=
P
r
[
¬
S
1
]
P
r
[
¬
S
2
|
¬
S
1
]
P
r
[
¬
S
3
|
¬
S
2
∧
¬
S
1
]
.
.
P
r
[
¬
S
n
−
2
|
¬
S
1
∧
.
.
.
∧
¬
S
n
−
3
]
≥(1−2n)(1−2n−1)(1−2n−2..(1−2n−(n−4))(1−2n−(n−3))
≥
(
1
−
2
n
)
(
1
−
2
n
−
1
)
(
1
−
2
n
−
2
.
.
(
1
−
2
n
−
(
n
−
4
)
)
(
1
−
2
n
−
(
n
−
3
)
)
=2n(n−1)≥1n2
=
2
n
(
n
−
1
)
≥
1
n
2
Problem: low success probability(But:n on trivial)
(成功的概率比较小)
2.5重复试验(Repeated Trials)
Solution: run the basic algorithm a large number N times,
remember the smallest cut found.
Question: how many trials needed?
Let
Ti=
T
i
=
event that cut (A,B) is found on the
ith
i
t
h
try.
by definition, different
Ti
T
i
’s are independent.
So:
Pr[allNtrialsfail]=Pr[¬T1∧¬T2∧...¬TN]
P
r
[
a
l
l
N
t
r
i
a
l
s
f
a
i
l
]
=
P
r
[
¬
T
1
∧
¬
T
2
∧
.
.
.
¬
T
N
]
=ΠNi=1Pr[¬Ti]≤(1−1n2)N
=
Π
i
=
1
N
P
r
[
¬
T
i
]
≤
(
1
−
1
n
2
)
N
(相互独立)
3. Counting Mininum Cuts.
3.1 The number of Minimun Cuts
NOTE: A graph can have multiple min cuts.
(a tree with n vertices has (n-1) minimum cuts)
Question: What’s the largest number of min cuts that a graph with n vertices can have?
Answer:
C2n=n(n−1)2
C
n
2
=
n
(
n
−
1
)
2