![Page 1: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/1.jpg)
1
15.082 and 6.855J
Spanning Tree Algorithms
![Page 2: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/2.jpg)
2
The Greedy Algorithm in Action
1
2
3
4
5
6
7
35
10
30
15
25
40
20 17
8
15
11
211
2
3
4
5
6
7
![Page 3: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/3.jpg)
3
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
35
10
30
15
25
40
20 17
8
15
11
211
2
3
4
5
6
7
![Page 4: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/4.jpg)
4
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
35
10
30
15
25
40
20 17
8
15
11
211
2
3
4
5
6
7
![Page 5: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/5.jpg)
5
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
35
10
30
15
25
40
20 17
8
15
11
211
2
3
4
5
6
7
![Page 6: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/6.jpg)
6
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
35
10
30
15
25
40
20 17
8
15
11
211
2
3
4
5
6
7
![Page 7: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/7.jpg)
7
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
35
10
30
15
25
40
20 17
8
15
11
211
2
3
4
5
6
7
![Page 8: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/8.jpg)
8
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
35
10
30
15
25
40
20 17
8
15
11
211
2
3
4
5
6
7
![Page 9: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/9.jpg)
9
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
35
10
30
15
25
40
20 17
8
15
11
211
2
3
4
5
6
7
![Page 10: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/10.jpg)
10
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
35
10
30
15
25
40
20 17
8
15
11
211
2
3
4
5
6
7
![Page 11: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/11.jpg)
11
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
35
10
30
15
25
40
20 17
8
15
11
211
2
3
4
5
6
7
![Page 12: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/12.jpg)
12
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
35
10
30
15
25
40
20 17
8
15
11
211
2
3
4
5
6
7
![Page 13: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/13.jpg)
13
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
35
10
30
15
25
40
20 17
8
15
11
211
2
3
4
5
6
7
![Page 14: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/14.jpg)
14
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
35
10
30
15
25
40
20 17
8
15
11
211
2
3
4
5
6
7
![Page 15: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/15.jpg)
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
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
211
2
3 5 7
root node
4 66
15
![Page 16: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/16.jpg)
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
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
211
2
3
4
5
6
7
2
16
![Page 17: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/17.jpg)
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
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
211
2
3
4
5
6
77
17
![Page 18: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/18.jpg)
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
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
211
2
3
4
5
6
773
18
![Page 19: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/19.jpg)
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
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
211
2
3
4
5
6
75 73 5 73
19
![Page 20: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/20.jpg)
The Greedy Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
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
211
2
3
4
5
6
75 73
1
20
![Page 21: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/21.jpg)
21
Prim’s Algorithm in Action
1
2
3
35
104
5
30
15
25
40
20
6
7
17
8
15
1121
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.
![Page 22: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/22.jpg)
22
Prim’s Algorithm in Action
1
3
354
5
30
15
25
40
20
6
7
17
8
15
1121
4
5
6
7
1
3522
10
25
102
3
![Page 23: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/23.jpg)
23
20
Prim’s Algorithm in Action
1
3
354
515
25
40
6
7
17
15
11
1
3522
10
25
102 4
10 8
2130
8
20 3021
5
6
73
4
![Page 24: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/24.jpg)
24
20
Prim’s Algorithm in Action
1
3
354
515
25
40
6
7
17
15
11
1
3522
10
25
102 4
10 8
2130
8
20 3021
68
17
15
5 73
64
![Page 25: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/25.jpg)
25
20
Prim’s Algorithm in Action
1
3
354
515
25
40
6
7
17
15
11
1
3522
10
25
102 4
10 8
2130
8
20 3021
68
17
1564
15
515
1173 5
![Page 26: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/26.jpg)
26
20
Prim’s Algorithm in Action
1
3
354
515
25
40
6
7
17
15
11
1
3522
10
25
102 4
10 8
2130
8
20 3021
68
17
1564
15
515
1173 5
![Page 27: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/27.jpg)
27
20
Prim’s Algorithm in Action
1
3
354
515
25
40
6
7
17
15
11
1
3522
10
25
102 4
10 8
2130
8
20 3021
68
17
1564
15
515
113 75
117
![Page 28: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/28.jpg)
28
20
Prim’s Algorithm in Action
1
3
354
515
25
40
6
7
17
15
11
1
3522
10
25
102 4
10 8
2130
8
20 3021
68
17
1564
15
515
117
1173 5153
![Page 29: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/29.jpg)
29
20
Prim’s Algorithm in Action
1
3
354
515
25
40
6
7
17
15
11
1
3522
10
25
102 4
10 8
2130
8
20 3021
68
17
1564
15
515
117
1173 5153
![Page 30: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/30.jpg)
30
20
Prim’s Algorithm in Action
1
3
354
515
25
40
6
7
17
15
11
1
3522
10
25
102 4
10 8
2130
8
20 3021
68
17
1564
15
515
117
1173 5153
![Page 31: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/31.jpg)
31
Sollin’s Algorithm in Action
1
2
3
35
104
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
![Page 32: 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](https://reader036.vdocument.in/reader036/viewer/2022081602/5515032b55034693478b6628/html5/thumbnails/32.jpg)
32
Sollin’s Algorithm in Action
1
2
3
35
104
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
3 73 5
6