Floyd-Warshall is . This is acceptable when or so. If , becomes too large (over million operations). Consider Johnson's algorithm or sparse techniques. Floyd-Warshall shines for small to medium graphs or when you need all-pairs distances without complex code.
The simplicity makes it a good choice in competitive programming when is small. For production systems, measure carefully.
Space complexity is for the distance matrix.