- Graph searching in problem solving typically leads to the problem of combinatorial complexity due to the proliferation of alternatives;
- Heuristic search is a technique that attempts to reduce the number of alternatives that must be generated and examined by the search algorithm;
- One way of using heuristic information is to estimate the cost of reaching the goal from a given node;
- The idea is to continue the search always from the most promising node in the candidate set - Best-First Search (A* algorithm);
- A best-first search can be derived as a refinement of a breadth-first search.
c(n, n')
is the cost of the arc from noden
to noden'
;- The heuristic estimator is a function
f
, such that for each noden
in the state space,f(n)
is an estimate of the cost of the cheapest path fromn
to a goal node; f(n) = 0
ifn
is a goal node;f(n) = g(n) + h(n)
, whereg(n)
is the cost of the cheapest path from the start node ton
, andh(n)
is the heuristic estimate of the cost of the cheapest path fromn
to a goal node;
g(n)
can be computed as the sum of the arc costs on the path from the start node ton
- this path is not necessarily the optimal path;h(n)
is typically a heuristic guess, based on the algorithm's general knowledge of the problem domain;
- The search process consists of a number of competing subprocesses, each of them exploring its own alternative path;
- Among all these competing processes, only one is active at any given time - the one with the lowest
f
value, that is, the one that is currently the most promising; - The remaining processes have to wait until the current process change its value of
f
to a value that is lower than the value off
of any of the other processes - the current process is then suspended and the process with the lowestf
value is activated.
An A* algorithm that uses a heuristic function
h
such that for all nodesn
in the state space,h(n) <= h*(n)
, whereh*(n)
is the true cost of the cheapest path fromn
to a goal node, is guaranteed to find an optimal solution.
- If
h(n) = 0
for all nodesn
, then the A* algorithm reduces to a breadth-first search, still guaranteeing an optimal solution, but without heuristic power.