Merge branch 'joel_graph' of https://github.com/joelkurien/Python into joel_graph

This commit is contained in:
Joelkurien 2024-10-28 14:43:33 +11:00
commit 81fb07bf82

View File

@ -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