A* Search Algorithm
A* expands the node with smallest f = g + h. g is cost so far. h is a guess of cost to goal. If h never overestimates (admissible) and is consistent, A* finds an optimal path. Straight-line distance on a map is the classic admissible h.
If h = 0, A* becomes UCS. If h is wild and overestimates, you may get a fast but non-optimal route. Viva: write f=g+h, say admissible, give straight-line example.
A* Search Algorithm — output — S f= 7 / A f= 6 / B f= 6. Expand smallest f. Admissible h never overestimates.
f(n) = g(n) + h(n) pick smallest f admissible h → optimal
f=g+h + admissible heuristic example.