There was an error while loading. Please reload this page.
2 parents 5fe9e9b + 39fdc02 commit 3d4acaaCopy full SHA for 3d4acaa
1 file changed
graphs/johnson_graph.py
@@ -139,9 +139,11 @@ def johnson_algo(self) -> list[dict]:
139
vertex_b,
140
weight + hash_path[vertex_a] - hash_path[vertex_b],
141
)
142
- self.edges[i] = (vertex_a,
143
- vertex_b,
144
- weight + hash_path[vertex_a] - hash_path[vertex_b])
+ self.edges[i] = (
+ vertex_a,
+ vertex_b,
145
+ weight + hash_path[vertex_a] - hash_path[vertex_b],
146
+ )
147
148
self.graph.pop("#")
149
filtered_edges = []
@@ -154,7 +156,7 @@ def johnson_algo(self) -> list[dict]:
154
156
for vertex1, vertex2, node_weight in self.edges:
155
157
if vertex1 == vertex:
158
self.graph[vertex].append((vertex2, node_weight))
-
159
+
160
distances = []
161
for vertex1 in self.graph:
162
new_dist = self.dijkstra(vertex1)
0 commit comments