Please help me figure this out...

Started by
42 comments, last by GrayKnight2k 22 years, 8 months ago
quote:Original post by Timkin
Kylotan: A* is NOT defined as search involving an OPEN list and CLOSED list of branches in the search tree. That is merely an efficient data management method when implementing A*.

Hmm... I know that there doesn''t have to be List of open and closed nodes, but the A* algorithm requires the ability to know which nodes are awaiting traversal, and which nodes have already been traversed and at what cost, yes? Now I didn''t mean to imply that you would need a concrete data structure for both of these things: more that the algorithm needs to be able to determine which nodes are in which state. List in the abstract sense, not the concrete sense. Sorry for any confusion.

(For anyone who cares though, I''d use a priority queue for the open nodes and a hash table (implemented as a bitset) for the closed nodes.)

quote:Original post by MarkyD
Well, isn''t that the idea. I always thought that algorithms such as A* were ''basic'' algorithms. Whenever I make enemy AI for my games, I start the AI from scratch, so that I can base it more around my own game, and therefore make it better.

Yeah, but with all due respect, you''re not making your algorithm any better than what already exists. Algorithms tend to be extensively proven by mathematical experts, and are popular because they''re exceptionally good at what they do. A* is certainly not ''basic'' in the sense of being something than you can beat with just a little thought. Generally, if you think you can do better than A*, you''re in one of 2 situations: either you''re very good with algorithms and understand all the implications of your context, or you just don''t understand A* well enough. No ''alternative'' algorithm posted on this board in the last week has come close to being more efficient than A*, and I could prove that if needed, which is why I said what I said.
Advertisement
Then please prove it by helping me write it for my program...
quote:Original post by Kylotan

Hmm... I know that there doesn't have to be List of open and closed nodes, but the A* algorithm requires the ability to know which nodes are awaiting traversal, and which nodes have already been traversed and at what cost, yes?


Actually, no. Only the implementation, in general, requires that. The actual algorithm ONLY needs to know which node i has the lowest cost f(i) = g(i) + h(i). It then expands that node. How you deal with this is entirely implementation, rather than algorithm. 8^) Of course, I am being pedantic now, so I'll can it!

quote:Original post by MarkyD
Well, isn't that the idea. I always thought that algorithms such as A* were 'basic' algorithms. Whenever I make enemy AI for my games, I start the AI from scratch, so that I can base it more around my own game, and therefore make it better.


A* is, given the right conditions, an optimally efficient algorithm that guarantees to find the shortest path from start to goal (given the action set) and expend fewer nodes than any other search method while doing so. Why bother re-inventing the wheel, particularly if it is guaranteed to be worse than A*???

Cheers,

Timkin

Edited by - Timkin on August 20, 2001 12:15:41 AM
quote:Original post by GrayKnight2k
Then please prove it by helping me write it for my program...


GrayKnight2k: There are hundreds of websites dedicated to this sort of problem. You could trivially find code for A* by doing a google search.

Go for it!

Timkin

This topic is closed to new replies.

Advertisement