mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
Merge branch 'joel_graph' of https://github.com/joelkurien/Python into joel_graph
This commit is contained in:
commit
81fb07bf82
|
@ -159,10 +159,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…
Reference in New Issue
Block a user