Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
To fix issue #7054
Currently, in OSRM CH algo, the graph contract node and search routes update the weight of each edge. OSRM uses filters to exclude some specific roads with tags like toll, ferry, etc. In the function
contractExcludableGraph
, if filters are more than 1, OSRM will first contract a non-core graph and contract a corresponding graph of each filter. However, the weight update process uses all edges to search routes and doesn't consider that we can not use edges that should be excluded. This will lead to no route found issue when using theexlclude=toll
, addressed in #7054.In that case, node
3
has 2 alternative routes to node7
, while 3->1->0->6->7 is faster than 3->2->0. When OSRM wants to contract node2
, edge (3,2), (7,2) are deleted and no shortcut is inserted, because 3->1->0->6->7 is the actualshortcut
(shorter than 3->2->0). However, updating the route weight doesn’t consider whether node0
or1
or others are accessible in this filtered graph. So I try to pass the arraycontractable
into functionrelaxNode()
, if a finding node is inaccessible, we shouldn’t insert this node into the searching heap or update the weight.Notice: this change will leave more edges in graph and enlarge the memory usage, but I think it's worth it.
I'm not sure this is the best way to fix it. Waiting for your feedback, and appreciate it in advance.
Please read our documentation on release and version management.
If your PR is still work in progress please attach the relevant label.
Tasklist
Requirements / Relations
Link any requirements here. Other pull requests this PR is based on?