Floyd-Warshall algorithm's complexity is O(n**3)