ALGORITHM NORTHERN LIGHTS YUN LIU DONGFENG YU TIANXIANG GAO - - PowerPoint PPT Presentation

algorithm
SMART_READER_LITE
LIVE PREVIEW

ALGORITHM NORTHERN LIGHTS YUN LIU DONGFENG YU TIANXIANG GAO - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

KARGER'S MINCUT ALGORITHM

NORTHERN LIGHTS

YUN LIU DONGFENG YU TIANXIANG GAO ZHIYUAN LI XIAOYANG ZHENG

slide-2
SLIDE 2

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
slide-3
SLIDE 3

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.

slide-4
SLIDE 4

GLOBAL MINIMUM CUT

A CUT WITH VALUE 3 A MINCUT WITH VALUE 2

slide-5
SLIDE 5

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
slide-6
SLIDE 6

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.

slide-7
SLIDE 7

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.
  • The edges between the two nodes is a cut.
  • We claim this procedure is very likely to find a mincut.

Repeat until just two nodes remain:

slide-8
SLIDE 8

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.
  • The edges between the two nodes is a cut.
  • We claim this procedure is very likely to find a mincut.

Repeat until just two nodes remain:

slide-9
SLIDE 9

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.
  • The edges between the two nodes is a cut.
  • We claim this procedure is very likely to find a mincut.

Repeat until just two nodes remain:

slide-10
SLIDE 10

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.
  • The edges between the two nodes is a cut.
  • We claim this procedure is very likely to find a mincut.

Repeat until just two nodes remain:

slide-11
SLIDE 11

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.
  • The edges between the two nodes is a cut.
  • We claim this procedure is very likely to find a mincut.

Repeat until just two nodes remain:

slide-12
SLIDE 12

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.
  • The edges between the two nodes is a cut.
  • We claim this procedure is very likely to find a mincut.

Repeat until just two nodes remain:

slide-13
SLIDE 13

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.
  • The edges between the two nodes is a cut.
  • We claim this procedure is very likely to find a mincut.

Repeat until just two nodes remain:

slide-14
SLIDE 14

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.
  • The edges between the two nodes is a cut.
  • We claim this procedure is very likely to find a mincut.

Repeat until just two nodes remain:

slide-15
SLIDE 15

A FEW LAMMAS

  • A cut in G/e is also a cut in G
slide-16
SLIDE 16

A FEW LAMMAS

  • Let S and T be a mincut, suppose e does not cross the cut,

mincut(G) = mincut(G/e)

slide-17
SLIDE 17

P(FOUND A MINCUT)≥

2 𝑜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

  • ne vertex with degree not greater than 2 𝑛

𝑜.

slide-18
SLIDE 18

P(FOUND A MINCUT)≥

2 𝑜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

2

𝑛 𝑜. So, that the size of the mincut is at most 2 𝑛 𝑜.

slide-19
SLIDE 19

P(FOUND A MINCUT)≥

2 𝑜2

  • Prove that for a randomly chosen edge e, P(e is not in the

mincut)≥

𝑜−2 𝑜

  • Proof
  • The size of the mincut is at most 2

𝑛 𝑜, so P(e is in the

mincut)≤

2𝑛 𝑜 × 1 𝑛 = 2 𝑜.

  • Therefore, P(e is not in the mincut)≥ 1 −

2 𝑜 = 𝑜−2 𝑜

slide-20
SLIDE 20

P(FOUND A MINCUT)≥

2 𝑜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 3 = 2 𝑜(𝑜−1) ≥ 2 𝑜2

slide-21
SLIDE 21

REPEAT IT 𝑂2 𝑀𝑃𝐻 𝑂 TIMES

  • Prove that P(found a mincut after 𝑜2 log 𝑜 times)≥ 1 − 1

𝑜

  • Proof
  • P(found a mincut after 𝑜2 log 𝑜 times)≥ 1 − 1 − 1

𝑜2 2 𝑜2 2 ×ln 𝑜 ≥

1 − 1 − 1 𝑓ln 𝑜 = 1 − 1 𝑜

slide-22
SLIDE 22

TIME COMPLEXITY

  • 𝑜2 ⋅ 𝑜2 log 𝑜 = 𝑜4 log 𝑜
slide-23
SLIDE 23

A STRONG IMPROVEMENT

  • This toooo slow.
  • P(e is not in the mincut)≥ 1 −

2 𝑜 is almost 1 when n is

large, but decreases to

1 3 when n=3.

  • We want to avoid that.
slide-24
SLIDE 24

A STRONG IMPROVEMENT

slide-25
SLIDE 25

A STRONG IMPROVEMENT

slide-26
SLIDE 26

TIME COMPLEXITY

  • 𝑜2 log 𝑜 ⋅ log2 𝑜 = 𝑜2 log3 𝑜
slide-27
SLIDE 27

WE CAN DO IT IN WEIGHTED GRAPH

  • 𝑃(𝑜2 log3 𝑜)
slide-28
SLIDE 28

SUMMARY

  • Karger’s Algorithm in unweighted Graph

𝑃(𝑜4𝑚𝑝𝑕𝑜)

  • A strong improvement

𝑃(𝑜2𝑚𝑝𝑕3𝑜)

  • Karger’s Algorithm in weighted Graph

𝑃(𝑜2𝑚𝑝𝑕3𝑜)

slide-29
SLIDE 29

REFERENCES

[1] D. R. Karger and C. Stein. A new approach to the minimum cut problem. J. ACM, 43(4):601–640, 1996.