We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6f21f76 commit 3d1174cCopy full SHA for 3d1174c
graphs/greedy_best_first.py
@@ -48,8 +48,8 @@ def calculate_heuristic(self) -> float:
48
The heuristic here is the Manhattan Distance
49
Could elaborate to offer more than one choice
50
"""
51
- dy = abs(self.pos_x - self.goal_x)
52
- dx = abs(self.pos_y - self.goal_y)
+ dx = abs(self.pos_x - self.goal_x)
+ dy = abs(self.pos_y - self.goal_y)
53
return dx + dy
54
55
def __lt__(self, other) -> bool:
0 commit comments