Why it matters
A* is workhorse pathfinding. Understanding shapes many search algorithms.
Advertisement
The architecture
Open set: PQ by f.
Closed set: visited.
Relax neighbors with new g.
Advertisement
How it works end to end
Heuristic h: distance estimate.
Manhattan for grids; Euclidean; landmarks.
Reconstruct path via parents.
Weighted A* (w * h) speed trade-off.