The A* algorithm is a specialization of best-first search.
It provides general guidelines with which to estimate goal
distances for general search graphs.
At each node along a path to the goal, the A * algorithm
generates all successor nodes and computes an estimate of
the distance (cost) from the start node to a goal node through
each of the successors. It then chooses the successor with
the short estimated distance for expansion. The successors
for this node are then generated, their distances estimated,
and the process continues until a goal is found or search
ends in failure.
The form of the heuristic estimation function for A* is
f*(n) = g*(n) + h*(n)
where the two components g*(n) and h*(n) are
estimates of the cost (or distance) from the start node to
node n and the cost from node n to a goal node,
respectively. The asterisks are used to designate estimates
of the corresponding true values f(n) = g(n) +
h(n). For state space tree problems g*(n) =
g(n) since there is only one path and the distance
g*(n) will be known to be the true minimum from the
start to the current node n. This is not true in general
for graphs, since alternate paths from the start node to n
may exist.
It is convenient to maintain two lists of node types designated
as open and closed. Nodes on the open list are nodes that
have been generated but not yet expanded while nodes on the
closed list are nodes that have been expanded and whose children
are, therefore, available to the search program. The steps
of A* algorithm are listed below:
1. Place the starting node s on open.
2. If open is empty, stop and return failure.
3. Remove from open the node n that has the smallest
value of f*(n). If the node is a goal node, return
success and stop. Otherwise,
4. Expand n, generating all of its successors n'
and place n on closed. For every successor n',
if n' is not already on open or closed attach a back-pointer
to n, compute f*(n') and place it on open.
5. Each n' that is already on open or closed should
be attached to back-pointers which reflect the lowest g*(n')
path. If n' was on closed and its pointer was changed,
remove it and place it on open.
6. Return to step 2.
|