valhalla
valhalla copied to clipboard
Why does increasing loki radius end up giving sub-optimal routes?
I am trying to figure out how Loki radius value impacts route. As per the documentation, loki radius is used for coming up with a set of candidates. If there are no candidates within this distance it will return the closest candidate within reason. I can see that if I increase the radius I see additional PathLocations (I am assuming it means more candidates). However, as the radius increases, for some reason thor starts giving really sub-optimal and much longer routes. I even played with disabling "rank_candidates" flag but that did not help. Can anyone shed some light on why radius=0 gives good routes but as I start increasing the radius values, I am getting much worse routes? Any help on this will be greatly appreciated!
PS: I am using pedestrian costing and input locations (start/end) are pretty close by. Not sure if that is playing a part.
@kevinkreiser Any insights into this?
@abvhinash i think the best way for us to reason about this would be for you to give us an example. If you could show the result on a map with the radius set to 0 and a good result, and set the radius larger and show the bad result, it will make it much easier for us to think about what could be going wrong in your particular case. as you probably have realized this can be quite complex to choose a heuristic that works right for the bulk of cases so itd be good for us to see a case where it works poorly so we can think about why its happening. thanks!
Hi @kevinkreiser , Sincere apologies for my late response. I was tied up with a few other things and finally got a chance to create an example. Here it is: Start coordinate: -122.3351606, 47.6137100 Destination coordinate: -122.3350341, 47.6135995
With radius 10, here is the route: http://valhalla.github.io/demos/polyline/?unescape=false&polyline6=false#upraHvqtiVAE_%40kAMc%40Ys%40%40ELODIBABJbAdD
With radius 0, here is the route: http://valhalla.github.io/demos/polyline/?unescape=false&polyline6=false#spraHtqtiVJMFE
@abvhinash i dont have time to triage this right now but this certainly does look like a bug at first glance. ill set the label and come back to it when i have time. unless someone else beats me to it
@kevinkreiser This is the issue we chatted about during our call yesterday. Normally it is not an issue but if there is a reroute towards the end then someone could hit this.
this makes me think of something strange with trivial routes. I'll have a look at it later today!
This issue should be fixed with https://github.com/valhalla/valhalla/issues/3582
I think @liyinxiao is right, it was likely fixed with #3585. If you're still on this, could you try @abvhinash and close the issue if it's solved? Thx!