def floyd_warshall(self):
        for k in range(0, self.n):
            for i in range(0, self.n):
                for j in range(0, self.n):
                    self.dp[i][j] = min(self.dp[i][j], self.dp[i][k] + self.dp[k][j])