![Page 1: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/1.jpg)
Minimum spanning tree
Prof Amir GevaEitan Netzer
![Page 2: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/2.jpg)
Definition
A sub group of edges from weighted graph G
• Spanning – reach all vertex• Minimal – the sum of its edges is the lowest of all spanning trees
• Uses – connect a network with while spending minimum money• Graph need to be connective
𝑤 (𝑇 )= ∑(𝑢 ,𝑣 )∈𝑇
𝑤 (𝑢 ,𝑣 )
![Page 3: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/3.jpg)
![Page 4: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/4.jpg)
Prim algorithm (1957)
• Greedy algorithm• Start with an empty list of vertex.• Choose starting vertex from G. Randomly or a given choice.• Add edge with minimal weight that not used yet to an un explored
vertex.• Continue until list of vertex contain all vertex in G.
Minimum edge weight data structure Time complexity (total)adjacency matrix, searching O(|V|2)binary heap and adjacency list O((|V| + |E|) log |V|) = O(|E| log |V|)Fibonacci heap and adjacency list O(|E| + |V| log |V|)
![Page 5: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/5.jpg)
Pseudo Code
![Page 6: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/6.jpg)
![Page 7: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/7.jpg)
![Page 8: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/8.jpg)
![Page 9: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/9.jpg)
![Page 10: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/10.jpg)
![Page 11: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/11.jpg)
![Page 12: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/12.jpg)
![Page 13: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/13.jpg)
![Page 14: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/14.jpg)
![Page 15: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/15.jpg)
![Page 16: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/16.jpg)
Kruskal's algorithm (1956)
• Greedy algorithm• Create a “forest” F a set of trees• Create a set S containing all edges of G• While S is not empty and F is not a spanning tree yet• Remove minimum edge from S• If edge connects to trees in F combine them• Else discard edge
![Page 17: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/17.jpg)
Pseudo Code
![Page 18: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/18.jpg)
![Page 19: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/19.jpg)
![Page 20: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/20.jpg)
![Page 21: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/21.jpg)
![Page 22: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/22.jpg)
![Page 23: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/23.jpg)
![Page 24: Minimum spanning tree Prof Amir Geva Eitan Netzer](https://reader037.vdocument.in/reader037/viewer/2022103023/56649db55503460f94aa6c7f/html5/thumbnails/24.jpg)