mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-26 10:58:40 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
3d4acaaefb
commit
2fb5becc4d
@ -161,10 +161,10 @@ class JohnsonGraph:
|
||||
for vertex1 in self.graph:
|
||||
new_dist = self.dijkstra(vertex1)
|
||||
for vertex2 in self.graph:
|
||||
if new_dist[vertex2] < sys.maxsize-1:
|
||||
if new_dist[vertex2] < sys.maxsize - 1:
|
||||
new_dist[vertex2] += hash_path[vertex2] - hash_path[vertex1]
|
||||
for key in new_dist:
|
||||
if new_dist[key] == sys.maxsize-1:
|
||||
if new_dist[key] == sys.maxsize - 1:
|
||||
new_dist[key] = None
|
||||
distances.append(new_dist)
|
||||
return distances
|
||||
|
Loading…
x
Reference in New Issue
Block a user