Shortest Routes II gives you q queries for shortest paths. If q is large, running Dijkstra for each query is too slow.
Instead, run Floyd-Warshall once in O(n3) to precompute all distances. Then answer each query in O(1) by indexing the dist array. Total time: O(n3+q). This beats O(q⋅nlogn) when q is large. The pattern is: expensive preprocessing, cheap queries. Recognize this pattern and you will know when to use Floyd-Warshall.
Space complexity is O(n2) for the data structures used.