Skip to content

Instantly share code, notes, and snippets.

@arknave
Created October 23, 2015 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arknave/0f6b69605230e998f8a1 to your computer and use it in GitHub Desktop.
Save arknave/0f6b69605230e998f8a1 to your computer and use it in GitHub Desktop.
// Assume N is the number of vertices
for (int k = 0; k < N; k++) {
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
dist[i][j] = min(dist[i][j],
dist[i][k] + dist[k][j]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment