标签:
这是无向图的
void Floyd() { memset(v, 0x3f, sizeof v); for(int i = 1; i <= n; i++) for(int j = 1; j <= n; j++) v[i][j] = map[i][j]; for(int k = 1; k <= n; k++) for(int i = 1; i <= n; i++) for(int j = 1; j <= n; j++) v[i][j] = v[j][i] =min(v[i][j], v[i][k]+v[k][j]); }
标签:
原文地址:http://www.cnblogs.com/ZP-Better/p/4714824.html