Alternative Routing Algorithm not retrieving all routes between two points

Hi All,

Testing alternative routes using Graphhopper 2.0 latest release.
Drawn multiple custom routes between two points in singapore near changi from (1.3507678, 103.961269) to 1.3471661, 103.9718394.
found only 3 routes between these two points.

Actually plotted more routes

calling local graphhopper service as below

our requirement is to get all multiple routes between two point, kindly help on this issue.

Appreciate your help

run following command to run graphhopper locally

  1. build
  2. java -Ddw.graphhopper.datareader.file=Route_ChangiV4.osm.pbf -jar web/target/graphhopper-web-2.0-SNAPSHOT.jar server config-example.yml

source code with all required file you can download from google drive

Please let me know if any information required

Thanks & Regards,

More routes plotted in osm file but graphhopper alternative algorithm not detecting all.

Appreciate your help

This is similar to: Fetch all alternatives path using Djikstra

Hi Easbar,

Our graph is small graph having multi routes. At any point of time we need 3 best paths. But at some places path having only 3 alternative paths, in that case we need to retrieve all paths. when i given max_paths 20 expecting to retrieve all paths in the graph between two points. Tested with changing values of max_share_factor, max_exploration_factor, min_plateau_factor and max_weight_factor, but only retrieved 4 paths. So plan is if retrieve all paths then we can choose best 3 from them. Is any way to retrieve all paths, please advise.

there is NetworkX library in link which you shared, it is a python library but graphhopper is in java, how to use that library in graphhopper code?
please advise

Like I said this is feature is not supported by GraphHopper. The alternative route calculation has a different goal and using it for your scenario is just a (not very well working) workaround.

Thanks for your reply Easbar.

able to retrieve all paths after minor changes in and enable edge routing with turn_cost true

Glad to hear you got it working. Would you mind sharing your changes or giving a few more details?

Thanks Easbar, (25.0 KB)

Please find attached file.
Played around this file and got all possible routes from starting point
And enabled edge based routing

But having another problem, when vehicle moving forward we need to show possible routes. One path is missing in below screenshot when vehicle move forward.
If we fix this one our problem will resolve.
Please help on this issue.
As per my understanding, if n possible routes are available, then n-1 alternative routes we should get.

Thanks & Regards,

1 Like


Now, this issue also resolved

This is graph is working as expected, but this is not our actual graph. For actual graph getting more duplicate paths, working on it.

Appreciate your help.

Thanks & Regards,

This issue is fixed :grinning: ,
Getting duplicate paths in actual graph because of duplicate segments drawn. After deleting duplicate segment from graph, getting all paths as expected.

Thank you.

Thanks & Regards,

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.