A Randomized Linear-Time Algorithm to Find Minimum Spaning Trees 黃則翰 R96922141 蘇承祖 R96922077 張紘睿 R96922136 許智程 D95922022 戴于晉 R96922171 David R. Karger.

Slides:



Advertisements
Similar presentations
Lecture 15. Graph Algorithms
Advertisements

Graph Algorithms - 4 Algorithm Design and Analysis Victor AdamchikCS Spring 2014 Lecture 14Feb 14, 2014Carnegie Mellon University.
Comp 122, Spring 2004 Greedy Algorithms. greedy - 2 Lin / Devi Comp 122, Fall 2003 Overview  Like dynamic programming, used to solve optimization problems.
Greedy Algorithms Greed is good. (Some of the time)
Minimum Spanning Trees Definition Two properties of MST’s Prim and Kruskal’s Algorithm –Proofs of correctness Boruvka’s algorithm Verifying an MST Randomized.
Graphs III (Trees, MSTs) (Chp 11.5, 11.6)
Combinatorial Algorithms
A Randomized Linear-Time Algorithm to Find Minimum Spanning Trees David R. Karger David R. Karger Philip N. Klein Philip N. Klein Robert E. Tarjan.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Greedy Algorithms for Matroids Andreas Klappenecker.
Discussion #36 Spanning Trees
Data Structures, Spring 2004 © L. Joskowicz 1 Data Structures – LECTURE 13 Minumum spanning trees Motivation Properties of minimum spanning trees Kruskal’s.
1 Algorithms for Large Data Sets Ziv Bar-Yossef Lecture 8 May 4, 2005
3 -1 Chapter 3 The Greedy Method 3 -2 The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Princeton University COS 423 Theory of Algorithms Spring 2002 Kevin Wayne MST: Red Rule, Blue Rule Some of these lecture slides are adapted from material.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 11 Instructor: Paul Beame.
TECH Computer Science Graph Optimization Problems and Greedy Algorithms Greedy Algorithms  // Make the best choice now! Optimization Problems  Minimizing.
Subdivision of Edge In a graph G, subdivision of an edge uv is the operation of replacing uv with a path u,w,v through a new vertex w.
Minimal Spanning Trees What is a minimal spanning tree (MST) and how to find one.
Midwestern State University Minimum Spanning Trees Definition of MST Generic MST algorithm Kruskal's algorithm Prim's algorithm 1.
Design and Analysis of Computer Algorithm September 10, Design and Analysis of Computer Algorithm Lecture 5-2 Pradondet Nilagupta Department of Computer.
1 Minimum Spanning Tree in expected linear time. Epilogue: Top-in card shuffling.
9/10/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova, K. Wayne Adam Smith Algorithm Design and Analysis L ECTURE 8 Greedy Graph.
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
Algorithms for Enumerating All Spanning Trees of Undirected and Weighted Graphs Presented by R 李孟哲 R 陳翰霖 R 張仕明 Sanjiv Kapoor and.
MST Many of the slides are from Prof. Plaisted’s resources at University of North Carolina at Chapel Hill.
2IL05 Data Structures Fall 2007 Lecture 13: Minimum Spanning Trees.
Spring 2015 Lecture 11: Minimum Spanning Trees
UNC Chapel Hill Lin/Foskey/Manocha Minimum Spanning Trees Problem: Connect a set of nodes by a network of minimal total length Some applications: –Communication.
Minimum Spanning Trees and Kruskal’s Algorithm CLRS 23.
7.1 and 7.2: Spanning Trees. A network is a graph that is connected –The network must be a sub-graph of the original graph (its edges must come from the.
Expanders via Random Spanning Trees R 許榮財 R 黃佳婷 R 黃怡嘉.
 2004 SDU Lecture 7- Minimum Spanning Tree-- Extension 1.Properties of Minimum Spanning Tree 2.Secondary Minimum Spanning Tree 3.Bottleneck.
Greedy Algorithms and Matroids Andreas Klappenecker.
Lecture 19 Greedy Algorithms Minimum Spanning Tree Problem.
Spanning Trees. A spanning tree for a connected, undirected graph G is a graph S consisting of the nodes of G together with enough edges of G such that:
Introduction to Graph Theory
Minimum Bottleneck Spanning Trees (MBST)
Spanning tree Lecture 4.
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.
Lecture 12 Algorithm Analysis Arne Kutzner Hanyang University / Seoul Korea.
Algorithm Design and Analysis June 11, Algorithm Design and Analysis Pradondet Nilagupta Department of Computer Engineering This lecture note.
Theory of Computational Complexity Probability and Computing Ryosuke Sasanuma Iwama and Ito lab M1.
Midwestern State University Minimum Spanning Trees Definition of MST Generic MST algorithm Kruskal's algorithm Prim's algorithm 1.
CHAPTER SIX T HE P ROBABILISTIC M ETHOD M1 Zhang Cong 2011/Nov/28.
Introduction to Algorithms
Spanning Trees.
Minimum Spanning Tree 8/7/2018 4:26 AM
Lecture 12 Algorithm Analysis
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
MST in Log-Star Rounds of Congested Clique
A Randomized Linear-Time Algorithm to Find Minimum Spanning Trees
Randomized Algorithms CS648
CIS 700: “algorithms for Big Data”
Connected Components Minimum Spanning Tree
Data Structures – LECTURE 13 Minumum spanning trees
Chapter 23 Minimum Spanning Tree
CS 583 Analysis of Algorithms
CSCI B609: “Foundations of Data Science”
Lecture 12 Algorithm Analysis
Kruskal’s algorithm for MST and Special Data Structures: Disjoint Sets
Minimum Spanning Trees (MSTs)
Lecture 12 Algorithm Analysis
Winter 2019 Lecture 11 Minimum Spanning Trees (Part II)
Analysis of Algorithms
Minimum Spanning Trees
Autumn 2019 Lecture 11 Minimum Spanning Trees (Part II)
Presentation transcript:

A Randomized Linear-Time Algorithm to Find Minimum Spaning Trees 黃則翰 R 蘇承祖 R 張紘睿 R 許智程 D 戴于晉 R David R. Karger Philip N. Klein Robert E. Tarjan

Outline Introduction Basic Property & Definition Algorithm Analysis

Outline Introduction Basic Property & Definition Algorithm Analysis

Introduction [Borůvka 1962] O(m log n) Gabow et al.[1984] O(m log β (m,n) ) ◦ β (m,n)= min { i |log (i) n <= m/n} Verification algorithm ◦ King[1993] O(m) A randomize algorithm runs in O(m) time with high probability

Outline Introduction Basic Property & Definition Algorithm Analysis

Cycle property For any cycle C in a graph, the heaviest edge in C dose not appear in the minimum spanning forest

Cut Property For any proper nonempty subset X of the vertices, the lightest edge with exactly one endpoint in X belongs to the minimum spanning tree X

Definition Let G be a graph with weighted edges. ◦ w(x,y)  The weight of edge {x,y} If F is a forest of a subgraph in G ◦ F(x, y)  the path (if any) connecting x and y in F ◦ w F (x, y)  the maximum weight of an edge on F(x, y) ◦ w F (x, y)=∞  If x and y are not connected in F

F-heavy & F-light An edge {x,y} is F-heavy if w(x,y) > w F (x,y) and F-light otherwise Edge of F are all F-light AC B D EG F H W(B,D)=6 W F (B,D)=max{2,3,5} F-heavy W(F,H)=6 W F (F,H)= ∞ F-light W(C,D)=5 W F (C,D)=5 F-light

No F-heavy edge can be in the minimum spanning forest of G (cycle property) Discard edge that cannot be in the minimum spanning tree F-light edge can be the candidate edge for the minimum spanning tree of G Observation

Outline Introduction Basic Property & Definition Algorithm Analysis

Boruvka Algorithm For each vertex, select the minimum-weight edge incident to the vertex. Replace by a single vertex each connected component defined by the selected edges. Delete all resulting isolated vertices, loops, and all but the lowest-weight edge among each set of multiple edges.

Algorithm Step1 Apply two successive Boruvka steps to the graph, thereby reducing the number of vertices by at least a factor of four.

Algorithm Step2 Choose a subgraph H by selecting each edge independently with probability ½. Apply the algorithm recursively to H, producing a minimum spanning forest F of H. Find all the F-heavy edges and delete them from the contracted graph.

Algorithm Step3 Apply the algorithm recursively to the remaining graph to compute a spanning forest F’. Return those edges contracted in Step1 together with the edges of F’.

G H Boruvka × 2 G*G* Original Problem G’G’ Right Sub- problem Return minimum forest F of H Delete F-heavy edges from G* Left Sub- problem F’ Sample with p=0.5

Correctness By the cut property, every edge contracted during Step1 is in the MSF. By the cycle property, the edges deleted in Step2 do NOT belong to the MSF. By the induction hypothesis, the MSF of the remaining graph is correctly determined in the recursive call of Step3.

Candidate Edge of MST The expected number of F-light edges in G is at most n/p (negative binomial) For every sample graph H, the expected candidate edge for MST in G is at most n/p (F- light edge)

Random-sampling To help discard some edge that cannot be in the minimum spanning tree Construct the sample graph H ◦ Process the edges in increasing order ◦ To process an edge e ◦ 1. Test whether both endpoints of e in same component ◦ 2. Include the edge in H with probability p ◦ 3. If e is in H and is F-light, add e to the Forest F

Random-sampling CE D F AG B 7 CE D F AG B 7 GH F W(E,G)=14 W F (E,G)=max{5,6,9,13} F-heavy W(E,F)=11 W F (E,F)=max{5,6,9} F-heavy W(D,F)=9 W F (D,F)=9 F-light W(A,B)=7 W F (A,B)= ∞ F-light

Random-sampling CE D F AG B 7 G F 1.Increasing Order 2.If F-light Throw If Select 3.Else Throw Don’t select 1.Random select edges to H 2.Find F of H CE D F AG B 7 G

No F-heavy edge can be in the minimum spanning forest of G (cycle property) F-light edge can be the candidate edge for the minimum spanning tree of G The forest F produced is the forest that would be produced by Kruskal and inlcude all possible MSF of G Observation

Observation The size of F is at most n-1 The expected number of F-light edges in G is at most n/p (negative binomial) Mean k = Expected n =

Outline Introduction Basic Property & Definition Algorithm Analysis

Analysis of the Algorithm The worst case. The expectations running time. The probability of the expectations running time.

Running time Analysis Total running time= running time in each steps. Step(1): 2 steps Boruvka’s algorithm Step(2):Dixon-Rauch-Tarjan verification algorithm. All takes linear time to the number of edges. ◦ Estimate the total number of edges.

Observe the recursion tree G=(V,E) |V| = n, |E|=m. ◦ m ≧ n/2 since there is no isolate vertices. Each problem generates at most 2 subproblems. ◦ At depth d, there is at most 2 d nodes. ◦ Each node in depth d has at most n/4 d vertices. The depth d is at most log 4 n. ◦ There are at most vertices in all subproblems

The worst case Theorem 4.1 The worst-case running time of the minimum-spanning-forest algorithm is O(min{n 2,m log n}), the same as the bound for Boruvka’s algorithm. Proof: There is two different estimate ways. 1.A subproblem at depth contains at most (n/4 d ) 2 /2 edges.  Total edges in all subproblems is:

The worst case 2. Consider a subprolbem G=(V,E) after step(1), we have a G ’ =(V ’,E ’ ),|E ’ | ≦ |E| - |V|/2, |V ’ | ≦ |V|/4 Edges in left-child = |H| Edges in right-child ≦ |E ’ | - |H| + |F| so edges in two subproblem is less then: (|H|) + (|E ’ | - |H| + |F|) =|E ’ | +|F| ≦ |E|-|V|/2 + |V|/4 ≦ |E| The two sub problem at most contains |E| edges.

The worst case m edges

The worst case The depth is at most log 4 n and each level has at most m edges, so there are at most (m log n) edges. The worst-case running time of the minimum- spanning-forest algorithm is O(min{n 2,m log n}).

Analysis of the Algorithm The worst case. The expectations running time. The probability of the expectations running time.

Analysis – Average Case (1/8) Theorem: the expected running time of the minimum spanning forest algorithm is O(m) ◦ Calculating the expected total number of edges for all left path problems Original Problem Left Sub-problem Right Sub-problem Left Subsub-problemRight Subsub-problem

Analysis – Average Case (2/8) Calculating the expected total edge number for one left path started at one problem with m’ edges Evaluating the total edge number for all right sub-problems # of edges = m’ Expected total edge number ≤ 2m’

Analysis – Average Case (3/8) G HG’G’ Boruvka × 2 G*G* Sample with p= E[edge number of H] = 0.5 × edge number of G* Original Problem Left Sub-problem Right Sub-problem 2. ∵ Boruvka × 2 ∴ edge number of G* ≤ edge number of G E[edge number of H] ≤ 0.5 × edge number of G Calculating the expected total edge number for one left path started at one problem with m’ edges

Analysis – Average Case (4/8) G HG’G’ Boruvka × 2 G*G* Sample with p=0.5 Original Problem Left Sub-problem Right Sub-problem E[edge number of H] ≤ 0.5 × edge number of G Calculating the expected total edge number for one left path started at one problem with m’ edges # of edges = m’ # of edges ≤ 0.5 × m’ Expected total edge number ≤ = 2m’

Analysis – Average Case (5/8) Calculating the expected total edge number for one left path L started at one problem with m’ edges ◦ Expected total edge number on L ≤ 2m’ Evaluating the total edge number of all right sub-problems E[total edges of all right sub-problem] ≤ n K.O.

Analysis – Average Case (6/8) G HG’G’ Original Problem Left Sub-problem Right Sub-problem 1. ∵ Boruvka × 2 ∴ vertex number of G* ≤ 0.25 × vertex number of G E[edge number of G’] ≤ 0.5×vertex number of G Evaluating the total edge number for all right sub- problems ◦ To prove : E[total edges of all right sub-problem] ≤ n Boruvka × 2 G*G* Sample with p=0.5 Return minimum forest F of H Delete F-heavy edges from G* 2. Based on lemma 2.1: E[edge number of G’] ≤ 2 × vertex number of G*

Analysis – Average Case (7/8) E[edge number of G’] ≤ 0.5×vertex number of G Evaluating the total edge number for all right sub- problems ◦ To prove : E[total edges of all right sub-problem] ≤ n G HG’G’ Original Problem Left Sub-problem Right Sub-problem Boruvka × 2 G*G* Sample with p=0.5 # of vertices of sub- problems ≤ 2×n/4 # of vertices of sub- problems ≤ 4×n/4 2 # of vertices of sub- problems ≤ 8×n/4 3 # of vertices of sub- problems ≤ 16×n/4 4 # of edges of right sub-problems ≤ n/2 # of edges of right sub-problems ≤ 2×n/8 # of vertices of original- problems=n # of edges of right sub- problems ≤ 4×n/(4 2 ×2) # of edges of right sub- problems ≤ 8×n/(4 3 ×2) = n

Analysis – Average Case (8/9) Evaluating the total edge number for all right sub- problems ◦ E[total vertices of all right sub-problem] ≤ n/2 ◦ To prove: E[processed edges of one sub-problem] ≤ 2 × vertex number of this sub-problem G HG’G’ Boruvka × 2 G*G* Sample with p= E[processed edges of G] = E[most trial] = vertex number of G* / 0.5 Original Problem Left Sub-problem Right Sub-problem 2. vertex number of G* ≤ vetex number of G E[processed edges of G] ≤ 2 × vertex number of G E[# of processed edges of all right sub-problems] ≤ n

Analysis – Average Case (8/8) Calculating the expected total edge number for one left path started at one problem with m’ edges ◦ Expected total edge number for one left path ≤ 2m’ Evaluating the total edge number for all right sub- problems ◦ E[total edges of all right sub-problem] ≤ n # of edges = m’ Expected total edge number ≤ 2m’ E[processed edges in the original problem and all sub-problems] =2×(m+n)

Analysis of the Algorithm The worst case. The expectations running time. The probability of the expectations running time.

The Probability of Linearity Theorem 4.3 ◦ The minimum spanning forest algorithm runs in Ο (m) time with probability 1 – exp(- Ω (m))

The Probability of Linearity Chernoff Bound: Given x i as i.d.d. random variables and 0 0, we have Thus, the probability that less than s successes (each with chance p) within k trials is

The Probability of Linearity Right Subproblems ◦ At most the number of vertices in all right subproblems: n/2 ( proved by theorem 4.2 ) ◦ n/2 is the upper bound on the total number of heads in nickel-flips

Right Subproblems The probability ◦ It occurs fewer than n/2 heads in a sequence of 3m nickel-tosses m + n ≦ 3m since n/2 ≦ m The probability is exp (- Ω (m)) by a Chernoff bound

The Probability of Linearity Left Subproblem ◦ Sequence: every sequence ends up with a tail, that is, HH…HHT ◦ The number of occurrences of tails is at most the number of sequences ◦ Assume that there are at most m’ edges in the root problem and in all right subproblems

Left Subproblems The probability ◦ It occurs m’ tails in a sequence of more than 3m’ coin-tosses The probability is exp (- Ω (m)) by a Chernoff bound

The Probability of Linearity Combining Right & Left Subproblems ◦ The total number of edges is Ο (m) with a high-probability bound 1 – exp(- Ω (m))