The alternatives feature on mld generates a lot of via candidates and then filters them based on cheap filtering first and more and more expensive filtering following.
What we should do is take the road importance into account early on in the filtering to discard via candidate nodes that are unimportant roads (edge-based graph: nodes are roads):
Even though we use the mld stepping to walk over border nodes filtering by road importance would be a cheap filter and discard unluckily picked via candidates already early on.
What we need to do is serialize out a bit vector which tells us for every node if the road passes RoadClassification::IsImportantRoad(node) or not. Serlialization need to happen in osrm-extract then deserialization and exposing road importance per node in the datafacades again.
Splitting out into a ticket from https://github.com/Project-OSRM/osrm-backend/pull/4047 (please read for context).
The alternatives feature on mld generates a lot of via candidates and then filters them based on cheap filtering first and more and more expensive filtering following.
What we should do is take the road importance into account early on in the filtering to discard via candidate nodes that are unimportant roads (edge-based graph: nodes are roads):
https://github.com/Project-OSRM/osrm-backend/blob/c1cb3ebff7471d6f34ac8a345115717e955a7554/src/engine/routing_algorithms/alternative_path_mld.cpp#L92-L112
Even though we use the mld stepping to walk over border nodes filtering by road importance would be a cheap filter and discard unluckily picked via candidates already early on.
What we need to do is serialize out a bit vector which tells us for every node if the road passes
RoadClassification::IsImportantRoad(node)
or not. Serlialization need to happen inosrm-extract
then deserialization and exposing road importance per node in the datafacades again.