Skip to content

Commit c27ed0c

Browse files
committed
fix: graphs/greedy_best_first typo
TheAlgorithms#8764
1 parent 6f21f76 commit c27ed0c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: graphs/greedy_best_first.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def calculate_heuristic(self) -> float:
4848
The heuristic here is the Manhattan Distance
4949
Could elaborate to offer more than one choice
5050
"""
51-
dy = abs(self.pos_x - self.goal_x)
52-
dx = abs(self.pos_y - self.goal_y)
51+
dx = abs(self.pos_x - self.goal_x)
52+
dy = abs(self.pos_y - self.goal_y)
5353
return dx + dy
5454

5555
def __lt__(self, other) -> bool:

0 commit comments

Comments
 (0)