Newsgroups: comp.ai
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornell!travelers.mail.cornell.edu!news.kei.com!news.mathworks.com!news.duke.edu!news-feed-1.peachnet.edu!gatech!howland.reston.ans.net!pipex!sunic!ugle.unit.no!news.uit.no!hsn30_32.hsn.no!AST
From: AST@postman.hsn.no (Alf Steinbach)
Subject: Re: Help (A* as applied to shortest path problem)
Sender: news@news.uit.no (News admin.)
Message-ID: <AST.165.784322087@postman.hsn.no>
Date: Tue, 8 Nov 1994 19:14:47 GMT
Lines: 34
References: <39o8bl$lfe@utdallas.edu>
Organization: Nordland College

In article <39o8bl$lfe@utdallas.edu> shnayd@utdallas.edu writes:
>From: shnayd@utdallas.edu
>Subject: Help (A* as applied to shortest path problem)
>Date: 8 Nov 1994 10:17:57 -0600
>I am a computer science student at University of Texas at Dallas.
>My AI professor explained the A* search algorithm as applied to finding
>a shortest path, I did not really understand the algorithm.
>
>It seems to remind me of Dijkstra's algorithm, but not really.
>
>I would greatly appreciate the help (explanation of this algorithm)
>if possible with example.  Please explain the heuristic function used.
>
>Thank you, Michael.

Heuristic is really simple:  estimate the distance left to the goal (from
the node you're at at the moment).  Expand further from the node with the
least total distance (distance to node + estimated distance node to goal).  
Keep expanding until all nodes visited, or until you have reached the goal
and no node has a shorter total distance than the shortest to the goal.

If you underestimate, then your answer may be wrong (say, an estimate of 0!).
But if you *always* overestimate, then you are guaranteed to find the/a
shortest path with the first one reaching the goal (explain why!).

A* additionally deletes multiple paths to the same node.  This is easiest
done when you generate a path expansion  -  store path info with the nodes,
then check if there is already a path, if so, check if it's shorter, if not,
delete it.  Or you could do it the hard way, i.e. sorting all paths.

A very clear & easy explanation is given in "Artificial Intelligence" by
Patrick Henry Winston (Addison Wesley, some year or other).  This
explanation, however, is high-level, & does not consider efficiency of
implementation.  PHW is generally *very* clear.  Recommended!
