mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 10:28:39 +00:00
Modified the a_star [dot] py for making readable
This commit is contained in:
parent
a4b7d12262
commit
23184249da
@ -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…
x
Reference in New Issue
Block a user