I have used this great tutorial, and shortest part between two points works fine. My question is: How to calculate shortest path between multiple points?

  • 1
    Could you elaborate on your question. It's not clear what exactly you are looking for. Best include a sketch.
    – underdark
    Commented Sep 13, 2012 at 13:48
  • 1
    Check out this question that I asked before if it's any good to you
    – dassouki
    Commented Sep 13, 2012 at 14:06

2 Answers 2


there is a modified shortest_path which enables multiple destinations;

Take a look at https://github.com/pgRouting/pgrouting/wiki/One_to_many-Dijkstra---To-review or the forked pgrouting https://github.com/HSylvio/pgrouting

Hope it works as well for you as it does for me!


Assuming you have multiple start points and a single finish point, another approach may be using Cost Path command in Raster Calculator as follows:


Comparing paths with rivers, we can use "Inicial_points" = Headwaters, "Costs" = Digital Elevation Model and "Direction" = Flow Direction.

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.