MCPcopy Create free account
hub / github.com/geekcomputers/Python / priority

Method priority

8_puzzle.py:24–26  ·  view source on GitHub ↗

A* priority: moves + Manhattan distance.

(self)

Source from the content-addressed store, hash-verified

22 return self.priority() < other.priority()
23
24 def priority(self) -> int:
25 """A* priority: moves + Manhattan distance."""
26 return self.moves + self.manhattan()
27
28 def manhattan(self) -> int:
29 """Calculate Manhattan distance using actual goal positions."""

Callers 1

__lt__Method · 0.95

Calls 1

manhattanMethod · 0.95

Tested by

no test coverage detected