Created
April 16, 2019 07:17
-
-
Save hmthanh/b276b2e46303fd3fbd9942433f29f7c8 to your computer and use it in GitHub Desktop.
Thuật toán FloyWarshall
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (int k = 0; k < length; k++) { | |
for (int i = 0; i < length; i++) { | |
for (int j = 0; j < length; j++) { | |
if (dist[i][j] > dist[i][k] + dist[k][j]) { | |
dist[i][j] = dist[i][k] + dist[k][j]; | |
path[i][j] = path[k][j]; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment