Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a17791d

Browse files
authoredMay 25, 2023
fix: graphs/greedy_best_first typo (TheAlgorithms#8766)
TheAlgorithms#8764
1 parent cfbbfd9 commit a17791d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎graphs/greedy_best_first.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def calculate_heuristic(self) -> float:
5858
The heuristic here is the Manhattan Distance
5959
Could elaborate to offer more than one choice
6060
"""
61-
dy = abs(self.pos_x - self.goal_x)
62-
dx = abs(self.pos_y - self.goal_y)
61+
dx = abs(self.pos_x - self.goal_x)
62+
dy = abs(self.pos_y - self.goal_y)
6363
return dx + dy
6464

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

0 commit comments

Comments
 (0)
Please sign in to comment.