fix: graphs/greedy_best_first typo (#8766)

#8764
This commit is contained in:
Juyoung Kim 2023-05-25 21:54:18 +09:00 committed by GitHub
parent cfbbfd9896
commit a17791d022
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,8 +58,8 @@ class Node:
The heuristic here is the Manhattan Distance
Could elaborate to offer more than one choice
"""
dy = abs(self.pos_x - self.goal_x)
dx = abs(self.pos_y - self.goal_y)
dx = abs(self.pos_x - self.goal_x)
dy = abs(self.pos_y - self.goal_y)
return dx + dy
def __lt__(self, other) -> bool: