summaryrefslogtreecommitdiff
path: root/graph/floydWarshall.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'graph/floydWarshall.cpp')
-rw-r--r--graph/floydWarshall.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/graph/floydWarshall.cpp b/graph/floydWarshall.cpp
index 6b303bb..e9cd526 100644
--- a/graph/floydWarshall.cpp
+++ b/graph/floydWarshall.cpp
@@ -1,13 +1,9 @@
-// Laufzeit: O(|V|^3)
-// Initialisiere mat: mat[i][i] = 0, mat[i][j] = INF falls i & j nicht adjazent, Länge sonst.
+// Initialisiere mat: mat[i][i] = 0, mat[i][j] = INF falls i & j nicht
+// adjazent, Länge sonst. Laufzeit: O(|V|^3)
void floydWarshall() {
for (k = 0; k < MAX_V; k++) {
for (i = 0; i < MAX_V; i++) {
for (j = 0; j < MAX_V; j++) {
if (mat[i][k] != INF && mat[k][j] != INF && mat[i][k] + mat[k][j] < mat[i][j]) {
mat[i][j] = mat[i][k] + mat[k][j];
- }
- }
- }
- }
-}
+}}}}}