floyd-warshall implementation tested with 5 TCs