On this page
All lessons
Understanding AWA* (Anytime Weighted A*)
AWA* finds a valid path almost immediately, then keeps improving it. It multiplies the heuristic by a weight w > 1 to search aggressively — then continues to improve the solution over time until the lower and upper bounds cross, proving we have discovered an optimal solution.
Statistics
Draw your map above, then click Run A* to generate the step trace.
How AWA* works
Weighted heuristic. Standard A* uses f(n) = g(n) + h(n). AWA* uses f(n) = g(n) + w·h(n) where w > 1. This inflates the heuristic, making nodes closer to the goal look artificially cheaper — so search is faster but the result may cost up to w× the optimal.
Anytime guarantee. As search continues, you iteratively look to improve upon the existing best-solution.
Pruning. Once a solution of cost C exists, any OPEN node whose f-value ≥ C, enabling us to prune them from the search space.
Comparing AWA* to A*
Same grid, same start, same goal — two different strategies. AWA* (left) charges through expensive water using its inflated heuristic, finds a quick path, then keeps refining. A* (right) carefully weighs every option and routes around the water to find the optimal path in a single pass. Edit either grid to modify both simultaneously.
AWA* Statistics
A* Statistics
Modify the grids above, then click Run animation to compare both algorithms side by side.
Continue your Learning
Watch the full AWA* video for a deeper walkthrough of the algorithm and the intuition behind anytime search.
Read the original Anytime Weighted A* paper:
https://doi.org/10.1613/jair.2096Found this helpful?
These resources are free — if they saved you time, a coffee keeps them going.