3: Algorithms on graphs Flashcards

(5 cards)

1
Q

What is Kruskal’s?

A

Sort lengths, select smallest, check if forms cycle, if not add it.

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

What is Prim’s?

A

Choose any start vertex, select the smallest arc connected to the tree, repeat.

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

Learn Prim’s for tables!

A
  1. Choose start vertex.
  2. Delete the row in the matrix for that one.
  3. Number the column in the matrix for the chosen vertex.
  4. Put a ring around the lowest undeleted entry.
  5. The ringed entry becomes the next arc to be added.
  6. repeat 2,3,4,5 until all rows have been deleted.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Dijkstra’s for?

A

Shortest path from A to B!

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

What is Floyd’s for?

A

Shortest path from any vertex to another.

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