MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / floy

Function floy

graphs/basic_graphs.py:259–269  ·  view source on GitHub ↗
(a_and_n)

Source from the content-addressed store, hash-verified

257
258
259def floy(a_and_n):
260 (a, n) = a_and_n
261 dist = list(a)
262 path = [[0] * n for i in range(n)]
263 for k in range(n):
264 for i in range(n):
265 for j in range(n):
266 if dist[i][j] > dist[i][k] + dist[k][j]:
267 dist[i][j] = dist[i][k] + dist[k][j]
268 path[i][k] = k
269 print(dist)
270
271
272"""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected