MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / consistent_heuristic

Function consistent_heuristic

graphs/multi_heuristic_astar.py:59–63  ·  view source on GitHub ↗
(p: TPos, goal: TPos)

Source from the content-addressed store, hash-verified

57
58
59def consistent_heuristic(p: TPos, goal: TPos):
60 # euclidean distance
61 a = np.array(p)
62 b = np.array(goal)
63 return np.linalg.norm(a - b)
64
65
66def heuristic_2(p: TPos, goal: TPos):

Callers 1

heuristic_2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected