From 40d85d54433eccff19b4434c7073f2a7b6127426 Mon Sep 17 00:00:00 2001 From: Milton Chandro Bhowmick Date: Wed, 28 Jul 2021 16:50:21 +0600 Subject: [PATCH] Modified the a_star [dot] py for making readable (#4576) --- 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