mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08: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]
|
x = init[0]
|
||||||
y = init[1]
|
y = init[1]
|
||||||
g = 0
|
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]]
|
cell = [[f, g, x, y]]
|
||||||
|
|
||||||
found = False # flag that is set when search is complete
|
found = False # flag that is set when search is complete
|
||||||
|
Loading…
Reference in New Issue
Block a user