Skip to content

Commit d12797d

Browse files
style: custom auto fix via local ruff
1 parent 6548ec1 commit d12797d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

graphs/a_star.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@
66
the actual distance from the start (g-score) and the estimated distance to
77
the goal (h-score) using the formula: f(n) = g(n) + h(n).
88
9-
Time Complexity: O(E log V) where E is the number of edges and V is the
9+
Time Complexity: O(E log V) where E is the number of edges and V is the
1010
number of vertices.
1111
Space Complexity: O(V) to store the graph structures and priority queue.
1212
"""
1313

14-
1514
from __future__ import annotations
1615

1716
import heapq
1817
import math
1918
from collections.abc import Callable
2019

21-
2220
# ==========================================
2321
# 1. Heuristic Functions
2422
# ==========================================
@@ -48,7 +46,9 @@ def a_star_grid(
4846
grid: list[list[float]],
4947
start: tuple[int, int],
5048
end: tuple[int, int],
51-
heuristic_func: Callable[[tuple[float, float], tuple[float, float]], float] = manhattan_distance,
49+
heuristic_func: Callable[
50+
[tuple[float, float], tuple[float, float]], float
51+
] = manhattan_distance,
5252
) -> list[tuple[int, int]] | None:
5353
"""
5454
Perform A* search on a 2D weighted grid using heapq.
@@ -151,4 +151,4 @@ def a_star_adjacency_list(
151151
if __name__ == "__main__":
152152
import doctest
153153

154-
doctest.testmod()
154+
doctest.testmod()

0 commit comments

Comments
 (0)