mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-19 00:37:02 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
f9bf655086
commit
39fdc021ab
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user