【模板】Floyd-Warshall

C++版本:

Floyd-Warshall

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]);
			}
		}
	}
}
posted @ 2020-09-13 18:28  pjhui  阅读(139)  评论(0编辑  收藏  举报