I would like to know what is the difference between A* algorithm and Dijkstra at finding the shortest path at pgrouting.

Which one is faster ,has better performance and returns better results.

Also i would like to know if it is possible for pgrouting to take into account that a road is one way when it computes the shortest path thus not traversing it

Sorry for my english thanks in advance john


1 Answer 1


A* is a generalised form of the Dijkstra search algorith. There are good descriptions of both on Wikipedia (A*, Dijkstra) including nice graphical representations.

Essentially A* is faster, and will find the "best" solution given some reasonable assumptions. Dijkstra (i.e. A* without heuristic) is better conditioned. I usually choose Dijkstra until the problem space grows too large and I need something faster.

For the one-way question, just see the documentation on this aspect of pgRouting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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