Advertisement

A* Algorithm h value determination

Started by January 03, 2003 11:42 PM
1 comment, last by 00702000744 21 years, 10 months ago
Hello to all: I have been working a bit on A* algorithm recently. The thing troubles me is the fact that h value determination in A* is so baffling yet vital. I mean you not only need to know how to assign h values, but also know how much to assign to. A little value off could mean a big shift in speed and cost. Does anyone have any idea on the general method of determining h value or is there any website that offers such kind of help? Thanks for help in advance
That''s the thing with heuristics, it''s really only trial and error. You got to just keep trying different algorithms until you find one which works.

If you''re working with a grid, then the best one is probably the manhatten algorithm: (x2 - x1) + (y2 - y1). You might think the straigh-line algorithm is better (sqrt( (x2 - x1)2 + (y2 - y1)2)) but that''s generally not the case... That''s just the nature of heuristics.

If I had my way, I''d have all of you shot! codeka.com - Just click it.

Advertisement
Can you tell us to which problem are you applying the A* algorithm?
It is impossible to find an heuristinc without knowing which problem you want to solve!

This topic is closed to new replies.

Advertisement