Chapters
Table of Contents

On this page

All lessons

Intro to Search
soon
Depth-First Search
soon
Breadth-First Search
soon
Dijkstra's Algorithm
soon
A* Algorithm
Weighted A* (WA*)current
Anytime Weighted A*

Playground

Playground
A* Algorithm

Weighted A*

Weighted A* (WA*) trades optimality for speed by inflating the heuristic with a weightw ≥ 1, producing paths that are at most w-times the optimal cost while dramatically reducing the nodes expanded.

Coming soon

The interactive visualiser and full lesson for Weighted A* are under construction. Check back soon!

The key idea

Standard A* uses f(n) = g(n) + h(n). Weighted A* instead evaluates f(n) = g(n) + w·h(n). When w = 1 you get classic A*; as w grows the search becomes more greedy, expanding fewer nodes at the cost of solution quality.

The bounded sub-optimality guarantee is the property that makes WA* useful in practice: you can choose exactly how much quality you are willing to sacrifice and get a hard upper bound in return.