Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know, what heuristic function is used in a*?

May i change that heuristic in a* ? and how i change it?

Here some heuristic, Euclidean distance, Manhattan distance, Maximum distance

Thanks :)

share|improve this question
up vote 1 down vote accepted

If you are talking about pgRouting, by default I think it is (|dx|+|dy|)/2 . See the source code in the link:

PgRouting source

You can easily change the heuristic function but then you would probably have to recompile the pgRouting.

share|improve this answer
Thanks for ur answer..:) Hwo to change and compile it? I want to try use euclidean distance heuristic, may u give me tutorial how to change the heuristic and recompile it? :) – robi_blitzx Jul 6 '12 at 7:24
it depends on the OS, but you can look at this link maybe it will help you to get started – Mario Miler Jul 6 '12 at 8:04
My os is windows 7. i did open the link, but i don't get idea how to change it..hmm I'll try to find how to change it..if i get some news, i'll text you here..:) If you have some news, text me in here.. hehehe, thanks mr. Mario.. – robi_blitzx Jul 6 '12 at 22:34
Fyi, a* already use ecludian function, it was used in astar_sp function. Info from mailing list pgrouting. tq :) – robi_blitzx Jul 12 '12 at 4:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.