14 Shortest Path More Flashcards

1
Q

Dijkstra’s algoirthm

A

Solves the single source shortest path problem in a weighted graph where all edge weights are non-negative.

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

Bellman-Ford Algorithm

A

Solves the single-source shortest path problem in a weighted graph with some negative edge weights as long as there are no negative weight cycles.

Can detect if there are any negative weight cycles in the graph.

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

Relaxation

A

Testing whether we can improve the shortest path to vertice v found so far by going through edge u.

If so, it lowers shortest path estimates and changes predecssors.

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

Bellman-Ford is designed for

A

Direct Graphs

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

If an undirect graph has no negative weight edges, Bellman-Ford will work, but . . .

A

Dijkstra’s algorithm will also work and will be faster.

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

Is it easier to find shortest path than in a directed acyclic graph that in a graph with cycles?

A

Yes.

Key idea that reduces time complexity is to consider vertices in topologically sorted order.

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

Longest path problem

A

Negate all weight and Find shortest path.
Negate Results
Complexity is O(V+E)

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

Both Dijkstra’s and Bellman ford algorithm are examples of

A

Dynamic Programming

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