Recall & Review
beginner
What is the main purpose of the Bellman Ford algorithm?
It finds the shortest paths from a single source vertex to all other vertices in a weighted graph, even if some edge weights are negative.
Click to reveal answer
intermediate
How does Bellman Ford handle negative weight edges differently from Dijkstra's algorithm?
Bellman Ford can correctly process graphs with negative weight edges by relaxing edges multiple times, while Dijkstra's algorithm assumes all weights are non-negative and may fail with negative edges.
Click to reveal answer
beginner
What is the time complexity of the Bellman Ford algorithm?
The time complexity is O(V * E), where V is the number of vertices and E is the number of edges.
Click to reveal answer
intermediate
What does it mean if Bellman Ford detects a negative weight cycle?
It means there is a cycle in the graph where the total sum of edge weights is negative, causing infinite reduction of path cost, so shortest paths are undefined.
Click to reveal answer
beginner
How many times does Bellman Ford relax all edges in the graph?
It relaxes all edges exactly V-1 times, where V is the number of vertices, to ensure shortest paths are found.
Click to reveal answer
What is the first step in the Bellman Ford algorithm?
✗ Incorrect
Bellman Ford starts by setting the source distance to zero and all others to infinity.
How does Bellman Ford detect a negative weight cycle?
✗ Incorrect
If after V-1 relaxations, an edge can still be relaxed, a negative cycle exists.
What is the maximum number of times edges are relaxed in Bellman Ford?
✗ Incorrect
Edges are relaxed V-1 times to guarantee shortest paths.
Which of these graphs is Bellman Ford best suited for?
✗ Incorrect
Bellman Ford works well with negative weights but cannot produce shortest paths if negative cycles exist.
What happens if Bellman Ford finds a negative weight cycle?
✗ Incorrect
Negative cycles mean shortest paths cannot be defined, so the algorithm reports this.
Explain how the Bellman Ford algorithm finds shortest paths in graphs with negative weights.
Think about repeated edge relaxation and cycle detection.
You got /4 concepts.
Describe how Bellman Ford detects negative weight cycles and why this is important.
Focus on the final check after all relaxations.
You got /4 concepts.