GraphHopper.com | Forum | GitHub | Maps | Blog

Building routes with alternative routes mode enabled takes too long


#1

When considering Graphhopper as a viable alternative to Google Maps, one may take into account alternative routes feature that Google Maps provides. Recent versions of Graphhopper seem to move forward to this feature.

Currently, if you build your route within some city, it works well and fast. But if you are looking for routes from, say, Moscow to Vladivostok, it may take up to 80 seconds to get a response from server. We can’t make our user wait too long, so as temporary solution we’re planning to disable alternative route feature when distance between route legs is too big.

Given all of the above, are you planning to optimize alternative route search algorithm?


#2

Hi, if you need alternative routes, you might want to contact me…:slight_smile:


#3

Yes, we have plans to improve this. A workaround might be to provide two weightings like FastestWeighting and ShortFastestWeighting. I recently needed a similar thing and have implemented it rather hacky here.

Additionally you could route first and do a second route with avoiding the already taken edges => AvoidEdgesWeighting

Hi, if you need alternative routes, you might want to contact me…:slight_smile:

@marpec it would be better if you answer questions in public that will actually help others too (e.g. I’m curious :slight_smile: ) or reply via private message.


#4

@karussell, thanks for your answer.

Why does it take up to 80 seconds, by the way?


#5

@marpec, what would you suggest?


#6

Of course, it depends on what you actually consider (definition) as an alternative route.
I agree with @karussell, this is the simplest and fastest option, especially if just a few alternatives (2 or 3) are enough.