Randomized Min-Cut Algorithm

Slides:



Advertisements
Similar presentations
Great Theoretical Ideas in Computer Science for Some.
Advertisements

1 Discrete Structures & Algorithms Graphs and Trees: III EECE 320.
CSL758 Instructors: Naveen Garg Kavitha Telikepalli Scribe: Manish Singh Vaibhav Rastogi February 7 & 11, 2008.
ITEC200 – Week 12 Graphs. 2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Discussion #36 Spanning Trees
Karger’s Min-Cut Algorithm Amihood Amir Bar-Ilan University, 2009.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
CSE 326: Data Structures Spanning Trees Ben Lerner Summer 2007.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 10 Instructor: Paul Beame.
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.
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)
Algorithmic Foundations COMP108 COMP108 Algorithmic Foundations Greedy methods Prudence Wong
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Lecture 19 Greedy Algorithms Minimum Spanning Tree Problem.
Fundamental Data Structures and Algorithms (Spring ’05) Recitation Notes: Graphs Slides prepared by Uri Dekel, Based on recitation.
Minimal Spanning Tree Problems in What is a minimal spanning tree An MST is a tree (set of edges) that connects all nodes in a graph, using.
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.
Graph Theory. undirected graph node: a, b, c, d, e, f edge: (a, b), (a, c), (b, c), (b, e), (c, d), (c, f), (d, e), (d, f), (e, f) subgraph.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
COMP108 Algorithmic Foundations Greedy methods
Introduction to Algorithms
Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008
May 12th – Minimum Spanning Trees
Chapter 5. Greedy Algorithms
Redraw these graphs so that none of the line intersect except at the vertices B C D E F G H.
Shortest Paths and Minimum Spanning Trees
Minimum Spanning Trees
CSE373: Data Structures & Algorithms
Approximating the MST Weight in Sublinear Time
Spanning Trees.
Minimum Spanning Tree 8/7/2018 4:26 AM
Randomized Algorithms
June 2017 High Density Clusters.
Lectures on Network Flows
Great Theoretical Ideas in Computer Science
Lecture 18: Uniformity Testing Monotonicity Testing
Chapter 5. Optimal Matchings
Topological Sort (topological order)
MST in Log-Star Rounds of Congested Clique
Short paths and spanning trees
Graph Algorithm.
Enumerating Distances Using Spanners of Bounded Degree
CIS 700: “algorithms for Big Data”
Instructor: Shengyu Zhang
CSE373: Data Structures & Algorithms Lecture 12: Minimum Spanning Trees Catie Baker Spring 2015.
Shortest Path Consider the following weighted undirected graph: 20 10
CSE 373 Data Structures and Algorithms
3.5 Minimum Cuts in Undirected Graphs
Hannah Tang and Brian Tjaden Summer Quarter 2002
CSCI B609: “Foundations of Data Science”
Shortest Paths and Minimum Spanning Trees
Algorithms (2IL15) – Lecture 7
Lecture 14 Shortest Path (cont’d) Minimum Spanning Tree
CSE 373: Data Structures and Algorithms
EE5900 Advanced Embedded System For Smart Infrastructure
CSE 417: Algorithms and Computational Complexity
CSE 373: Data Structures and Algorithms
The Greedy Approach Young CS 530 Adv. Algo. Greedy.
CSE 373: Data Structures and Algorithms
Lecture 14 Minimum Spanning Tree (cont’d)
CSE 332: Minimum Spanning Trees
Lecture 13 Shortest Path (cont’d) Minimum Spanning Tree
Topological Sorting Minimum Spanning Trees Shortest Path
Presentation transcript:

Randomized Min-Cut Algorithm Slides based on Slides by Amihood Amir

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

Example F A B E G C D

Example F A B E G C D E1 = BE

Immediate Solution For every pair of nodes s,t find the min-cut Ms,t Choose the pair <s,t> with the smallest Ms,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(n²) using e.g. an adjacency matrix. Other implementations possible.

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. Question: Why should this work? Would the analogous algorithm work for spanning trees or shortest paths or sorting or some other problem?

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: F A B E G C D

Example: F A contract B E G C D

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

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

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

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={e1,…,ec} No. The only deleted edges were within the contractions.

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

Probability calculation Note: degree of every node in graph throughout contraction process ≥ c Contracting an edge only increases the value of the minimum cut. Because contraction destroys cuts and does not create any new cuts

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: THIS IS A SMALL NUMBER! 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. Run the algorithm O(n² log n) times and find C with high probability. Total time: O(n4 log n) No better than Ford-Fulkerson! There are other algorithms that get O(nm) time bounds (Nagamochi-Ibaraki, Hao-Orling) Can we do better?

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

IDEA! Consider one run of the contraction algorithm The probability of contracting a minimum cut edge is increasing over time. It is 2/3 for the last iteration Maybe we should stop earlier and switch to a higher probability, slower algorithm.

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! The higher probability, slower algorithm is the run the contraction algorithm twice!

Recursive Contraction Algorithm RCA(G,n) if (n==2) output the trivial cut else repeat twice Contract G down to vertices. Call this graph G’. RCA(G’, )

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

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

Probability: Which solves to So in O(n2logn) time we find a cut with Probability (1/log n), repeating O(log2n) Times we find a cut with high probability.