[Routing] OSRM Flapping routes / non deterministic

Florian Lohoff f at zz.de
Mon Feb 7 10:49:04 UTC 2022


Hi,
i am monitoring routes by calculating the very same route over and over
again with newer data (OSRM). Whenever something changes i get a mail.

I am currently using osrm v5.25.0-22-g73a2b9125 (Stretch does not have
newer boost)

Now - I have some routes which flap - Every now and then (Sometimes
multiple times a day). I am experiencing this for a long time also
with OSRM v5.10.0-rc.2-739-ga53da9095 which i used before.

I would have expected OSRM to take the fastest route, and if alternates
have the same duration, take the shorter one.

So i dug deeper and from what i find is that completely different 
routes show up.

Example:

This shows 2 runs of route calculation. The green one superseeded
the red one:

https://osm.zz.de/routeqa/?rid=396898,397019

Red:
	Calculated 2022-02-04 10:05:24
	id: 396898
	Time: 1057s
	Distance: 10018m

Green:
	Calculated 2022-02-04 15:05:40
	id: 397019
	Time: 957s
	Distance: 10507m

One would say - Sound reasonable - It is 100 seconds faster to go the
green way.

5 Hours later:

https://osm.zz.de/routeqa/?rid=397019,397065

Red:
	Calculated 2022-02-04 15:05:40
	id: 397019
	Time: 957s
	Distance: 10507m

Green:
	Calculated 2022-02-05 15:04:57
	id: 397065
	Time: 1057s
	Distance: 10018m

Goes back to the old route - Astonishing - Looking for data. Nothing
changed.

So looking deeper at the OSRM Results for the requests:

http://localhost:5000/route/v1/driving/%s,%s;%s,%s?geometries=geojson&overview=full&annotations=true&steps=true&alternatives=true

As you can see the route is stable for a couple of runs and then
changes. And one can see that in RouteID 396898 i get an alternative
route in Route 2 which does not show up in later 397019 but another run
later again in 397065. In 397019 2 routes show up which do not show up
in the earlier, nor in the later route calculations.

I am bit puzzled and thought that maybe i am experiencing time
conditional maxspeeds but i could not find any support for it
in the OSRM profiles.


I am lost in how to fix this.



showosrm --id 396898
Route ID: 396898
        OSM Database timestamp: 2022-02-04 10:05:24
        Number of Routes: 2
        Calculated first: 2022-02-04 09:37:41.416568
        Calculated last:  2022-02-04 11:31:09.002274
        NodeA:
                ID: 164
                Name: Kompostwerk
                Position: POINT(8.32632543109979 51.9139253691817)
        NodeB:
                ID: 128
                Name: Avenwedder Straße
                Position: POINT(8.45195139187322 51.9181843758572)


        Route  1 - Distance:  10018.2 Duration   1057.5 Weight: 1139.5
                Leg: 1 Steps: 11
        Route  2 - Distance:  10763.7 Duration    970.3 Weight: 1152.7
                Leg: 1 Steps: 10

showosrm --id 397019
Route ID: 397019
        OSM Database timestamp: 2022-02-04 15:05:40
        Number of Routes: 2
        Calculated first: 2022-02-04 14:36:34.537853
        Calculated last:  2022-02-04 16:29:51.074218
        NodeA:
                ID: 164
                Name: Kompostwerk
                Position: POINT(8.32632543109979 51.9139253691817)
        NodeB:
                ID: 128
                Name: Avenwedder Straße
                Position: POINT(8.45195139187322 51.9181843758572)


        Route  1 - Distance:  10507.6 Duration    957.1 Weight: 1139.5
                Leg: 1 Steps: 11
        Route  2 - Distance:  10169.0 Duration   1071.1 Weight: 1153.1
                Leg: 1 Steps: 12

showosrm --id 397065
Route ID: 397065
        OSM Database timestamp: 2022-02-05 15:04:57
        Number of Routes: 2
        Calculated first: 2022-02-05 11:32:36.025473
        Calculated last:  2022-02-05 16:29:21.341533
        NodeA:
                ID: 164
                Name: Kompostwerk
                Position: POINT(8.32632543109979 51.9139253691817)
        NodeB:
                ID: 128
                Name: Avenwedder Straße
                Position: POINT(8.45195139187322 51.9181843758572)


        Route  1 - Distance:  10018.2 Duration   1057.5 Weight: 1139.5
                Leg: 1 Steps: 11
        Route  2 - Distance:  10763.7 Duration    970.3 Weight: 1152.7
                Leg: 1 Steps: 10


Flo
-- 
Florian Lohoff                                                     f at zz.de
  Any sufficiently advanced technology is indistinguishable from magic.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/routing/attachments/20220207/23ab5803/attachment.sig>


More information about the Routing mailing list