Network algorithms 1. Minimum spanning trees Flashcards

1
Q

What is a minimum connector or minimum spanning tree?

A

Starting with a given network, a minimum connector, or a minimum spanning tree, is the least weight connected graph which includes every vertex.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the 2 types of algorithm used to find a minimum spanning tree, and applied to what?

A

Kruskal’s algorithm applied to the network and Prim’s algorithm applied to the network or to the network table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How can you use Kruskal’s algorithm to find a minimum connector in a network?

A
  1. Select the shortest edge in a network
  2. Select the next shortest edge which does not create a cycle
  3. Repeat step 2 until all vertices have been connected
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can you use Prim’s algorithm to find a minimum connector in a network?

A
  1. Start at any vertex
  2. Select the shortest edge connected to that vertex
  3. Select the shortest edge connected to any vertex not connected
  4. Repeat step 3 until all vertices have been connected
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you use Prim’s algorithm in a tabular format?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the complexity of Kruskals and Prims algorithm?

A

Quadratic complexity for both - O(n^2)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly