80 likes | 285 Views
Minimum Spanning Trees. By: Arya Soltanieh. MST. A minimum spanning tree connects all the nodes of a given graph An MST must have all of the following: Connected Undirected An MST can have the following: Weighted edges An undirected graph can have multiple MSTs, depending on:
E N D
Minimum Spanning Trees By: Arya Soltanieh
MST • A minimum spanning tree connects all the nodes of a given graph • An MST must have all of the following: • Connected • Undirected • An MST can have the following: • Weighted edges • An undirected graph can have multiple MSTs, depending on: • The algorithm being used • If you wish to have the MST with a specific starting node • If there are weighted edges AND all of the edges are distinct • the MST will be unique (only one MST)
Borůvka's algorithm • The first MST algorithm was designed by Boruvka in 1926 • The algorithm was used to create efficient connections between the electricity network in the Czech Republic • The algorithm is no longer used now that Prims and Kruskals Algorithms have been discovered
Prim’s Algorithm • Finds the MST for connected AND weighted graphs. • It was actually discovered in 1930 by Vojtech, but Prim ‘rediscovered’ it in 1957 • Prim’s starts at any given node, then finds the shortest path to any node it is connected to or that it has already established as within its shortest path subtree
Kruskal’s Algorithm • Finds the MST by taking the smallest weighted edge in the graph, connecting it, and repeating until all nodes are connected with NO cycles. • This is done by • creating a queue with all edges • finding the minimum weight route between two nodes IF a route does NOT exist • adding that edge to the tree • removing that edge from the queue