Tweak Floyd-Warshall