Skip to content

Commit 85124d0

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6584024 commit 85124d0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

graphs/dijkstra_2.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ def dijkstra(graph: List[List[float]], src: int) -> List[float]:
8787
visited[u] = True
8888

8989
for v in range(num_vertices):
90-
if not visited[v] and graph[u][v] != float("inf") and dist[u] + graph[u][v] < dist[v]:
90+
if (
91+
not visited[v]
92+
and graph[u][v] != float("inf")
93+
and dist[u] + graph[u][v] < dist[v]
94+
):
9195
dist[v] = dist[u] + graph[u][v]
9296

9397
return [int(d) if d != float("inf") else float("inf") for d in dist]

0 commit comments

Comments
 (0)