Home »
MCQs »
Algorithms MCQs
The Floyd-Warshall algorithm does not work correctly for graphs with ______.
32. The Floyd-Warshall algorithm does not work correctly for graphs with ______.
- Positive cycles
- Zero-weight edges
- Negative cycles
- Directed edges
Answer
The correct answer is: C) Negative cycles
Explanation
The Floyd-Warshall algorithm does not work correctly for graphs containing negative cycles, as the presence of such cycles can lead to incorrect shortest-path calculations.