We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a4b7d12 commit 40d85d5Copy full SHA for 40d85d5
graphs/a_star.py
@@ -44,7 +44,7 @@ def search(grid, init, goal, cost, heuristic):
44
x = init[0]
45
y = init[1]
46
g = 0
47
- f = g + heuristic[init[0]][init[0]]
+ f = g + heuristic[x][y] # cost from starting cell to destination cell
48
cell = [[f, g, x, y]]
49
50
found = False # flag that is set when search is complete
0 commit comments