solve shortest path problem using floyd algorithm