Memra

A* and admissibility

◈ 3 cards

A* 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.

24118Sf=0+6=6Af=2+4=6Gf=6+0=6Df=1+9=10Eh=8A* expands 3 nodes here; uniform cost expands 5.
Edge labels are real costs, node plates are f = g + h. A* pops S, sees f(A) = 6 against f(D) = 10, commits to A, and reaches G at f = 6 — three expansions. D stays on open (its f already exceeds the solution) and E is never generated at all. Uniform-cost search, which is this same picture with every h set to 0, has no reason to prefer A and expands all five.
strategyopen ordered byneeds h ≤ h*?minimal-cost path?uniform cost / BFSg(n), with h = 0yes, triviallyyesgreedy best-firsth(n), g droppednot requiredno guaranteealgorithm Ag + h, any hnot requiredno guaranteeA*g + hyes, requiredyes, optimalA* is algorithm A plus the admissibility condition.
Only the last row carries a guarantee, and it buys it with one condition: h ≤ h*. Drop h and you are in row one — still optimal, but expanding far more; drop g and you are in row two, fast and unsafe. Algorithm A becomes A* the moment its heuristic is admissible.
NORMAL ~/memra/learn/comp-456/astar-and-admissibility utf-8 LF