Karger’s Min-Cut Algorithm Amihood Amir Bar-Ilan University, 2009.

Slides:



Advertisements
Similar presentations
Greedy Algorithms Amihood Amir Bar-Ilan University.
Advertisements

Great Theoretical Ideas in Computer Science for Some.
1 Discrete Structures & Algorithms Graphs and Trees: III EECE 320.
Presented by Yuval Shimron Course
Minimum Spanning Trees Definition Two properties of MST’s Prim and Kruskal’s Algorithm –Proofs of correctness Boruvka’s algorithm Verifying an MST Randomized.
Lectures on Network Flows
1 Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
CSL758 Instructors: Naveen Garg Kavitha Telikepalli Scribe: Manish Singh Vaibhav Rastogi February 7 & 11, 2008.
Great Theoretical Ideas in Computer Science.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Graph Clustering. Why graph clustering is useful? Distance matrices are graphs  as useful as any other clustering Identification of communities in social.
1 Mazes In The Theory of Computer Science Dana Moshkovitz.
Randomized Algorithms and Randomized Rounding Lecture 21: April 13 G n 2 leaves
A Simple Min-Cut Algorithm Joseph Vessella Rutgers-Camden 1.
1 University of Freiburg Computer Networks and Telematics Prof. Christian Schindelhauer Mobile Ad Hoc Networks Theory of Data Flow and Random Placement.
The selfish-edges Minimum Spanning Tree (MST) problem.
On the Crossing Spanning Tree Vineet Goyal Joint work with Vittorio Bilo, R. Ravi and Mohit Singh.
CSE 326: Data Structures Spanning Trees Ben Lerner Summer 2007.
Complexity 1 Mazes And Random Walks. Complexity 2 Can You Solve This Maze?
Flows sourcesink s t Flows sourcesink edge-weights = capacities.
Study Group Randomized Algorithms Jun 7, 2003 Jun 14, 2003.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
Randomness in Computation and Communication Part 1: Randomized algorithms Lap Chi Lau CSE CUHK.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 11 Instructor: Paul Beame.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2004 Lecture 5 Wednesday, 10/6/04 Graph Algorithms: Part 2.
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
Approximating the MST Weight in Sublinear Time Bernard Chazelle (Princeton) Ronitt Rubinfeld (NEC) Luca Trevisan (U.C. Berkeley)
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
Graph Sparsifiers Nick Harvey University of British Columbia Based on joint work with Isaac Fung, and independent work of Ramesh Hariharan & Debmalya Panigrahi.
1 Min-cut for Undirected Graphs Given an undirected graph, a global min-cut is a cut (S,V-S) minimizing the number of crossing edges, where a crossing.
The Best Algorithms are Randomized Algorithms N. Harvey C&O Dept TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
9/23/2015ACM-ICPC1 Maximum Flow Problem Source t fg e 42 Target (sink) flow capacity b s c a de 2/3/ actual flow 1/2/ 1/ 2/ 1.Actual flow  capacity.
APPROXIMATION ALGORITHMS VERTEX COVER – MAX CUT PROBLEMS
Approximating Minimum Bounded Degree Spanning Tree (MBDST) Mohit Singh and Lap Chi Lau “Approximating Minimum Bounded DegreeApproximating Minimum Bounded.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
 2004 SDU Lecture 7- Minimum Spanning Tree-- Extension 1.Properties of Minimum Spanning Tree 2.Secondary Minimum Spanning Tree 3.Bottleneck.
1 COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf.
CS 473Lecture ?1 CS473-Algorithms I Lecture ? Network Flows Finding Max Flow.
The Minimum Spanning Tree (MST) problem in graphs with selfish edges.
Flow Algorithms Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms Week 9, Lecture 2.
HEAPS Amihood Amir Bar Ilan University Sorting Bubblesort: Until no exchanges: For i=1 to n-1 if A[i]>A[i+1] then exchange their values end Time.
and 6.855J March 6, 2003 Maximum Flows 2. 2 Network Reliability u Communication Network u What is the maximum number of arc disjoint paths from.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Communication Complexity Guy Feigenblat Based on lecture by Dr. Ely Porat Some slides where adapted from various sources Complexity course Computer science.
Great Theoretical Ideas in Computer Science for Some.
1 Assignment #3 is posted: Due Thursday Nov. 15 at the beginning of class. Make sure you are also working on your projects. Come see me if you are unsure.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
Robust Graph Coloring on Paths Ralf Ollig. ROBUST GRAPH COLORING PROBLEM Undirected Graph G =(V,E) Undirected Graph G =(V,E) Positive integer k ≥ χ(G)
© J. Christopher Beck Lecture 16: Local Search.
CSE 589 Applied Algorithms Spring 1999 Prim’s Algorithm for MST Load Balance Spanning Tree Hamiltonian Path.
Proof of correctness of Dijkstra’s algorithm: Basically, we need to prove two claims. (1)Let S be the set of vertices for which the shortest path from.
CSC317 1 At the same time: Breadth-first search tree: If node v is discovered after u then edge uv is added to the tree. We say that u is a predecessor.
Greedy Algorithms.
Randomized Min-Cut Algorithm
COMP108 Algorithmic Foundations Greedy methods
Chapter 5. Greedy Algorithms
Approximating the MST Weight in Sublinear Time
Minimum Spanning Tree 8/7/2018 4:26 AM
Lectures on Network Flows
Great Theoretical Ideas in Computer Science
Lecture 18: Uniformity Testing Monotonicity Testing
Chapter 5. Optimal Matchings
Approximation algorithms
Discrete Mathematics for Computer Science
Enumerating Distances Using Spanners of Bounded Degree
Network Flow 2016/04/12.
3.5 Minimum Cuts in Undirected Graphs
CSE 373: Data Structures and Algorithms
The Greedy Approach Young CS 530 Adv. Algo. Greedy.
CSE 332: Minimum Spanning Trees
Presentation transcript:

Karger’s Min-Cut Algorithm Amihood Amir Bar-Ilan University, 2009

The Problem INPUT: Undirected Graph G=(V,E) OUTPUT: A smallest-size set of edges such that G’=(V,E-E 1 ) is not connected.

Example A C B D G E F

A C B D G E F E 1 = BE

Immediate Solution For every pair of nodes s,t find the min-cut M s,t Choose the pair with the smallest M s,t. Time= O(n² T(min-cut) )

Time for Min-Cut Ford-Fulkerson: O(|E|flow) In our case: max flow ≤ n so: O(n² |E|n) = O(n² n³) This can be improved

Improvement We don’t need all pairs. Why? Every node is in one side of a cut. Therefore: Fix node s. Try all other n-1 options as node t. Time:

Randomized Solution Repeat Until 2 nodes left: 1. choose edge at random 2. “contract” edge When only 2 node left: Take all edges between them as the min- cut. Time: O(|E|)=O(n²)

Meaning of “contraction” Make edge ab with its two adjacent nodes a,b into a single node ab. All edges of a and b will now be edges from ab (creating a multigraph).

Example: A C B D G E F

A C B D G E F contract

Example: A C B D G E F contract A C B D E FG

Example: A C B D G E F contract A C B D E FG contract

Example: A C B D G E F contract A C B D E FG contract A C BE FGD

Is output min-cut? Not necessarily. Is it a cut? -yes.

Is output min-cut? Not necessarily. Is it a cut? -yes. Could there be an edge between these sides that was deleted?

Is output min-cut? Not necessarily. Is it a cut? -yes. No. The only deleted edges were within the contractions.

Is output min-cut? Not necessarily. Is it a cut? -yes. cut C ={e 1,…,e c } No. The only deleted edges were within the contractions.

When is C a min-cut? When none of the edges in C={e 1,…,e c } are chosen to be contracted. What is the probability of that happening?

Probability calculation Note: We can assume that degree of every node in graph throughout contraction process ≥ c

Probability calculation Note: We can assume that degree of every node in graph throughout contraction process ≥ c Otherwise: Cut node and get cut of size < c.

Probability calculation Probability that one of the C edges is chosen at first stage: Probability that one of the C edges is chosen after stage i ≤: Probability of not choosing an edge of C at stage i ≥:

Probability calculation Note: The algorithm has n-2 stages (at that point 2 nodes are left). Probability of not choosing an edge from C at any stage ≥ =

Probability calculation What do we have?

Probability calculation What do we have? Telescope cancellations: =

Conclude Run the algorithm O(n²) times and expect to get C with constant probability. Total time: No better than Ford-Fulkerson! Can we do better?

IDEA! The situation: n² results, one of which is expected to be good. O(n²) time

What if? Could compute: n² results, one of which is expected to be good. O(log n) time

This is not quite the situation… But note: The probability of not hitting C at stage 1 is (almost 1 ). It grows as we run more and more stages. What happens if we stop in the middle? The probability that C not touched in the first i steps ≥

So what is the situation? When is the probability of not hitting C exactly ½ ? -- When nodes are left. Because take then

This means If we run two times until nodes are left we expect that one of them still did not touch C So, for each of these runs, when nodes are left, stop running and recurse!

Time: The closed form is: Much better! But what is the overall probability?

Probability: Assume we are in level d of the recursion tree, with the leaves being level 1. Let P d (x) be the probability that there is a path from node x at level d that does not touch C. We have: P d (x)= ½ (Probability that at least one of the two recursions does not touch C )

Probability: Recall: Pr(A or B)= Pr(A)+Pr(B)-Pr(A and B) We have: P d (x)= ½ (2P d-1 -(P d-1 )²) Where P d-1 is the probability that a child of x does not hit C. = P d-1 – ½ (P d-1 )² Claim: For d >1, P d >1/d Proof: Note that in the interval [0,1) the function x – ½ x² decreases monotonically.

Probability: We have: P d = P d-1 – ½ (P d-1 )². Inductively: P d-1 >1/(d-1). So, because of monotonicity, P d-1 – ½ (P d-1 )² >

Probability: Conclude: P log n (x) > 1/log n Which means: If we run the algorithm log n times, we get constant probability.So… Total time: O(n² log² n)