A* Pathfinding (grid) Playground

Rohim’s shortcut on the plot map of the big board: a real A* with a heap queue, g + h on every square, water you draw; Manhattan, the straight line, h = 0…

Why it matters

Pathfinding in games, robots, maps and route planning uses A*: the same result as Dijkstra for one goal, with far fewer checks. The usual mistakes: a heuristic too big (the path is no longer the shortest) and a heuristic that does not fit the way you step (Manhattan with diagonal steps).

The key idea

h must never exceed the real distance

Common mistakes

Try it in this playground