randomized algorithms iii min cut
play

Randomized Algorithms III Min Cut Lecture 15 October 16, 2014 - PowerPoint PPT Presentation

CS 573: Algorithms, Fall 2014 Randomized Algorithms III Min Cut Lecture 15 October 16, 2014 Sariel (UIUC) CS573 1 Fall 2014 1 / 37 Part I Min cut Sariel (UIUC) CS573 2 Fall 2014 2 / 37 Min cut G = ( V , E ) : undirected graph, n


  1. Cuts under contractions Observation A cut in G / xy is a valid cut in G . 1 There ∃ cuts in G are not in G / xy . 2 The cut S = { x } is not in G / xy . 3 = ⇒ size mincut in G / xy ≥ mincut in G . 4 Idea: Repeatedly perform edge contractions (benefits: shrink 1 graph)... Every vertex in contracted graph is a connected component in 2 the original graph.) Sariel (UIUC) CS573 8 Fall 2014 8 / 37

  2. Cuts under contractions Observation A cut in G / xy is a valid cut in G . 1 There ∃ cuts in G are not in G / xy . 2 The cut S = { x } is not in G / xy . 3 = ⇒ size mincut in G / xy ≥ mincut in G . 4 Idea: Repeatedly perform edge contractions (benefits: shrink 1 graph)... Every vertex in contracted graph is a connected component in 2 the original graph.) Sariel (UIUC) CS573 8 Fall 2014 8 / 37

  3. Contraction (2) Sariel (UIUC) CS573 9 Fall 2014 9 / 37

  4. Contraction y x (2) (3) Sariel (UIUC) CS573 9 Fall 2014 9 / 37

  5. Contraction y { x , y } x (2) (3) (4) Sariel (UIUC) CS573 9 Fall 2014 9 / 37

  6. Contraction y { x , y } x (3) (4) Sariel (UIUC) CS573 9 Fall 2014 9 / 37

  7. Contraction { x , y } (4) Sariel (UIUC) CS573 9 Fall 2014 9 / 37

  8. Contraction 2 2 { x , y } (4) (5) Sariel (UIUC) CS573 9 Fall 2014 9 / 37

  9. Contraction 2 2 (5) Sariel (UIUC) CS573 9 Fall 2014 9 / 37

  10. Contraction 2 2 (7) Sariel (UIUC) CS573 9 Fall 2014 9 / 37

  11. Contraction 2 2 2 2 2 (7) (8) Sariel (UIUC) CS573 9 Fall 2014 9 / 37

  12. Contraction 2 2 2 2 2 2 2 2 (8) (9) Sariel (UIUC) CS573 9 Fall 2014 9 / 37

  13. Contraction 2 2 2 2 2 2 2 3 2 2 2 2 2 (8) (9) (10) Sariel (UIUC) CS573 9 Fall 2014 9 / 37

  14. Contraction 2 2 2 2 4 4 2 3 3 2 2 2 2 5 2 (9) (10) (11) Sariel (UIUC) CS573 9 Fall 2014 9 / 37

  15. Contraction 2 2 4 4 4 3 3 2 2 2 5 5 (10) (11) (12) Sariel (UIUC) CS573 9 Fall 2014 9 / 37

  16. Contraction 4 4 4 9 3 2 5 5 (11) (12) (13) Sariel (UIUC) CS573 9 Fall 2014 9 / 37

  17. Contraction 4 9 5 (12) (13) Sariel (UIUC) CS573 9 Fall 2014 9 / 37

  18. Contraction 9 (13) Sariel (UIUC) CS573 9 Fall 2014 9 / 37

  19. Contraction 9 (13) (14) Sariel (UIUC) CS573 9 Fall 2014 9 / 37

  20. Contraction - all together now 2 2 2 2 2 y x (a) (b) (c) (d) 2 2 2 2 4 4 4 2 2 2 3 3 2 2 5 2 5 (e) (f) (g) (h) 9 (i) (j) Sariel (UIUC) CS573 10 Fall 2014 10 / 37

  21. But... Not min cut! 1 Contracted wrong edge somewhere... 2 If never contract an edge in the cut... 3 ...get min cut in the end! 4 We might still get min cut even if we contract edge min cut. 5 Why??? Sariel (UIUC) CS573 11 Fall 2014 11 / 37

  22. But... Not min cut! 1 Contracted wrong edge somewhere... 2 If never contract an edge in the cut... 3 ...get min cut in the end! 4 We might still get min cut even if we contract edge min cut. 5 Why??? Sariel (UIUC) CS573 11 Fall 2014 11 / 37

  23. But... Not min cut! 1 Contracted wrong edge somewhere... 2 If never contract an edge in the cut... 3 ...get min cut in the end! 4 We might still get min cut even if we contract edge min cut. 5 Why??? Sariel (UIUC) CS573 11 Fall 2014 11 / 37

  24. But... Not min cut! 1 Contracted wrong edge somewhere... 2 If never contract an edge in the cut... 3 ...get min cut in the end! 4 We might still get min cut even if we contract edge min cut. 5 Why??? Sariel (UIUC) CS573 11 Fall 2014 11 / 37

  25. But... Not min cut! 1 Contracted wrong edge somewhere... 2 If never contract an edge in the cut... 3 ...get min cut in the end! 4 We might still get min cut even if we contract edge min cut. 5 Why??? Sariel (UIUC) CS573 11 Fall 2014 11 / 37

  26. The algorithm... Algorithm MinCut ( G ) G 0 ← G i = 0 while G i has more than two vertices do e i ← random edge from E ( G i ) G i +1 ← G i / e i i ← i + 1 Let ( S , V \ S ) be the cut in the original graph corresponding to the single edge in G i return ( S , V \ S ) . Sariel (UIUC) CS573 12 Fall 2014 12 / 37

  27. How to pick a random edge? Lemma X = { x 1 , . . . , x n } : elements, ω ( x i ) : integer positive weight. Pick randomly, in O ( n ) time, an element ∈ X , with prob picking x i � n being ω ( x i ) / W , where W = i =1 ω ( x i ) . Proof. Randomly choose r ∈ [0 , W ] . Precompute β i = � i k =1 ω ( x k ) = β i − 1 + ω ( x i ) . Find first index i , β i − 1 < r ≤ β i . Return x i . Edges have weight... 1 ...compute total weight of each vertex (adjacent edges). 2 Pick randomly a vertex by weight. 3 Pick random edge adjacent to this vertex. 4 Sariel (UIUC) CS573 13 Fall 2014 13 / 37

  28. How to pick a random edge? Lemma X = { x 1 , . . . , x n } : elements, ω ( x i ) : integer positive weight. Pick randomly, in O ( n ) time, an element ∈ X , with prob picking x i � n being ω ( x i ) / W , where W = i =1 ω ( x i ) . Proof. Randomly choose r ∈ [0 , W ] . Precompute β i = � i k =1 ω ( x k ) = β i − 1 + ω ( x i ) . Find first index i , β i − 1 < r ≤ β i . Return x i . Edges have weight... 1 ...compute total weight of each vertex (adjacent edges). 2 Pick randomly a vertex by weight. 3 Pick random edge adjacent to this vertex. 4 Sariel (UIUC) CS573 13 Fall 2014 13 / 37

  29. How to pick a random edge? Lemma X = { x 1 , . . . , x n } : elements, ω ( x i ) : integer positive weight. Pick randomly, in O ( n ) time, an element ∈ X , with prob picking x i � n being ω ( x i ) / W , where W = i =1 ω ( x i ) . Proof. Randomly choose r ∈ [0 , W ] . Precompute β i = � i k =1 ω ( x k ) = β i − 1 + ω ( x i ) . Find first index i , β i − 1 < r ≤ β i . Return x i . Edges have weight... 1 ...compute total weight of each vertex (adjacent edges). 2 Pick randomly a vertex by weight. 3 Pick random edge adjacent to this vertex. 4 Sariel (UIUC) CS573 13 Fall 2014 13 / 37

  30. How to pick a random edge? Lemma X = { x 1 , . . . , x n } : elements, ω ( x i ) : integer positive weight. Pick randomly, in O ( n ) time, an element ∈ X , with prob picking x i � n being ω ( x i ) / W , where W = i =1 ω ( x i ) . Proof. Randomly choose r ∈ [0 , W ] . Precompute β i = � i k =1 ω ( x k ) = β i − 1 + ω ( x i ) . Find first index i , β i − 1 < r ≤ β i . Return x i . Edges have weight... 1 ...compute total weight of each vertex (adjacent edges). 2 Pick randomly a vertex by weight. 3 Pick random edge adjacent to this vertex. 4 Sariel (UIUC) CS573 13 Fall 2014 13 / 37

  31. How to pick a random edge? Lemma X = { x 1 , . . . , x n } : elements, ω ( x i ) : integer positive weight. Pick randomly, in O ( n ) time, an element ∈ X , with prob picking x i � n being ω ( x i ) / W , where W = i =1 ω ( x i ) . Proof. Randomly choose r ∈ [0 , W ] . Precompute β i = � i k =1 ω ( x k ) = β i − 1 + ω ( x i ) . Find first index i , β i − 1 < r ≤ β i . Return x i . Edges have weight... 1 ...compute total weight of each vertex (adjacent edges). 2 Pick randomly a vertex by weight. 3 Pick random edge adjacent to this vertex. 4 Sariel (UIUC) CS573 13 Fall 2014 13 / 37

  32. How to pick a random edge? Lemma X = { x 1 , . . . , x n } : elements, ω ( x i ) : integer positive weight. Pick randomly, in O ( n ) time, an element ∈ X , with prob picking x i � n being ω ( x i ) / W , where W = i =1 ω ( x i ) . Proof. Randomly choose r ∈ [0 , W ] . Precompute β i = � i k =1 ω ( x k ) = β i − 1 + ω ( x i ) . Find first index i , β i − 1 < r ≤ β i . Return x i . Edges have weight... 1 ...compute total weight of each vertex (adjacent edges). 2 Pick randomly a vertex by weight. 3 Pick random edge adjacent to this vertex. 4 Sariel (UIUC) CS573 13 Fall 2014 13 / 37

  33. How to pick a random edge? Lemma X = { x 1 , . . . , x n } : elements, ω ( x i ) : integer positive weight. Pick randomly, in O ( n ) time, an element ∈ X , with prob picking x i � n being ω ( x i ) / W , where W = i =1 ω ( x i ) . Proof. Randomly choose r ∈ [0 , W ] . Precompute β i = � i k =1 ω ( x k ) = β i − 1 + ω ( x i ) . Find first index i , β i − 1 < r ≤ β i . Return x i . Edges have weight... 1 ...compute total weight of each vertex (adjacent edges). 2 Pick randomly a vertex by weight. 3 Pick random edge adjacent to this vertex. 4 Sariel (UIUC) CS573 13 Fall 2014 13 / 37

  34. How to pick a random edge? Lemma X = { x 1 , . . . , x n } : elements, ω ( x i ) : integer positive weight. Pick randomly, in O ( n ) time, an element ∈ X , with prob picking x i � n being ω ( x i ) / W , where W = i =1 ω ( x i ) . Proof. Randomly choose r ∈ [0 , W ] . Precompute β i = � i k =1 ω ( x k ) = β i − 1 + ω ( x i ) . Find first index i , β i − 1 < r ≤ β i . Return x i . Edges have weight... 1 ...compute total weight of each vertex (adjacent edges). 2 Pick randomly a vertex by weight. 3 Pick random edge adjacent to this vertex. 4 Sariel (UIUC) CS573 13 Fall 2014 13 / 37

  35. Lemma... Lemma G : mincut of size k and n vertices, then | E ( G ) | ≥ kn 2 . Proof. Each vertex degree is at least k , otherwise the vertex itself would form a minimum cut of size smaller than k . As such, there are at least v ∈ V degree(v) / 2 ≥ nk / 2 edges in the graph. � Sariel (UIUC) CS573 14 Fall 2014 14 / 37

  36. Lemma... Lemma If we pick in random an edge e from a graph G , then with probability at most 2 n it belong to the minimum cut. Proof. There are at least nk / 2 edges in the graph and exactly k edges in the minimum cut. Thus, the probability of picking an edge from the minimum cut is smaller then k / ( nk / 2) = 2 / n . Sariel (UIUC) CS573 15 Fall 2014 15 / 37

  37. Lemma Lemma 2 MinCut outputs the mincut with prob. ≥ n ( n − 1) . Proof E i : event that e i is not in the minimum cut of G i . 1 MinCut outputs mincut if all the events E 0 , . . . , E n − 3 happen. 2 2 2 � � � Pr � E 0 ∩ E 1 ∩ . . . ∩ E i − 1 ≥ 1 − | V ( G i ) | = 1 − n − i . E i 3 � � � � = ⇒ ∆ = Pr[ E 0 ∩ . . . ∩ E n − 3 ] = Pr[ E 0 ] · Pr · E 1 � E 0 � � � � � � � Pr � E 0 ∩ E 1 · . . . · Pr � E 0 ∩ . . . ∩ E n − 4 E 2 E n − 3 � � Sariel (UIUC) CS573 16 Fall 2014 16 / 37

  38. Lemma Lemma 2 MinCut outputs the mincut with prob. ≥ n ( n − 1) . Proof E i : event that e i is not in the minimum cut of G i . 1 MinCut outputs mincut if all the events E 0 , . . . , E n − 3 happen. 2 2 2 � � � Pr � E 0 ∩ E 1 ∩ . . . ∩ E i − 1 ≥ 1 − | V ( G i ) | = 1 − n − i . E i 3 � � � � = ⇒ ∆ = Pr[ E 0 ∩ . . . ∩ E n − 3 ] = Pr[ E 0 ] · Pr · E 1 � E 0 � � � � � � � Pr � E 0 ∩ E 1 · . . . · Pr � E 0 ∩ . . . ∩ E n − 4 E 2 E n − 3 � � Sariel (UIUC) CS573 16 Fall 2014 16 / 37

  39. Proof continued... As such, we have n − 3 n − 3 � 2 � n − i − 2 � � ∆ ≥ 1 − = n − i n − i i =0 i =0 n − 2 ∗ n − 3 n − 1 ∗ n − 4 n − 2 . . . · 2 4 · 1 = n 3 2 = n · ( n − 1) . Sariel (UIUC) CS573 17 Fall 2014 17 / 37

  40. Some math restated... � 1 − 2 �� 2 �� 2 � � 1 − 2 �� 1 − 2 � α = 1 − 1 − · · · n − 1 n − 2 4 3 n = n − 2 · ( n − 1) − 2 · ( n − 2) − 2 · · · 4 − 2 · 3 − 2 n − 1 n − 2 4 3 n = n · n − 1 · · · · · · 2 · 1 Sariel (UIUC) CS573 18 Fall 2014 18 / 37

  41. Some math restated... � 1 − 2 �� 2 �� 2 � � 1 − 2 �� 1 − 2 � α = 1 − 1 − · · · n − 1 n − 2 4 3 n = n − 2 · ( n − 1) − 2 · ( n − 2) − 2 · · · 4 − 2 · 3 − 2 n − 1 n − 2 4 3 n = n · n − 1 · · · · · · 2 · 1 Sariel (UIUC) CS573 18 Fall 2014 18 / 37

  42. Some math restated... � 1 − 2 �� 2 �� 2 � � 1 − 2 �� 1 − 2 � α = 1 − 1 − · · · n − 1 n − 2 4 3 n = n − 2 · ( n − 1) − 2 · ( n − 2) − 2 · · · 4 − 2 · 3 − 2 n − 1 n − 2 4 3 n = n − 2 · n − 3 n − 1 · n − 4 n − 2 · n − 5 n − 3 · · · 3 5 · 2 4 · 1 3 n Sariel (UIUC) CS573 18 Fall 2014 18 / 37

  43. Some math restated... � 1 − 2 �� 2 �� 2 � � 1 − 2 �� 1 − 2 � α = 1 − 1 − · · · n − 1 n − 2 4 3 n = n − 2 · ( n − 1) − 2 · ( n − 2) − 2 · · · 4 − 2 · 3 − 2 n − 1 n − 2 4 3 n ✘ = ✘✘✘ n − 2 · n − 3 n − 1 · n − 4 n − 2 · n − 5 n − 3 · · · 3 5 · 2 4 · 1 ✘ ✘✘✘ 3 n Sariel (UIUC) CS573 18 Fall 2014 18 / 37

  44. Some math restated... � 1 − 2 �� 2 �� 2 � � 1 − 2 �� 1 − 2 � α = 1 − 1 − · · · n − 1 n − 2 4 3 n = n − 2 · ( n − 1) − 2 · ( n − 2) − 2 · · · 4 − 2 · 3 − 2 n − 1 n − 2 4 3 n ✘ ❳❳❳ = ✘✘✘ n − 2 n − 1 · n − 4 n − 3 ❳ n − 2 · n − 5 n − 3 · · · ✓ 3 5 · 2 4 · 1 · ✘ ❳❳❳ ✘✘✘ ❳ ✓ 3 n Sariel (UIUC) CS573 18 Fall 2014 18 / 37

  45. Some math restated... � 1 − 2 �� 2 �� 2 � � 1 − 2 �� 1 − 2 � α = 1 − 1 − · · · n − 1 n − 2 4 3 n = n − 2 · ( n − 1) − 2 · ( n − 2) − 2 · · · 4 − 2 · 3 − 2 n − 1 n − 2 4 3 n ✘ ❳❳❳ ❳❳❳ ✘ ❳❳❳ ✘ = ✘✘✘ n − 1 · ✘✘✘ n − 2 · ✘✘✘ n − 2 n − 3 ❳ n − 4 ❳ n − 3 · · · ✓ n − 5 ❳ 5 · 2 3 4 · 1 · ✘ ❳❳❳ ✘✘✘ ❳ ✓ ❙ ❙ ✓ 3 ✓ n Sariel (UIUC) CS573 18 Fall 2014 18 / 37

  46. Some math restated... � 1 − 2 �� 2 �� 2 � � 1 − 2 �� 1 − 2 � α = 1 − 1 − · · · n − 1 n − 2 4 3 n = n − 2 · ( n − 1) − 2 · ( n − 2) − 2 · · · 4 − 2 · 3 − 2 n − 1 n − 2 4 3 n ✘ ❳❳❳ ❳❳❳ ✘ ❳❳❳ ✘ = ✘✘✘ n − 1 · ✘✘✘ n − 2 · ✘✘✘ n − 2 n − 3 ❳ n − 4 ❳ n − 5 n − 3 · · · ✓ ❳ 3 5 · 2 4 · 1 · ✘ ❳❳❳ ✘✘✘ ❳ ✓ ❙ ✓ ❙ ✓ 3 n · 2 · 1 = · n − 1 · · · · · n Sariel (UIUC) CS573 18 Fall 2014 18 / 37

  47. Some math restated... � 1 − 2 �� 2 �� 2 � � 1 − 2 �� 1 − 2 � α = 1 − 1 − · · · n − 1 n − 2 4 3 n = n − 2 · ( n − 1) − 2 · ( n − 2) − 2 · · · 4 − 2 · 3 − 2 n − 1 n − 2 4 3 n ✘ ❳❳❳ ❳❳❳ ✘ ❳❳❳ ✘ = ✘✘✘ n − 1 · ✘✘✘ n − 2 · ✘✘✘ n − 2 n − 3 ❳ n − 4 ❳ n − 5 n − 3 · · · ✓ ❳ 3 5 · 2 4 · 1 · ✘ ❳❳❳ ✘✘✘ ❳ ✓ ❙ ❙ ✓ ✓ 3 n · 2 · 1 = · n − 1 · · · · · n 2 = n ( n − 1) Sariel (UIUC) CS573 18 Fall 2014 18 / 37

  48. Running time analysis... Observation MinCut runs in O ( n 2 ) time. Observation The algorithm always outputs a cut, and the cut is not smaller than the minimum cut. Definition Amplification : running an experiment again and again till the things we want to happen, with good probability, do happen. Sariel (UIUC) CS573 19 Fall 2014 19 / 37

  49. Getting a good probability MinCutRep : algorithm runs MinCut n ( n − 1) times and return the minimum cut computed. Lemma probability MinCutRep fails to return the minimum cut is < 0 . 14 . Proof. MinCut fails to output the mincut in each execution is at most 2 1 − n ( n − 1) . MinCutRep fails, only if all n ( n − 1) executions of MinCut fail. � n ( n − 1) ≤ exp � � � 2 2 1 − − n ( n − 1) · n ( n − 1) = exp( − 2) < n ( n − 1) 0 . 14 , since 1 − x ≤ e − x for 0 ≤ x ≤ 1 . Sariel (UIUC) CS573 20 Fall 2014 20 / 37

  50. Result Theorem One can compute mincut in O ( n 4 ) time with constant probability to get a correct result. In O ( n 4 log n ) time the minimum cut is returned with high probability. Sariel (UIUC) CS573 21 Fall 2014 21 / 37

  51. Faster algorithm Why MinCutRep needs so many executions? Probability of failure in first ν iterations is ν − 1 ν − 1 � 2 � n − i − 2 � � � � Pr E 0 ∩ . . . ∩ E ν − 1 ≥ 1 − = n − i n − i i =0 i =0 = n − 2 ∗ n − 3 n − 1 ∗ n − 4 n − 2 . . . n = ( n − ν )( n − ν − 1) . n · ( n − 1) = ⇒ ν = n / 2 : Prob of success ≈ 1 / 4 . ⇒ ν = n − √ n : Prob of success ≈ 1 / n . = Sariel (UIUC) CS573 22 Fall 2014 22 / 37

  52. Faster algorithm Why MinCutRep needs so many executions? Probability of failure in first ν iterations is ν − 1 ν − 1 � 2 � n − i − 2 � � � � Pr E 0 ∩ . . . ∩ E ν − 1 ≥ 1 − = n − i n − i i =0 i =0 = n − 2 ∗ n − 3 n − 1 ∗ n − 4 n − 2 . . . n = ( n − ν )( n − ν − 1) . n · ( n − 1) = ⇒ ν = n / 2 : Prob of success ≈ 1 / 4 . ⇒ ν = n − √ n : Prob of success ≈ 1 / n . = Sariel (UIUC) CS573 22 Fall 2014 22 / 37

  53. Faster algorithm Why MinCutRep needs so many executions? Probability of failure in first ν iterations is ν − 1 ν − 1 � 2 � n − i − 2 � � � � Pr E 0 ∩ . . . ∩ E ν − 1 ≥ 1 − = n − i n − i i =0 i =0 = n − 2 ∗ n − 3 n − 1 ∗ n − 4 n − 2 . . . n = ( n − ν )( n − ν − 1) . n · ( n − 1) = ⇒ ν = n / 2 : Prob of success ≈ 1 / 4 . ⇒ ν = n − √ n : Prob of success ≈ 1 / n . = Sariel (UIUC) CS573 22 Fall 2014 22 / 37

  54. Faster algorithm Why MinCutRep needs so many executions? Probability of failure in first ν iterations is ν − 1 ν − 1 � 2 � n − i − 2 � � � � Pr E 0 ∩ . . . ∩ E ν − 1 ≥ 1 − = n − i n − i i =0 i =0 = n − 2 ∗ n − 3 n − 1 ∗ n − 4 n − 2 . . . n = ( n − ν )( n − ν − 1) . n · ( n − 1) = ⇒ ν = n / 2 : Prob of success ≈ 1 / 4 . ⇒ ν = n − √ n : Prob of success ≈ 1 / n . = Sariel (UIUC) CS573 22 Fall 2014 22 / 37

  55. Faster algorithm... Insight As the graph get smaller probability for bad choice increases. 1 Currently do the amplification from the outside of the algorithm. 2 Put amplification directly into the algorithm. 3 Sariel (UIUC) CS573 23 Fall 2014 23 / 37

  56. Faster algorithm... Insight As the graph get smaller probability for bad choice increases. 1 Currently do the amplification from the outside of the algorithm. 2 Put amplification directly into the algorithm. 3 Sariel (UIUC) CS573 23 Fall 2014 23 / 37

  57. Faster algorithm... Insight As the graph get smaller probability for bad choice increases. 1 Currently do the amplification from the outside of the algorithm. 2 Put amplification directly into the algorithm. 3 Sariel (UIUC) CS573 23 Fall 2014 23 / 37

  58. Contract... Contract ( G , t ) shrinks G till it has only t vertices. FastCut computes the minimum cut using Contract . FastCut ( G = ( V , E ) ) G -- multi-graph begin n ← | V ( G ) | if n ≤ 6 then Contract ( G , t ) Compute minimum cut while | ( G ) | > t do of G and return cut. √ Pick a random edge � � t ← 1 + n / 2 e in G . H 1 ← Contract ( G , t ) G ← G / e H 2 ← Contract ( G , t ) return G /* Contract is randomized!!! */ X 1 ← FastCut ( H 1 ) , X 2 ← FastCut ( H 2 ) return mincut of X 1 and X 2 . end Sariel (UIUC) CS573 24 Fall 2014 24 / 37

  59. Lemma... Lemma The running time of FastCut ( G ) is O ( n 2 log n ) , where n = | V ( G ) | . Proof. Well, we perform two calls to Contract ( G , t ) which takes O ( n 2 ) time. And then we perform two recursive calls on the resulting graphs. We have: � � T ( n ) = O ( n 2 ) + 2 T n √ 2 The solution to this recurrence is O ( n 2 log n ) as one can easily (and should) verify. Sariel (UIUC) CS573 25 Fall 2014 25 / 37

  60. Lemma... Lemma The running time of FastCut ( G ) is O ( n 2 log n ) , where n = | V ( G ) | . Proof. Well, we perform two calls to Contract ( G , t ) which takes O ( n 2 ) time. And then we perform two recursive calls on the resulting graphs. We have: � � T ( n ) = O ( n 2 ) + 2 T n √ 2 The solution to this recurrence is O ( n 2 log n ) as one can easily (and should) verify. Sariel (UIUC) CS573 25 Fall 2014 25 / 37

  61. Success at each step Lemma Probability that mincut in contracted graph is original mincut is at least 1 / 2 . Proof. √ � � Plug in ν = n − t = n − 1 + n / 2 into success probability: � � Pr E 0 ∩ . . . ∩ E n − t ≥ Sariel (UIUC) CS573 26 Fall 2014 26 / 37

  62. Success at each step Lemma Probability that mincut in contracted graph is original mincut is at least 1 / 2 . Proof. √ � � Plug in ν = n − t = n − 1 + n / 2 into success probability: � � t ( t − 1) Pr E 0 ∩ . . . ∩ E n − t ≥ n · ( n − 1) Sariel (UIUC) CS573 26 Fall 2014 26 / 37

  63. Success at each step Lemma Probability that mincut in contracted graph is original mincut is at least 1 / 2 . Proof. √ � � Plug in ν = n − t = n − 1 + n / 2 into success probability: � � t ( t − 1) Pr E 0 ∩ . . . ∩ E n − t ≥ n · ( n − 1) √ √ � ��� � � 1 + n / 2 1 + n / 2 − 1 ≥ 1 = 2 . n ( n − 1) Sariel (UIUC) CS573 26 Fall 2014 26 / 37

  64. Probability of success... Lemma FastCut finds the minimum cut with probability larger than Ω (1 / log n ) . See class notes for a formal proof. We provide a more elegant direct argument shortly. Sariel (UIUC) CS573 27 Fall 2014 27 / 37

  65. Amplification Lemma Running FastCut repeatedly c · log 2 n times, guarantee that the algorithm outputs mincut with probability ≥ 1 − 1 / n 2 . c is a constant large enough. Proof. FastCut succeeds with prob ≥ c ′ / log n , c ′ is a constant. 1 ...fails with prob. ≤ 1 − c ′ / log n . 2 ...fails in m reps with prob. ≤ (1 − c ′ / log n ) m . But then 3 e − c ′ / log n � m ≤ e − mc ′ / log n ≤ (1 − c ′ / log n ) m ≤ � 1 n 2 , for m = (2 log n ) / c ′ . Sariel (UIUC) CS573 28 Fall 2014 28 / 37

  66. Amplification Lemma Running FastCut repeatedly c · log 2 n times, guarantee that the algorithm outputs mincut with probability ≥ 1 − 1 / n 2 . c is a constant large enough. Proof. FastCut succeeds with prob ≥ c ′ / log n , c ′ is a constant. 1 ...fails with prob. ≤ 1 − c ′ / log n . 2 ...fails in m reps with prob. ≤ (1 − c ′ / log n ) m . But then 3 e − c ′ / log n � m ≤ e − mc ′ / log n ≤ (1 − c ′ / log n ) m ≤ � 1 n 2 , for m = (2 log n ) / c ′ . Sariel (UIUC) CS573 28 Fall 2014 28 / 37

  67. Amplification Lemma Running FastCut repeatedly c · log 2 n times, guarantee that the algorithm outputs mincut with probability ≥ 1 − 1 / n 2 . c is a constant large enough. Proof. FastCut succeeds with prob ≥ c ′ / log n , c ′ is a constant. 1 ...fails with prob. ≤ 1 − c ′ / log n . 2 ...fails in m reps with prob. ≤ (1 − c ′ / log n ) m . But then 3 e − c ′ / log n � m ≤ e − mc ′ / log n ≤ (1 − c ′ / log n ) m ≤ � 1 n 2 , for m = (2 log n ) / c ′ . Sariel (UIUC) CS573 28 Fall 2014 28 / 37

  68. Theorem Theorem One can compute the minimum cut in a graph G with n vertices in O ( n 2 log 3 n ) time. The algorithm succeeds with probability ≥ 1 − 1 / n 2 . Proof. We do amplification on FastCut by running it O (log 2 n ) times. The running time bound follows from lemma... Sariel (UIUC) CS573 29 Fall 2014 29 / 37

  69. Part II On coloring trees and min-cut Sariel (UIUC) CS573 30 Fall 2014 30 / 37

  70. Trees and coloring edges... T h be a complete binary tree of height h . 1 Randomly color its edges by black and white. 2 E h : there exists a black path from root T h to one of its leafs. 3 ρ h = Pr[ E h ] . 4 ρ 0 = 1 and ρ 1 = 3 / 4 (see below). 5 Sariel (UIUC) CS573 31 Fall 2014 31 / 37

  71. Trees and coloring edges... T h be a complete binary tree of height h . 1 Randomly color its edges by black and white. 2 E h : there exists a black path from root T h to one of its leafs. 3 ρ h = Pr[ E h ] . 4 ρ 0 = 1 and ρ 1 = 3 / 4 (see below). 5 Sariel (UIUC) CS573 31 Fall 2014 31 / 37

  72. Trees and coloring edges... T h be a complete binary tree of height h . 1 Randomly color its edges by black and white. 2 E h : there exists a black path from root T h to one of its leafs. 3 ρ h = Pr[ E h ] . 4 ρ 0 = 1 and ρ 1 = 3 / 4 (see below). 5 Sariel (UIUC) CS573 31 Fall 2014 31 / 37

  73. Trees and coloring edges... T h be a complete binary tree of height h . 1 Randomly color its edges by black and white. 2 E h : there exists a black path from root T h to one of its leafs. 3 ρ h = Pr[ E h ] . 4 ρ 0 = 1 and ρ 1 = 3 / 4 (see below). 5 Sariel (UIUC) CS573 31 Fall 2014 31 / 37

  74. Trees and coloring edges... T h be a complete binary tree of height h . 1 Randomly color its edges by black and white. 2 E h : there exists a black path from root T h to one of its leafs. 3 ρ h = Pr[ E h ] . 4 ρ 0 = 1 and ρ 1 = 3 / 4 (see below). 5 Sariel (UIUC) CS573 31 Fall 2014 31 / 37

Recommend


More recommend