Skip to content

Commit 210d0af

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

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

searches/A_star_search.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ def trace_path(cell_details: List[List[Cell]], dest: Tuple[int, int]) -> None:
153153
>>> cell_details[1][1].parent_i = 0
154154
>>> cell_details[1][1].parent_j = 0
155155
>>> trace_path(cell_details, (1, 1))
156-
The Path is
157-
-> (0, 0) -> (1, 1)
156+
The Path is
157+
-> (0, 0) -> (1, 1)
158158
"""
159159
print("The Path is ")
160160
path = []
@@ -186,7 +186,9 @@ def trace_path(cell_details: List[List[Cell]], dest: Tuple[int, int]) -> None:
186186
# Implement the A* search algorithm
187187

188188

189-
def a_star_search(grid: List[List[int]], src: Tuple[int, int], dest: Tuple[int, int]) -> None:
189+
def a_star_search(
190+
grid: List[List[int]], src: Tuple[int, int], dest: Tuple[int, int]
191+
) -> None:
190192
"""
191193
Perform the A* search to find the shortest path from source to destination.
192194
@@ -206,8 +208,8 @@ def a_star_search(grid: List[List[int]], src: Tuple[int, int], dest: Tuple[int,
206208
... ]
207209
>>> a_star_search(grid, (0, 0), (2, 2))
208210
The destination cell is found
209-
The Path is
210-
-> (0, 0) -> (1, 1) -> (2, 2)
211+
The Path is
212+
-> (0, 0) -> (1, 1) -> (2, 2)
211213
>>> a_star_search(grid, (0, 0), (1, 1))
212214
Source or the destination is blocked
213215
"""
@@ -315,7 +317,7 @@ def a_star_search(grid: List[List[int]], src: Tuple[int, int], dest: Tuple[int,
315317
print("Failed to find the destination cell")
316318

317319

318-
# Driver Code
320+
# Driver Code
319321

320322
if __name__ == "__main__":
321323
"""
@@ -349,4 +351,3 @@ def a_star_search(grid: List[List[int]], src: Tuple[int, int], dest: Tuple[int,
349351

350352
# Run the A* search algorithm
351353
a_star_search(grid, src, dest)
352-

0 commit comments

Comments
 (0)