From 48b0edd393a82f63cd2e12746e766afc85686c31 Mon Sep 17 00:00:00 2001 From: Milton Bhowmick Date: Tue, 27 Jul 2021 00:16:23 +0600 Subject: [PATCH] Modified for making the code 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 cb5b2fcd16e8..363c57ebcb5a 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