Question 12
The Bellman-Ford algorithm cannot be used if a graph has negative cycles. This is because:
The algorithm only runs for n iterations, where n is the number of vertices.
The notion of the shortest path is not well-defined if there are negative cycles.
Dealing with negative cycles requires examining all paths exhaustively, which takes exponential time.
To handle negative cycles, we need to compute all-pairs shortest paths.