Presentation is loading. Please wait.

Presentation is loading. Please wait.

Divide-and-Conquer MST

Similar presentations


Presentation on theme: "Divide-and-Conquer MST"— Presentation transcript:

1 Divide-and-Conquer MST
Pasi Fränti

2 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

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

4 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

5 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)

6 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

7 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

8 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

9 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

10 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

11 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

12 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

13 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

14 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

15 Bigger example Clustering
Dataset Clustering

16 Bigger example Creation of MST
Cluster-level MST Connecting clusters

17 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

18 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

19 Mid-points

20 Secondary clustering

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

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

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

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

25 Illustration with collinear partition

26 Experiments t4.8k Processing time Approximation error

27 Experiments ConfLongDemo
Processing time Approximation error

28 Effect of cluster size n

29 Effect of cluster size n

30 Blank space for notes


Download ppt "Divide-and-Conquer MST"

Similar presentations


Ads by Google