void Floyd(){
for(int i = 1; i <= n; ++i)
for(int j = 1; j <= n; ++j)
dis[i][j] = INF;
//加入边
for(int k = 1; k <= n; ++k) {
for(int i = 1; i <= n; ++i) {
for(int j = 1; j <= n; ++j) {
dis[i][j] = min(dis[i][j], dis[i][k] + dis[j][k]);
}
}
}
}
相关文章
- 03-31floyd(多源最短路算法)
- 03-31P1119 灾后重建(floyd进阶)
- 03-31POJ 1161 Walls【floyd 以面为点建图】
- 03-31Floyd算法
- 03-31图论——Floyd算法拓展及其动规本质
- 03-31树网的核-Floyd+宽搜
- 03-31Floyd : 传递闭包
- 03-31模板 - Floyd
- 03-31Sorting It All Out (拓扑排序+floyd)
- 03-31Floyd 相关算法总结