Skip to content
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

bug-fix: invalid contract node #7066

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fenwuyaoji
Copy link
Contributor

@fenwuyaoji fenwuyaoji commented Nov 11, 2024

Issue

To fix issue #7054

991730186441_ pic

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 the exlclude=toll, addressed in #7054.
In that case, node 3 has 2 alternative routes to node 7, while 3->1->0->6->7 is faster than 3->2->0. When OSRM wants to contract node 2, edge (3,2), (7,2) are deleted and no shortcut is inserted, because 3->1->0->6->7 is the actual shortcut (shorter than 3->2->0). However, updating the route weight doesn’t consider whether node 0 or 1 or others are accessible in this filtered graph. So I try to pass the array contractable into function relaxNode(), 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?

@fenwuyaoji fenwuyaoji changed the title fix invalid contract node bug-fix: invalid contract node Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant