Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.37k stars 3.37k forks source link

Illegal avoiding of congestions on motorways (Preventing dive-bombs) #5244

Open chaupow opened 6 years ago

chaupow commented 6 years ago

Issue

With osrm-backend's option to digest traffic updates and thus congestion information, it is possible that motorways have a very low speed that is even lower than the speed on off- and on-ramps.

One phenomenon visible in such cases are routes that avoid staying on a motorway and driving around congestion by taking the off-ramp and taking the next on-ramp immediately.

This driving behaviour of taking advantage of on/off-ramps when traffic is present, is very asocial and in many regions/countries even illegal. OSRM should not offer these routes even though (from a routing engine's perspective) they seem to be the shortest path.

I will refer to these kinds of routes as dive-bombs from now on (lending the term from here)

Proposal

I have two proposals (sketched up together with @oxidase). There is also an interesting related paper by Daniel Delling, Dennis Schieferdecker and Christian Sommer http://sommer.jp/trafficrouting.pdf

These are notes jotted down for the future. Any other ideas and brainstorms are highly appreciated!

For OSRM I see two options:

  1. make sure traffic updates do not introduce dive-bombs by having only dive-bombfree traffic updates OR
  2. change the graph structure such that dive-bombs are not possible anymore with multiple via way restrictions

Divebombfree traffic updates

The idea of dive-bombfree traffic updates is that whenever we update traffic data, we make sure that the weight of a dive-bomb is never faster than the weight of staying on a highway. Using the example above it means, that even though the duration of staying on a highway is 10min, we set its weight to 3min so that the dive-bomb is not faster: motorway copy

How would we implement it?

In preprocessing, we look at motorways and identify ways that could potentially be dive-bombed and remember them: dive-bombable copy

Now, every time we update traffic, we check whether one of the dive-bombable edges were updated. If they were updated, we check what the shortest path from the start and the end of a dive-bombable way is. If the shortest path is a dive-bomb 💣, we will adjust the weight of the dive-bombable way in such a way, that its weight is smaller than the dive-bomb.

This ensures that every time when traffic data is updated, no dive-bomb is introduced

Challenges:

Multiple via way restrictions

The keyword multiple via way restrictions has been a hot topic for a while. Here is how we could implement something like a multiple via way restriction to prevent dive-bombs:

This is our dive-bomb prone geometry: motorway copy 3

When this graph is turned into an edge based graph, we generate following turn edges: motorway copy 4

The maneouver, that we want to prevent is the following: motorway copy 5

We can forbid this turn during the edge-based-graph generation:

  1. we do no create the turn edge that exits the motorway and goes on to the ramp
  2. we additionally create a shortcut edge from the highway to all possible exits but not back to the same highway directly - the shortcut does not use the off-ramp

motorway copy 6

Steps necessary for this would be

  1. identifying dive-bombs in preprocessing
  2. implementing short-cut turn edges that represents the geometry of multiple edges

Challenges

Opportunities

wangyoucao577 commented 6 years ago

But in some region drivers like this behavior to avoid congestion, e.g. CN. So it's better to consider this feature also with an option or switch to enable/disable it.

emiltin commented 6 years ago

seems like a bit of a grey area. a driver might have valid reasons for taking the off-ramp, but changing his/her mind. the treshold for what length of detour is allowed also seems a bit arbitrary.

maybe another approach could be to penalizy entry into a motorway with a low traffic speeds. typically a low speed indicates congestion, meaning it's inconvenient to enter.

chaupow commented 5 years ago

maybe another approach could be to penalizy entry into a motorway with a low traffic speeds. typically a low speed indicates congestion, meaning it's inconvenient to enter.

we're tried this tweaking - but it's no real fix unfortunately. Setting the right parameter is also tricky, because if the penalty is too high, weird detours can happen 😞

github-actions[bot] commented 3 months ago

This issue seems to be stale. It will be closed in 30 days if no further activity occurs.