Home »
MCQs »
Algorithms MCQs
The Floyd-Warshall algorithm can handle graphs with which type of edge weights?
27. The Floyd-Warshall algorithm can handle graphs with which type of edge weights?
- Only positive edge weights
- Only negative edge weights
- Both positive and negative edge weights
- Only zero edge weights
Answer
The correct answer is: C) Both positive and negative edge weights
Explanation
The Floyd-Warshall algorithm can handle graphs with positive and negative edge weights but does not work correctly with graphs containing negative cycles.