-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Time-dependent routing #4449
Comments
If you really want to incorporate changing traffic lights into the route calculation you should give the new MLD pipeline a try. It's built specifically to allow for amazingly fast traffic updates: https://github.com/Project-OSRM/osrm-backend/wiki/Traffic
You need to adapt the pipeline here with how the wiki updates speeds and weights; the wiki is still on the old CH pipeline. Then you can run Without accurate speeds (read: only using the OSM data with the profiles) youre routes are probably inaccurate enough such that you won't see much benefit in incorporating red/green traffic lights. Historic and/or real-time traffic data helps immensely there. |
Thank you for the tips. Yes, I agree it would make most sense if we already use real-world travel times to adjust weights. The time it takes to cross roads without intersections can also be also quite significant compared to red lights. |
Updating weight according to current state of traffic lights is not enough. The route computation needs to take into account when a particular traffic light is reached, otherwise a route might be suggested that passes a traffic light that is green the moment the route is computed, but red when you actually reach it. The problem is similar to gates or ways that are open at particular times, and probably also to time-tables on public transport. Probably not possible with the current algorithms in OSRM? I'm renaming this issue to more broadly support time-dependent routing, with use-cases such as:
|
Okay if you want to do full time-dependent routing then here's a great accessible paper for a heuristic you might want to use for time-dependent routing: https://arxiv.org/abs/1606.06636 |
Thank you, interesting paper. |
For the traffic light problem, the approach in the paper could be used to compute a number of future time windows based on predicted traffic light states. |
do you want to emit instructions like "speedup to 22km/h to catch the ferry" or "slowdown to 10km/h, you are going to stand at red light anyway"? that would be nice... |
yes we do want to do that in the front-end. but including that in the route computation might further complicate things. |
For the record @emiltin you can already implement the paper mentioned above on top of OSRM:
Interested in what you will find out! |
I have a similar use-case where I want to use real-world speed data that comes in 15min daytime slots. I would like to annotate the segments with speed data and set the edge weight dynamically during routing using the time of day at the current node in the current path. Does this sound reasonable or is this approach too different from how OSRM works? |
You can't set weights dynamically during routing - both the CH as well as the MLD pipeline do pre-processing. What you can do is either change your speeds and weights every 15 minutes https://github.com/Project-OSRM/osrm-backend/wiki/Traffic but then long distance routes much longer than your 15 minutes will not respect "current" traffic. To solve this you can use the approach in the paper linked above and described in #4449 (comment). |
I would have to go with the 2nd option, since there is not only the 'long distance routing' problem, but also is the time of day a parameter of the query. |
Any progress on the dynamic traffic update? |
@chnlior No - OSRM does not support this, and there are no concrete plans to implement it. There are a couple of academic papers that outline possible approaches to extend OSRM's CH algorithm to support time-dependent queries: http://algo2.iti.kit.edu/documents/routeplanning/tch_alenex09.pdf but the implementations here are quite complex (weeks or months of work most likely). |
@danpat, many thanks for the prompt answer and thanks for this great project. Out of curiosity I still wonder if this is not planned because of resources issues or because there is no much demand for such feature. |
@chnlior happy to review pull requests if you want to give it a try. The tl;dr is
HTH, |
@daniel-j-h, |
@daniel-j-h I can understand the first two phases. But how to implement the "Make time-dependent query on the intersection of all segments, use weight for optimization"? |
1)I might be completely wrong here but to keep things simple how about keeping one osrm instance for each time slot rather thank making another sub graph. i.e if there are 4 time slots then we have one main osrm instance with no traffic information . and then 4 more OSRM instances where we feed in traffic information. |
this might not be perfect place to ask but lets say if i am just interested in calculating approximate time for trip time . then combining osrm with https://www.kaggle.com/c/new-york-city-taxi-fare-prediction/kernels like machine learning regression models any good? anyone has any experience on this? |
@chansbest https://github.com/melmasri/traveltimeHMM could help you, implementation based on one Microsoft research paper. |
This issue seems to be stale. It will be closed in 30 days if no further activity occurs. |
We would like to use our bike app to guide cyclist from A to B in the fastest and most convenient way. Avoiding stops at red light is an important factor. There are several possible strategies:
Avoid intersection with traffic ligths. However, this can make the route longer, and crossing streets with a lot of traffic can be slow if there's no traffic ligtht.
Provide real-time speed advice based on real-time data from the traffic lights combined with GPS from the device. Suggesting a slower speed will make the travel time longer, but can increase the comfort. Suggesting a faster speed can save significant travel time, if it means you make it through the current green cycle.
Recompute the route dynamically based on real-time data about when traffic lights are predicted to change between red and green.
Is it possible to use OSRM for strategy 3? It doesn't yet handle time-based data, but it does support updating weights based on e.g. travel times.
The text was updated successfully, but these errors were encountered: