KARGER'S MINCUT ALGORITHM NORTHERN LIGHTS YUN LIU DONGFENG YU TIANXIANG GAO ZHIYUAN LI XIAOYANG ZHENG
SOME SOLUTIONS • For all pairs of vertexes u and v , run maximum flow. • toooo slow • Stoer – Wagner Algorithm • nice deterministic algorithm • Karger's Algorithm • nice randomized alogorithm
GLOBAL MINIMUM CUT • A cut (S,T) in an undirected graph G=(V,E) is a partition of the vertices V into two non-empty, disjoint sets S ∪ T=V . • The weight of a cut is the sum of the weight of all edges between S and T . • We want to find a cut with the minimum weight among all of the cuts.
GLOBAL MINIMUM CUT A CUT WITH VALUE 3 A MINCUT WITH VALUE 2
NOTATION • n : number of vertexes • m : number of edges • degree(u) denotes the number of edges touching node u • G/e is the graph after G contract e
KARGER’S ALGO IN UNWEIGHTED GRAPH • The minimum cut is usually very small. So if we randomly choose an edge, it is very likely to be not in the mincut.
KARGER’S ALGO IN UNWEIGHTED GRAPH 1. Pick an edge of G at random and collapse its two endpoints into a single node. 2. Repeat 1 until just two nodes remain. Repeat until just two nodes remain: • The edges between the two nodes is a cut. • We claim this procedure is very likely to find a mincut.
KARGER’S ALGO IN UNWEIGHTED GRAPH 1. Pick an edge of G at random and collapse its two endpoints into a single node. 2. Repeat 1 until just two nodes remain. Repeat until just two nodes remain: • The edges between the two nodes is a cut. • We claim this procedure is very likely to find a mincut.
KARGER’S ALGO IN UNWEIGHTED GRAPH 1. Pick an edge of G at random and collapse its two endpoints into a single node. 2. Repeat 1 until just two nodes remain. Repeat until just two nodes remain: • The edges between the two nodes is a cut. • We claim this procedure is very likely to find a mincut.
KARGER’S ALGO IN UNWEIGHTED GRAPH 1. Pick an edge of G at random and collapse its two endpoints into a single node. 2. Repeat 1 until just two nodes remain. Repeat until just two nodes remain: • The edges between the two nodes is a cut. • We claim this procedure is very likely to find a mincut.
KARGER’S ALGO IN UNWEIGHTED GRAPH 1. Pick an edge of G at random and collapse its two endpoints into a single node. 2. Repeat 1 until just two nodes remain. Repeat until just two nodes remain: • The edges between the two nodes is a cut. • We claim this procedure is very likely to find a mincut.
KARGER’S ALGO IN UNWEIGHTED GRAPH 1. Pick an edge of G at random and collapse its two endpoints into a single node. 2. Repeat 1 until just two nodes remain. Repeat until just two nodes remain: • The edges between the two nodes is a cut. • We claim this procedure is very likely to find a mincut.
KARGER’S ALGO IN UNWEIGHTED GRAPH 1. Pick an edge of G at random and collapse its two endpoints into a single node. 2. Repeat 1 until just two nodes remain. Repeat until just two nodes remain: • The edges between the two nodes is a cut. • We claim this procedure is very likely to find a mincut.
KARGER’S ALGO IN UNWEIGHTED GRAPH 1. Pick an edge of G at random and collapse its two endpoints into a single node. 2. Repeat 1 until just two nodes remain. Repeat until just two nodes remain: • The edges between the two nodes is a cut. • We claim this procedure is very likely to find a mincut.
A FEW LAMMAS • A cut in G/e is also a cut in G
A FEW LAMMAS • Let S and T be a mincut, suppose e does not cross the cut, mincut(G) = mincut(G/e)
2 P(FOUND A MINCUT) ≥ 𝑜 2 • Prove that there is a vertex with degree not greater than 2 𝑛 𝑜 . • Proof • The sum of degree is 2m since each edge has 2 ends. So, the average vertex degree is 2 𝑛 𝑜 . Therefore, there exists at least one vertex with degree not greater than 2 𝑛 𝑜 .
2 P(FOUND A MINCUT) ≥ 𝑜 2 • Prove that the size of the mincut is at most 2 𝑛 𝑜 . • Proof • Consider the partition of G into two pieces, one containing a single node u, and the other containing the remaining n − 1 nodes. The size of this cut is degree(u). Since we already prove there is a vertex with degree not 𝑛 greater than 2 𝑜 , there exists a cut with value at most 𝑛 𝑛 𝑜 . So, that the size of the mincut is at most 2 𝑜 . 2
2 P(FOUND A MINCUT) ≥ 𝑜 2 • Prove that for a randomly chosen edge e , P(e is not in the 𝑜−2 mincut) ≥ 𝑜 • Proof 𝑛 • The size of the mincut is at most 2 𝑜 , so P(e is in the 2𝑛 1 2 mincut) ≤ 𝑜 . 𝑜 × 𝑛 = • Therefore, P(e is not in the mincut) ≥ 1 − 2 𝑜−2 𝑜 = 𝑜
2 P(FOUND A MINCUT) ≥ 𝑜 2 • Prove that P(found a mincut) ≥ 2 𝑜 2 • Proof • Pr(final cut is the minimum cut) = Pr(first selected edge is not in mincut) × Pr(second selected edge is not in mincut) × · · · = 𝑜−2 𝑜 × 𝑜−3 𝑜−1 × 𝑜−4 𝑜−2 … × 2 4 × 1 𝑜(𝑜−1) ≥ 2 2 3 = 𝑜 2
REPEAT IT 𝑂 2 𝑀𝑃𝐻 𝑂 TIMES • Prove that P(found a mincut after 𝑜 2 log 𝑜 times) ≥ 1 − 1 𝑜 • Proof 𝑜2 2 ×ln 𝑜 ≥ • P(found a mincut after 𝑜 2 log 𝑜 times) ≥ 1 − 1 − 1 𝑜2 2 1 = 1 − 1 1 − 1 − 𝑓 ln 𝑜 𝑜
TIME COMPLEXITY • 𝑜 2 ⋅ 𝑜 2 log 𝑜 = 𝑜 4 log 𝑜
A STRONG IMPROVEMENT • This toooo slow. 2 • P(e is not in the mincut) ≥ 1 − 𝑜 is almost 1 when n is 1 large, but decreases to 3 when n=3. • We want to avoid that.
A STRONG IMPROVEMENT
A STRONG IMPROVEMENT
TIME COMPLEXITY • 𝑜 2 log 𝑜 ⋅ log 2 𝑜 = 𝑜 2 log 3 𝑜
WE CAN DO IT IN WEIGHTED GRAPH • 𝑃(𝑜 2 log 3 𝑜)
SUMMARY • Karger’s Algorithm in unweighted Graph 𝑃(𝑜 4 𝑚𝑝𝑜) • A strong improvement 𝑃(𝑜 2 𝑚𝑝 3 𝑜) • Karger’s Algorithm in weighted Graph 𝑃(𝑜 2 𝑚𝑝 3 𝑜)
REFERENCES [1] D. R. Karger and C. Stein. A new approach to the minimum cut problem. J. ACM, 43(4):601 – 640, 1996.
Recommend
More recommend