No need to check for infinity explicitly
Implement Floyd–Warshall algorithm