Presentation is loading. Please wait.

Presentation is loading. Please wait.

15.082 and 6.855J Spanning Tree Algorithms. 2 The Greedy Algorithm in Action 1 2 3 4 5 6 7 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7.

Similar presentations


Presentation on theme: "15.082 and 6.855J Spanning Tree Algorithms. 2 The Greedy Algorithm in Action 1 2 3 4 5 6 7 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7."— Presentation transcript:

1 15.082 and 6.855J Spanning Tree Algorithms

2 2 The Greedy Algorithm in Action 1 2 3 4 5 6 7 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7

3 3 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7

4 4 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7

5 5 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7

6 6 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7

7 7 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7

8 8 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7

9 9 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7

10 10 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7

11 11 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7

12 12 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7

13 13 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7

14 14 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7

15 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 Node 1 2 3 4 5 6 7 First 1 2 3 4 5 4 7 35 10 30 15 25 40 20 17 8 15 11 21 1 2 357 root node 46 6 15

16 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 Node 1 2 3 4 5 6 7 First 1 4 3 4 5 4 7 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7 2 16

17 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 Node 1 2 3 4 5 6 7 First 1 4 3 4 5 4 5 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7 7 17

18 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 Node 1 2 3 4 5 6 7 First 1 4 5 4 5 4 5 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7 73 18

19 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 Node 1 2 3 4 5 6 7 First 1 4 4 4 4 4 4 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7 5 73 573 19

20 The Greedy Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 Node 1 2 3 4 5 6 7 First 4 4 4 4 4 4 4 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7 57 3 1 20

21 21 Prims Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 4 5 6 7 1 2 3 The minimum cost arc from yellow nodes to green nodes can be found by placing arc values in a priority queue.

22 22 Prims Algorithm in Action 1 3 35 4 5 30 15 25 40 20 6 7 17 8 15 11 21 4 5 6 7 1 35 2 2 10 25 10 2 3

23 23 20 Prims Algorithm in Action 1 3 35 4 5 15 25 40 6 7 17 15 11 1 35 2 2 10 25 10 24 8 21 30 8 20 30 21 5 6 73 4

24 24 20 Prims Algorithm in Action 1 3 35 4 5 15 25 40 6 7 17 15 11 1 35 2 2 10 25 10 24 8 21 30 8 20 30 21 6 8 17 15 573 64

25 25 20 Prims Algorithm in Action 1 3 35 4 5 15 25 40 6 7 17 15 11 1 35 2 2 10 25 10 24 8 21 30 8 20 30 21 6 8 17 15 64 5 11 735

26 26 20 Prims Algorithm in Action 1 3 35 4 5 15 25 40 6 7 17 15 11 1 35 2 2 10 25 10 24 8 21 30 8 20 30 21 6 8 17 15 64 5 11 735

27 27 20 Prims Algorithm in Action 1 3 35 4 5 15 25 40 6 7 17 15 11 1 35 2 2 10 25 10 24 8 21 30 8 20 30 21 6 8 17 15 64 5 11 375 7

28 28 20 Prims Algorithm in Action 1 3 35 4 5 15 25 40 6 7 17 15 11 1 35 2 2 10 25 10 24 8 21 30 8 20 30 21 6 8 17 15 64 5 11 7 735 15 3

29 29 20 Prims Algorithm in Action 1 3 35 4 5 15 25 40 6 7 17 15 11 1 35 2 2 10 25 10 24 8 21 30 8 20 30 21 6 8 17 15 64 5 11 7 735 15 3

30 30 20 Prims Algorithm in Action 1 3 35 4 5 15 25 40 6 7 17 15 11 1 35 2 2 10 25 10 24 8 21 30 8 20 30 21 6 8 17 15 64 5 11 7 735 15 3

31 31 Sollins Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 Treat all nodes as singleton components, and then select the min cost arc leaving the component. 4 5 6 7 1 2 3 4 5 6 7 1 2 3

32 32 Sollins Algorithm in Action 1 2 3 35 10 4 5 30 15 25 40 20 6 7 17 8 15 11 21 Find the min cost edge out of each component 4 5 6 7 1 2 3735 6


Download ppt "15.082 and 6.855J Spanning Tree Algorithms. 2 The Greedy Algorithm in Action 1 2 3 4 5 6 7 35 10 30 15 25 40 20 17 8 15 11 21 1 2 3 4 5 6 7."

Similar presentations


Ads by Google