We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ce00e0 commit d64df51Copy full SHA for d64df51
graphs/basic_graphs.py
@@ -286,16 +286,16 @@ def floyd_warshall(a_and_n):
286
"""
287
288
(a, n) = a_and_n
289
- dist = [row[:] for row in a] # create a deep copy of matrix a
+ dist = [row[:] for row in a] # create a deep copy of matrix a
290
path = [[0] * n for i in range(n)]
291
-
+
292
for k in range(n):
293
for i in range(n):
294
for j in range(n):
295
if dist[i][j] > dist[i][k] + dist[k][j]:
296
dist[i][j] = dist[i][k] + dist[k][j]
297
- path[i][k] = k # possible error
298
+ path[i][k] = k # possible error
299
print(dist)
300
301
0 commit comments