A* and admissibility
◈ 3 cardsA* is best-first with f = g + h; an admissible heuristic (never overestimates) guarantees an optimal path, and BFS is A* with h = 0.
A* = best-first with f = g + h
Algorithm A is best-first search using the full evaluation function . When the heuristic obeys one extra condition, algorithm A becomes A\, and A\ comes with a guarantee.
Admissibility
A search algorithm is admissible if it is guaranteed to find a minimal-cost path whenever a path to the goal exists. The key result:
> A\* is admissible whenever for every state , where is the true minimal cost from to the goal.
In words: an admissible heuristic never overestimates the remaining cost. The intuition behind the proof: if ever overestimated, it could make the optimal path look more expensive than it is and the search might commit to a cheaper-looking but actually-worse path. Bounding from above by the true cost means no state on the optimal path is ever wrongly skipped.
Two consequences worth memorizing:
- BFS is A\* with . Zero never overestimates, so it is (trivially) admissible — which is exactly why BFS already finds shortest-in-moves paths. The power of A\* is using a non-trivial admissible to prune work without losing the guarantee.
- A\* with an informed expands a subset of the states BFS would expand — same optimal answer, less work.
Worked example (exam Q4: the best-first principle in A\*)
A road map S→{A,B} with S→A=2, A→G=4, S→D=1, D→E=1, E→G=8, and a straight-line-style heuristic . The two routes cost: S→A→G ; S→D→E→G .
A\* orders open by . From S it sees and . It expands the cheaper-looking A first, reaches G with , and never expands E because already exceeds the solution it found. Uniform-cost search () has no such foresight and expands the D-branch too. Result: A\* returns the optimal path S → A → G, cost 6, expanding 3 nodes where uniform-cost expands 5. That is the best-first heuristic principle: an admissible estimate lets you reach the cheapest goal while expanding strictly fewer states.