Network algorithms 1. Minimum spanning trees Flashcards
What is a minimum connector or minimum spanning tree?
Starting with a given network, a minimum connector, or a minimum spanning tree, is the least weight connected graph which includes every vertex.
What are the 2 types of algorithm used to find a minimum spanning tree, and applied to what?
Kruskal’s algorithm applied to the network and Prim’s algorithm applied to the network or to the network table.
How can you use Kruskal’s algorithm to find a minimum connector in a network?
- Select the shortest edge in a network
- Select the next shortest edge which does not create a cycle
- Repeat step 2 until all vertices have been connected
How can you use Prim’s algorithm to find a minimum connector in a network?
- Start at any vertex
- Select the shortest edge connected to that vertex
- Select the shortest edge connected to any vertex not connected
- Repeat step 3 until all vertices have been connected
How do you use Prim’s algorithm in a tabular format?
Say you build a tree starting from F (will specify in question)
- Delete the row corresponding to F, mark column F with a (1)
- Look down column F and find smallest value not crossed out. Put box round it (say this is row D)
- Delete row D. Label column D with a 2
- Look down column D and find smallest value not crossed out. Put box round it (say this is row C)
-Delete row C …
Repeat until all vertices have been connected
What is the complexity of Kruskals and Prims algorithm?
Quadratic complexity for both - O(n^2)