Bellman Ford Flashcards

1
Q

At most how many iterations are used in the Bellman Ford Algorithm?

A

At most N, where N is the number of nodes

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

When can we stop the Bellman Ford Algorithm?

A

When we have reached N iterations

Or

When the distances do not change between iterations

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

What is the complexity of the Bellman Ford Algorithm?

A

O( V * E )

The number of vertices times the number of edges

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

How can I detect a negative weight cycle using the Bellman Ford Algorithm?

A

If the estimation of the distances still changes in the V-th Round.

The algorithm is taking longer than V-1 iterations.

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