mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-30 22:23:42 +00:00
Modified the a_star [dot] py for making readable (#4576)
This commit is contained in:
parent
a4b7d12262
commit
40d85d5443
|
@ -44,7 +44,7 @@ def search(grid, init, goal, cost, heuristic):
|
|||
x = init[0]
|
||||
y = init[1]
|
||||
g = 0
|
||||
f = g + heuristic[init[0]][init[0]]
|
||||
f = g + heuristic[x][y] # cost from starting cell to destination cell
|
||||
cell = [[f, g, x, y]]
|
||||
|
||||
found = False # flag that is set when search is complete
|
||||
|
|
Loading…
Reference in New Issue
Block a user