-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Routing in areas with little data is very slow #443
Comments
TL;DR: it's not trivial. To understand the problem (and fix it), it's good to know how MOTIS executes PreTrip queries (also called range query in the literature). A range query asks for all optimal connections within a departure interval 1. In contrast to the literature, we additionally require results to be not dominated by all journeys that start outside the interval (e.g. to not display a journey 10:00-17:00 if there's also 11:00-17:00 starting outside the interval). This is achieved by having an additional OnTrip (aka earliest arrival) search at "end of the interval" + 1. The results of this additional OnTrip request are only used to dominate non-optimal results from inside the interval but otherwise ignored. So the range query how we define it in MOTIS is "Give me all globally Pareto-optimal journeys that depart within interval [t1, t2]". Now, there's trick how to make range-queries fast. From the initial RAPTOR paper 2 Section 4.2 Range Queries: rRAPTOR:
This means, we can reuse all labels from later departure times if we iterate departures in the interval from late to early, starting with the first earliest arrival query at t2+1 as discussed before to eliminate journeys that are only locally Pareto-optimal but are dominated by journeys that depart outside the interval. As you might have noticed, the actual PreTrip request in MOTIS has even more parameters. Namely Now, we come closer to the actual problem: in your case the search goes from an area where you have a Pareto-optimal connection maybe every 8 hours (on average). The initial search interval is 2h and it gets extended by 1h in each (possible) direction. The default setting for Currently, the interval gets extended symmetrically, one hour in each direction. This has the big disadvantage that we need to reset all arrival labels - which is the main reason the search becomes so slow. The "trick" from the paper works as long as we search for earlier connections. In practice, only extending the interval to earlier (e.g. by setting Solutions:
Footnotes
|
Thank you for the detailed writeup! I'm not sure if I will be able to fix this myself, but from the few tests I made, setting I will try to make motis abort the query if the connection gets closed (by a reverse proxy timeout) and / or add a timeout to motis itself for now, so it's not possible to overload a public instance with such requests. |
I guess this will not be easy as a lot of code would be involved. You would need to pass something like a "stop token" to each operation. This token then needs to be checked regularly by the operation itself. So at least the |
Queries in some areas are very slow (as in, multiple minutes).
As far as I can tell, this happens when there is a lot less data at the destination than at the start.
Reproducible examples on europe.motis-project.org include
Is there possibly some threshold when motis stops searching for other connections, that is too high in such cases?
The text was updated successfully, but these errors were encountered: