Skip to content

Commit 00e8577

Browse files
committed
fix: add __eq__ in Node class
TheAlgorithms#8770
1 parent a2421f2 commit 00e8577

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

graphs/greedy_best_first.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ def calculate_heuristic(self) -> float:
8484
def __lt__(self, other) -> bool:
8585
return self.f_cost < other.f_cost
8686

87+
def __eq__(self, other):
88+
return self.pos == other.pos
89+
8790

8891
class GreedyBestFirst:
8992
"""

0 commit comments

Comments
 (0)