others (#15) - Multiple from/to (#394) - Message List

Multiple from/to

Hi,

I'm developing an application, where I need to calculate the shortest path from multiple points to multiple points.

e.g. I have a list of points [1,2,3,4,5] and I need to find the shortest path from each point to each point. In this case, that gives me 5*4=20 different shortest paths I need to find.

Is there any possible way to do this faster than submitting a shortest path query for each unique from/to?

The problems arises, because I have a full road network of a country, with around 800.000 road segments. Each query takes around two seconds or so. The country is divided into around 8000 unique regions, and I need to find the shortest path from each region to all other regions. That gives around 64.000.000 different shortest paths. And that takes time, when I have to execute a new shortest path function for each route.

Any ideas?

  • Message #1720

    Hi,

    I think all-pair shortest path algorithm would work, but unfortunately it is not yet implemented. We have it in our plans, but I cant give you any schedule for this. If you are familiar with C/C++ and Boost Graph Library you can try to implement it yourself - take Floyd-Warshall algorithm implementation from Boost and just write C/C++ wrappers for pgRouting.

    Cheers, Anton.