Advertisement

Oh please tell me I can't understand A*!!!

Started by February 19, 2003 12:02 PM
10 comments, last by mhadi 21 years, 8 months ago
Hi, What is A* and how do it work? (In plain english) What are its modifications!!!
Trying For The BestMhadi
Please do some research (recommended: google.com)

Until then, consume this link

http://www-cs-students.stanford.edu/~amitp/gameprog.html



2DNow - Yesteryears technology at your fingertips!
Advertisement
Before getting into A*, study a little of AI search in general..

Fire burn wisdom in me,
Wisdom set mind and spirit free,
Moonlight shows me the mysteries of life,
Winternight gives me clearsight and storms to fight.
Fire burn wisdom in me,Wisdom set mind and spirit free,Moonlight shows me the mysteries of life,Winternight gives me clearsight and storms to fight.
If he wanted to look it up on google, he''d have done that. People post here looking for tips in an easy to understand form from people who''ve struggled with similar problems.

Anyway, a basic explanation is as such:
A* is an algorithm for finding the least-cost path to a goal when multiple ways are possible.

To do so, one could keep track of the cost so far as one traverses a particular path. As you try to find the way to the goal, you choose the path so as to minimize the cost so far.

Else, you could try estimating the cost from where you currently are to the goal and work towards it, minimizing this cost.

A* is essentially a combination of the two. Both cost-so-far and estimated cost to the goal are calculated and added and then you work to minimize that SUM. That''s the gist of A*.

I hope that helps, but you would be advised to look into it further. Good luck.
is A* used in Economics?
This post will self-destruct in 5 seconds...Actually, it's just Benjamin Bunny doing his thing.
It can be used in any problem that can be represented as a graph ie a collection of nodes and edges.
Advertisement
quote: Original post by coldcut
If he wanted to look it up on google, he''d have done that. People post here looking for tips in an easy to understand form from people who''ve struggled with similar problems.

Thanks cold cut you find the basic problem

Can i find and A* algorithm?
i dont need code there is so much code i cant read any body''s code it give me a lot of headache

so please give me algorithm in plain english
e.g
pick source and goal destination
from source..........

Waiting for your quick reply
mhadi
Trying For The BestMhadi
To start A*, you need:

1 Source
1 Destination
1 Graph (or map depending on preferred representation) with transition costs
1 Function to underestimate cost to destination from any location

1) Start at the source and give it a permanent label of 0
2) For each point without a permanent label adjacent to the current point, assign a temporary label (replacing any previous ones for that point) with value: (current point''s finalised label + cost to travel directly to adjacent point + estimated cost to destination from the adjacent point) and direction back to the current point.
3) Find the temporary label with the smallest value, make it permanent, and that point the current point.
4) If the current point is not the destination, go back to step 2
5) By back-tracking from the destination through the directions on the labels, trace the lowest cost path.
quote: It can be used in any problem that can be represented as a graph ie a collection of nodes and edges.


Actually, it doesn''t have to be a graph like that, it can be used for any problem that has specific start/end points, though it is easier to implement the heuristic and node generating functions if it is a graph IMHO.
I was looking through my Programming Isometric Games in DX book yesterday and there is actually an "easy" implementation of the A* algorithm. Not having done any prior research, it still made a lot of sense to me. It has some pictures to go along with all the text, and is explained in a very simple way. Might want to check that book out if you''re interested (the rest has nothing to do with A*, but a good book nonetheless)
Peon

This topic is closed to new replies.

Advertisement