void floyd() { for (int k = 1; k <= V; k++) { for (int i = 1; i <= V; i++) { for (int j = 1; j <= V; j++) { d[i][j] = min(d[i][j], d[i][k] + d[k][j]); } } } }