From 23184249da1c4b38294fab4c9d46da960a124240 Mon Sep 17 00:00:00 2001 From: Milton Bhowmick Date: Tue, 27 Jul 2021 23:59:42 +0600 Subject: [PATCH] Modified the a_star [dot] py for making readable --- graphs/a_star.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphs/a_star.py b/graphs/a_star.py index cb5b2fcd1..d3657cb19 100644 --- a/graphs/a_star.py +++ b/graphs/a_star.py @@ -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