Advertisement
i_love_rao_khushboo

Untitled

Aug 15th, 2022
592
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. // running main logic of the algorithm
  2. for(int i = 0; i < n; i++) {
  3.     for(int j = 0; j < n; j++) {
  4.         for(int k = 0; k < n; k++) {
  5.             if(d[i][k] == INF or d[k][j] == INF) continue;
  6.             if(d[i][k] + d[k][j] < d[i][j]) {
  7.                 d[i][j] = d[i][k] + d[k][j];
  8.             }
  9.         }
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement