algorithms on graphs Flashcards

1
Q

what’s a minimum spanning tree?

A

a spanning tree such that the total length of its arcs is as small as possible

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

describe the process for Kruskal’s algorithm

A
  1. sort arcs into ascending weight
  2. start with arc of lowest weight
  3. continue to add arcs of next lowest weight if it does not form a cycle
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

which algorithms can be used to find a minimum spanning tree?

A

Kruskal’s
Prim’s

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

describe Prim’s algorithm

A
  1. choose any vertex to start tree
  2. select an arc of least weight that joins a vertex already in the tree to a vertex not yet in the tree
  3. repeat 2
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is the difference between Prim’s and Kruskal’s agorithms?

A

Prim’s considers vertices
Kruskal’s considers edges

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

which algorithm adds arcs to vertices that must already be in the tree?

A

Prim’s

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

Which algorithm adds arcs to a MST in ascending order of weight?

A

Kruskal’s

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

Does Prim’s or Kruskal’s algorithm have a distance matrix version?

A

Prim’s

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

What does Dijkstra’s algorithm find?

A

the shortest path through a network from the start to another vertex

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

Is it possible to use Dijkstra’s algorithm on networks with directed arcs?

A

yes

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

Why might Floyd’s algorithm be more useful than Dijkstra’s?

A

Floyd’s’ can find the shortest path between ANY PAIR of vertices

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

what does Floyd’s algorithm find?

A

the shortest path between any pair of vertices in a network

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

which algorithm uses distance tables and route tables?

A

Floyd’s algorithm

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

how do you do Floyd’s algorithm?

A

complete distance tables and route tables and iterate these
a network with n vertices produces two tables as a result of n iterations

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

what do the tables in Floyd’s algorithm show?

A

one table shows the shortest distances
and the other contains information about the corresponding paths taken

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