L9 - MST and Prims Flashcards

1
Q

Define a Path, Cycle and a Tree…

A

Path - Any sequence of vertices through the graph.
Cycle - A path that returns to its starting point.
Tree - A graph that contains no cycles.

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

Define a spanning tree… What is their main property?

A

A path that touches all vertices and edges within the tree.

Contains no cycles.

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

Is there only 1 spanning tree?

A

No, there can be multiple.

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

Define the minimum spanning tree…

A

The spanning tree with the lowest weight or distance.

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

What is the input-output relation for MST’s?

A

For all input edges, find the minimum weight edges connected unvisited vertices.

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

Who conceptualised MST’s, and what was the reason?

A

Boruvka.

Designed for efficient electrical distribution networks.

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

What is a common algorithm used for finding MST?

A

Prims.

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

What are the 3 steps of Prims algorithm?

A
  1. Choose a random vertex A in the tree.
  2. Add lowest cost edge to some next vertex B.
  3. Repeat until all vertices have been visited.

** At each vertex, find the next lowest weight across the whole tree.

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

What is the time complexity of Prims?

A
  • Quadratic complexity - O( V^2 )
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Give proof of the time complexity of O( V^2 )

A

Outer loop is V - 1
For each iteration i, computer (V - i) and (V - i - 1)

V ( 2 ( V - i ) - 1 ) = O( V^2 )

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