780 likes | 1.96k Views
7.3 Kruskal’s Algorithm. Kruskal’s Algorithm was developed by JOSEPH KRUSKAL. Kruskal’s Algorithm. Pick the cheapest link (edge) available and mark it Pick the next cheapest link available and mark it again Continue picking and marking link that does not create the circuit
E N D
Kruskal’s Algorithm was developed by JOSEPH KRUSKAL
Kruskal’s Algorithm • Pick the cheapest link (edge) available and mark it • Pick the next cheapest link available and mark it again • Continue picking and marking link that does not create the circuit ***Kruskal’s algorithm is efficient and optimal
Apply Kruskal’s algorithm to find the minimum spanning tree 7 5 4 2 8 10 3 6
Apply Kruskal’s algorithm to find the minimum spanning tree 7 5 10 4 2 10 8 3 6 MST: 2+3+4+5+10=24
Apply Kruskal’s algorithm to find the minimum spanning tree D B H W P
This is an isosceles triangle so there must be two equal edges Apply Kruskal’s Algorithm: Since we know that length AB is always longer than the other two edges, so we pick: 212 mi and 212 mi. MST = 424 mi Find the length of the shortest network connecting the three cities A, B, C shown in each figure. C A B 250 mi 300 mi 25° 25° 37° 212 mi A 212 mi B C Apply Kruskal’s Algorithm: Since we know that length AB is always longer than the other two edges, so we pick: 250 mi and 300 mi. MST = 550 mi