Files
Algorithms-snippets/Graph Algorithm/Flloyd_Warshall.cpp
2024-04-10 15:36:18 +05:30

7 lines
166 B
C++

for(int k = 1 ; k <= n ; k++ ){
for(int i = 1 ; i <= n ; i++ ){
for(int j = 1 ; j <= n ; j++ ){
dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j]);
}
}
}