Divide-and-Conquer MST

Slides:



Advertisements
Similar presentations
Lecture 15. Graph Algorithms
Advertisements

University of Joensuu Dept. of Computer Science P.O. Box 111 FIN Joensuu Tel fax K-MST -based.
O(N 1.5 ) divide-and-conquer technique for Minimum Spanning Tree problem Step 1: Divide the graph into  N sub-graph by clustering. Step 2: Solve each.
Greedy Algorithms Pasi Fränti Greedy algorithm 1.Coin problem 2.Minimum spanning tree 3.Generalized knapsack problem 4.Traveling salesman problem.
Minimum Spanning Trees
Chapter 3 The Greedy Method 3.
7.3 Kruskal’s Algorithm. Kruskal’s Algorithm was developed by JOSEPH KRUSKAL.
Graph Algorithms: Minimum Spanning Tree We are given a weighted, undirected graph G = (V, E), with weight function w:
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)
Graphs & Graph Algorithms 2 Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Graphs & Graph Algorithms 2
Lecture 12 Minimum Spanning Tree. Motivating Example: Point to Multipoint Communication Single source, Multiple Destinations Broadcast – All nodes in.
Minimum Spanning Trees CIS 606 Spring Problem A town has a set of houses and a set of roads. A road connects 2 and only 2 houses. A road connecting.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
Graphs & Graph Algorithms 2 Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
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.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Graph Algorithms: Minimum.
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
Minimum Spanning Trees
Minimum Spanning Tree Given a weighted graph G = (V, E), generate a spanning tree T = (V, E’) such that the sum of the weights of all the edges is minimum.
Cut-based & divisive clustering Clustering algorithms: Part 2b Pasi Fränti Speech & Image Processing Unit School of Computing University of Eastern.
COSC 2007 Data Structures II Chapter 14 Graphs III.
Genetic Algorithm Using Iterative Shrinking for Solving Clustering Problems UNIVERSITY OF JOENSUU DEPARTMENT OF COMPUTER SCIENCE FINLAND Pasi Fränti and.
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.
Minimum Spanning Trees CS 146 Prof. Sin-Min Lee Regina Wang.
Union-Find  Application in Kruskal’s Algorithm  Optimizing Union and Find Methods.
Routing Topology Algorithms Mustafa Ozdal 1. Introduction How to connect nets with multiple terminals? Net topologies needed before point-to-point routing.
Prims Algorithm for finding a minimum spanning tree
Approximation Algorithms
Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block.
Kruskal’s Algorithm for Computing MSTs Section 9.2.
Agglomerative clustering (AC)
Minimum Spanning Trees
Chapter 9 : Graphs Part II (Minimum Spanning Trees)
Greedy function greedy { S <- S0 //Initialization
Minimum Spanning Tree Chapter 13.6.
Lecture 26 CSE 331 Nov 2, 2016.
Lecture 22 Minimum Spanning Tree
Short paths and spanning trees
Approximation Algorithms
Autumn 2016 Lecture 11 Minimum Spanning Trees (Part II)
Graph Algorithm.
Minimum Spanning Tree.
Minimum Spanning Trees
CS200: Algorithm Analysis
Visualizing Prim’s MST Algorithm Used to Trace the Algorithm in Class
Connected Components Minimum Spanning Tree
Minimum Spanning Tree.
Chapter 7: Greedy Algorithms
Graphs & Graph Algorithms 2
Autumn 2015 Lecture 11 Minimum Spanning Trees (Part II)
Lecture 26 CSE 331 Nov 1, 2017.
Unit-4: Dynamic Programming
Autumn 2015 Lecture 10 Minimum Spanning Trees
Graph Searching.
Mesh Network Design Backbone network design goals:
Lecture 27 CSE 331 Oct 31, 2014.
Lecture 28 CSE 331 Nov 7, 2012.
Lecture 27 CSE 331 Nov 2, 2010.
Richard Anderson Lecture 10 Minimum Spanning Trees
Resource Allocation in a Middleware for Streaming Data
CS 584 Project Write up Poster session for final Due on day of final
CSE 550 Computer Network Design
Minimum Spanning Trees (MSTs)
EMIS 8373: Integer Programming
Prim’s Minimum Spanning Tree Algorithm Neil Tang 4/1/2008
Prim’s algorithm for minimum spanning trees
CSE 332: Minimum Spanning Trees
Lecture 27 CSE 331 Nov 1, 2013.
Presentation transcript:

Divide-and-Conquer MST Pasi Fränti 27.10.2016

Minimum spanning tree Prim’s algorithm: N nodes and M links. Creates tree by adding links one-by-one Always shortest link that connects one new node Even best solutions lower limited byO(M) Time complexity for full graph O(N2) because M=N2. 5 8 1 3 2 6 10 4 7

Prim’s algorithm example 5 8 1 3 2 6 10 4 7

O(N 1.5) divide-and-conquer algorithm for Minimum Spanning Tree problem C. Zhong, M.I. Malinen, D. Miao and P. Fränti, "A fast minimum spanning tree algorithm based on K-means", Information Sciences 295, 1-17, February 2015. Step 1: Divide the graph into N clusters Step 2: Solve each cluster by Prim's algorithm Step 3: Merge the results of clusters: Create meta graph where one node per cluster Solve MST for the meta graph Combine MSTs of the meta graph and clusters

Example 8 5 5 5 3 6 1 2 6 8 2 4 5 5 10 1 7 3 3 Example by: Michiyo Ashida  (IMPIT’2010)

Step 1: Divide the graph into N sub-graph by clustering 8 5 5 5 3 6 1 2 6 8 2 4 5 5 10 1 7 3 3

Step 2: Solve each sub-problem by Prim’s algorithm 8 5 5 5 3 6 1 2 6 8 2 4 5 5 10 1 7 3 3

Step 3.1 (a): Select center point for each cluster 8 5 3 6 1 2 6 8 2 4 5 5 10 1 7 3 3

Step 3.1 (b): Connect the nodes of this meta graph 8 5 3 6 1 2 6 8 2 4 5 5 10 1 7 3 3

Step 3.1 (c): Set the weights based on shortest distances 8 5 1 3 6 1 2 6 8 2 3 4 4 5 5 10 1 7 3 3

Step 3.2: Solve MST for the meta graph 8 5 1 3 6 1 2 6 8 2 3 4 4 5 5 10 1 7 3 3

Step 3.3: Select the corresponding links 8 5 1 3 6 1 2 6 8 2 3 4 5 5 10 1 7 3 3

Step 3.3: Add links from the MST of the meta graph 8 5 3 6 1 2 6 8 2 4 5 5 10 1 7 3 3 Total weight = 21

Optimality of the solution? 8 Remove 5 3 6 1 2 6 8 2 4 5 5 10 1 7 3 Add 3 Better solution: Total weight = 20

Bigger example Clustering Dataset Clustering

Bigger example Creation of MST Cluster-level MST Connecting clusters

Time complexity Step 1 Step 2 Cluster to N sub-graphs: O(k∙N) = N∙N = N 1.5 Step 2 k=N sub-problems of size N /k = N /N 1/2 = N 1/2 = N Prim's for one: (N)2 = N For All sub-problems: N∙N = N 1.5 Step 3 Construct meta graph: (N)∙(N)2 = N 1.5 Solve meta graph: (N)2 = N Add links: N

Refinement stage Step 1: Calculate midpoints of links in the meta graph Step 2: Cluster based on midpoints Step 3: Solve each cluster by Prim's algorithm Step 4: Merge the 1st MST with the 2nd MST

Mid-points

Secondary clustering

Secondary MST within clusters 8 5 3 1 2 6 6 8 2 4 5 5 10 1 7 3 3

Secondary MST between clusters 8 5 3 1 2 6 6 8 2 4 5 5 10 1 7 3 3

Merge of 1st and 2nd MST 8 5 3 6 1 2 6 8 2 4 5 5 10 1 7 3 3

Final MST 8 5 3 6 1 2 6 8 2 4 5 5 10 1 7 3 3 Total weight = 20

Illustration with collinear partition

Experiments t4.8k Processing time Approximation error

Experiments ConfLongDemo Processing time Approximation error

Effect of cluster size n

Effect of cluster size n

Blank space for notes