An implementation of Floyd Warshall used to find cycles in a HW assignment