For PriorityQueue ordering: compare priorities.
(self, other: "PuzzleState")
| 18 | self.previous = previous # Previous state in solution path |
| 19 | |
| 20 | def __lt__(self, other: "PuzzleState") -> bool: |
| 21 | """For PriorityQueue ordering: compare priorities.""" |
| 22 | return self.priority() < other.priority() |
| 23 | |
| 24 | def priority(self) -> int: |
| 25 | """A* priority: moves + Manhattan distance.""" |