A Search Algorithm
Updated 2026-08-09
Summary
A star search is a best-first pathfinding algorithm that expands the node minimizing the sum of the cost already paid and a heuristic estimate of the remaining distance to the goal.
Definition
Introduced by Peter Hart, Nils Nilsson and Bertram Raphael, the algorithm finds a least-cost path by ranking frontier nodes with f(n) = g(n) + h(n), where g is the exact cost from the start and h is an admissible estimate of the cost to the goal. If h never overestimates the true remaining cost, the search is guaranteed to return an optimal path; with a consistent heuristic it never needs to reopen closed nodes. Setting h to zero reduces it to Dijkstra's algorithm, while weighting h more heavily trades optimality for speed.
Introduction
How to use
- Weight past and future: combine sunk cost with an estimate of remaining distance before choosing a move. - Guard the estimate: check that your forecast never overstates the work still ahead. - Tune the balance: shift weight between progress made and distance left as uncertainty changes.
Mechanism
The frontier is ordered by total estimated cost, so the algorithm always explores the most promising partial path first. Because the heuristic never overestimates, any path that has already exceeded the estimate to the goal can be safely abandoned, and the search avoids expanding the broad uniform regions that make blind search expensive. Optimality and speed both follow from that admissibility condition.
Practice
In progress 0/1Practice this model in one real situation:
Cases
- Video games run the algorithm on grid or navmesh maps for unit pathfinding, with heuristics like straight-line distance.
- GPS routing engines run variants over road graphs, using travel-time estimates as the heuristic.
- Career planning as a metaphor: weigh accumulated investment against an honest estimate of the distance to the goal.
Common pitfalls
- Using a heuristic that overestimates remaining cost, which makes the search fast but no longer guarantees the shortest path.
- Optimizing only g, the cost already paid, which produces timid incremental moves; optimizing only h, which produces wishful plans with no execution.
Sources
Source support: Explicit
References currently contain only Wikipedia links; primary sources still need review.
- en.wikipedia.orghttps://en.wikipedia.org/wiki/A*_search_algorithmverified
account_treeGenealogyexpand_more
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.
RELATED MODELS