Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // running main logic of the algorithm
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < n; j++) {
- for(int k = 0; k < n; k++) {
- if(d[i][k] == INF or d[k][j] == INF) continue;
- if(d[i][k] + d[k][j] < d[i][j]) {
- d[i][j] = d[i][k] + d[k][j];
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement