We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de19acb commit fb60756Copy full SHA for fb60756
1 file changed
searches/astar.py
@@ -82,9 +82,10 @@ def astar(
82
# Goal check: reconstruct the path by following parents backward
83
if current == goal:
84
path: list[Node] = []
85
- while current is not None:
86
- path.append(current)
87
- current = parent[current]
+ cur: Node | None = current
+ while cur is not None:
+ path.append(cur)
88
+ cur = parent[cur]
89
return path[::-1] # reverse to (start ... goal)
90
91
# Explore current's neighbors
0 commit comments