[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-10-28 03:07:05 +00:00
parent f9bf655086
commit 39fdc021ab

View File

@ -90,9 +90,11 @@ class JohnsonGraph:
vertex_b, vertex_b,
weight + hash_path[vertex_a] - hash_path[vertex_b], weight + hash_path[vertex_a] - hash_path[vertex_b],
) )
self.edges[i] = (vertex_a, self.edges[i] = (
vertex_b, vertex_a,
weight + hash_path[vertex_a] - hash_path[vertex_b]) vertex_b,
weight + hash_path[vertex_a] - hash_path[vertex_b],
)
self.graph.pop("#") self.graph.pop("#")
self.edges = [ self.edges = [
@ -118,7 +120,7 @@ class JohnsonGraph:
if vertex1 == vertex: if vertex1 == vertex:
filtered_neighbors.append((vertex2, node_weight)) filtered_neighbors.append((vertex2, node_weight))
self.graph[vertex] = filtered_neighbors self.graph[vertex] = filtered_neighbors
distances = [] distances = []
for vertex1 in self.graph: for vertex1 in self.graph:
new_dist = self.dijkstra(vertex1) new_dist = self.dijkstra(vertex1)