Repository navigation
Add missing setup call - #2968
Conversation
|
I wonder if the timeout should be applied to each call of |
|
Currently we're sort of doing both? The visited nodes are reset on each call: IMHO we should reset all limits per run. Enforcing them over multiple passes should be up to the caller. |
|
I agree that the time limit should rather be used per call, because there might be unrelated things running in between the |
|
I'm currently using DijkstraOneToMany to compute a distance matrix. While CH-based routing would be an order of magnitude faster, it's unfortunately not an option for my use case, which involves more dynamic custom models. Global limits would have to scale with the number of destinations for which the algorithm instance is to be reused. The problem is that some destinations might simply not be reachable, and I don't want GraphHopper touching the whole graph to come to that conclusion. In the event that a limit is reached while calculating the path for a destination, I would still want to continue with the remaining destinations, which is not possible with a global limit in place. |
You mean if you are trying to calculate a path to node A which is only found at, say, weight=1000, and it isn't found because the limit is 100 for example you aren't able to find node B at weight 50? That shouldn't be of course. I think the way it should work is:
This algorithm is basically left over from a previous CH preparation algorithm, so it is quite possible that it doesn't fit more general usages. |
As long as paths for already discovered nodes are still returned even when the algorithm has reached one of its limits, it would be fine. |
|
Ok, but you are saying this is currently not the case? Anyway as far as I am concerned we can merge this PR. |
|
I think the current state is fine. |
While DijkstraOneToMany evaluates the timeout, it's missing the setup.