Floyd-Warshall algorithm deployed, ignoring edges lighter than r