{
  "id": 327515,
  "title": "Improving Heuristics for A* Pathfinding",
  "url": "https://urgent.news/2026/07/28/improving-heuristics-for-a-pathfinding",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-07-28T06:04:42.000Z",
  "source": {
    "name": "Hacker News",
    "slug": "hacker-news",
    "url": "https://www.redblobgames.com/pathfinding/heuristics/differential.html"
  },
  "original_language": "en",
  "account": "In his guide to A* pathfinding algorithms, the author introduces a technique to enhance the efficiency of these algorithms by incorporating \"landmark nodes.\" By strategically placing landmark nodes, A* search can be accelerated by providing a heuristic that is more informed about the structure of the map.\n\nThe core idea behind landmark nodes is to calculate a \"perfect\" heuristic, which ideally knows the map structure and never points in the wrong direction. However, this perfect heuristic varies depending on the goal and start positions. To overcome this challenge, the author proposes using one or more landmark nodes to calculate a reusable heuristic that can be applied to multiple A* searches with different goals.\n\nThe article explains that by determining the path from the start to a specific landmark, we can also obtain the shortest path to any destination along this landmark path. This concept is demonstrated using a grid visualization, although landmark nodes can be applied to any graph structure.\n\nThe key to this technique lies in the triangle inequality, which states that the sum of two sides of a triangle is always greater than or equal to the third side. By adapting this inequality for directed graphs and precalculating the costs to a specific landmark, we can estimate the cost to reach other locations. This method avoids the impracticality of precalculating all costs and the excessive storage required for a perfect heuristic for every possible goal.\n\nThe author emphasizes that while the best placement of landmark nodes may vary depending on the specific project, a practical approach is to identify locations that are beneficial for multiple randomly chosen paths. By iteratively placing landmarks away from previously chosen ones, the algorithm can systematically improve pathfinding efficiency across various (start, goal) pairs.",
  "summary": null,
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}