mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-17 14:58:10 +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:
|
for vertex1 in self.graph:
|
||||||
new_dist = self.dijkstra(vertex1)
|
new_dist = self.dijkstra(vertex1)
|
||||||
for vertex2 in self.graph:
|
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]
|
new_dist[vertex2] += hash_path[vertex2] - hash_path[vertex1]
|
||||||
for key in new_dist:
|
for key in new_dist:
|
||||||
if new_dist[key] == sys.maxsize-1:
|
if new_dist[key] == sys.maxsize - 1:
|
||||||
new_dist[key] = None
|
new_dist[key] = None
|
||||||
distances.append(new_dist)
|
distances.append(new_dist)
|
||||||
return distances
|
return distances
|
||||||
|
|
Loading…
Reference in New Issue
Block a user