# Improving A* Heuristics with Landmarks

Original title: Improving Heuristics for A* Pathfinding

> Hacker News story 49079995 · language: en · submitted 2026-07-28
> Web version: https://zeli.app/story/49079995
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 339 · by [bobbiechen](<https://news.ycombinator.com/user?id=bobbiechen>) · 💬 39
[original](<https://www.redblobgames.com/pathfinding/heuristics/differential.html>) · [HN discussion](<https://news.ycombinator.com/item?id=49079995>)

## Summary

A* pathfinding can be sped up by improving the heuristic function, not just the priority queue or map representation. The key idea is to precompute distances to a set of landmarks and use the triangle inequality to derive a lower bound for any goal. This 'differential heuristic' works best when landmarks are placed strategically, often on the map's outer edges. Multiple landmarks, placed manually or automatically, can significantly reduce the search space. Implementation is simple: run Dijkstra's algorithm from each landmark and modify the heuristic to take the maximum of the base heuristic and the landmark-based bounds.

## Key quote

> It’s impractical to precalculate all costs to all locations, but if we’ve precalculated the costs to a specific location, we can use that to estimate the cost to a different location.

## HN discussion (39 comments)

### [simonw](<https://news.ycombinator.com/item?id=49227302>)

> \> I learned about this technique in 2007, then tried writing it up in 2015. I realized that I didn’t understand it enough to be able to explain it. I studied it off and on in 2016, 2018, 2019, 2022, 2024, and 2026. I abandoned and restarted this page many times. And by 2026 I think I understand it well enough to write this page.
>
> Outstanding.

### [mpmisko](<https://news.ycombinator.com/item?id=49231837>)

> There has been a lot of progress in this field in the research community. Two good papers:
>
> \* https://ojs.aaai.org/index.php/AAAI/article/view/11027
>
> \* https://arxiv.org/abs/2212.03978

### [Groxx](<https://news.ycombinator.com/item?id=49227264>)

> Red Blob Games has quite a few S-tier posts, highly recommend exploring further if this is at all interesting to you

### [tkocmathla](<https://news.ycombinator.com/item?id=49228761>)

> Incredible write-up, as usual. I still fondly remember discovering Red Blob Games' Hexagonal Grids [1] guide while building an implementation of the Tzaar board game [2]. The illustrations are enormously helpful!
>
> [1] https://www.redblobgames.com/grids/hexagons
>
> [2] https://boardgamegeek.com/boardgame/31999/tzaar

### [layer8](<https://news.ycombinator.com/item?id=49230463>)

> Finally an interesting article about AI!

---

## Cite

- Page: https://zeli.app/story/49079995
- Date: 2026-07-28
- Source: redblobgames.com (https://www.redblobgames.com/pathfinding/heuristics/differential.html)
- Hacker News: https://news.ycombinator.com/item?id=49079995

## Other languages

- zh: https://zeli.app/zh/story/49079995 · markdown: https://zeli.app/zh/story/49079995.md
- ja: https://zeli.app/ja/story/49079995 · markdown: https://zeli.app/ja/story/49079995.md
- ko: https://zeli.app/ko/story/49079995 · markdown: https://zeli.app/ko/story/49079995.md
- de: https://zeli.app/de/story/49079995 · markdown: https://zeli.app/de/story/49079995.md
- es: https://zeli.app/es/story/49079995 · markdown: https://zeli.app/es/story/49079995.md
