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

contract edges with differing non-conditional access restrictions #4613

Merged
merged 22 commits into from Apr 8, 2024

Conversation

nilsnolde
Copy link
Member

@nilsnolde nilsnolde commented Feb 27, 2024

based on #4608

if 2 edges have differing conditional access restrictions, this PR will not contract the node. this is done because kTimeAllowed would be a bit more work to consolidate onto shortcuts, we'd have to only include overlapping time periods of the base edges. certainly possible, I left a TODO, just wanted to keep this PR lean. also conditionals are (at least in OSM) sufficiently rare to hardly have an impact.

if 2 edges have other differing access restrictions (maxheight/weight/width etc), we'll contract that node and keep the most restrictive attribute of all base edges for the entire shortcut.

I think this should work fine, but I do owe some tests. also some RAD tests. personally I'd still be happy in this case to only RAD test de_benchmark_routes.txt, which together with gurka tests, should prove that it works the way I'm thinking it does.

@nilsnolde nilsnolde force-pushed the nn-shortcuts-access-restrictions branch from 0c6fc9e to ad2fa07 Compare February 28, 2024 17:38
@nilsnolde
Copy link
Member Author

nilsnolde commented Feb 28, 2024

Updating the table of #4608 (comment):

features (accumulative) level 0 level 1
total shortcuts total superseded avg edges per shorcut total shortcuts total superseded avg edges per shorcut
master 161872 849550 6 623364 3863670 5
names/speed 107146 889932 8 359422 3976950 11
restrictions 107792 906868 8 349522 3985508 11

Note, between #4608 and this PR there's not much change for OSM data, but still a few more edges are superseded of course. I'd expect that to look different for commercial data.

@nilsnolde
Copy link
Member Author

I think there's a problem with opposing edges of shortcuts. If I read the current code correctly, then we use the last base edge's opp_local_idx for the new shortcut, but if the node of that last base edge will have a shortcut at some point later, then the opp_local_idx should be all wrong no? There's other questions I have regarding this, especially in the light of this PR. We can discuss on Monday.

Comment on lines +51 to +55
if (new_ar.type() == AccessType::kTimedAllowed || new_ar.type() == AccessType::kTimedDenied ||
new_ar.type() == AccessType::kDestinationAllowed) {
continue;
}
modes |= new_ar.modes();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did this small change to not record modes of restrictions we don't care about

@nilsnolde
Copy link
Member Author

no rush here, I wanted to understand better how shorcut's opposites are generated

@nilsnolde
Copy link
Member Author

got a minute to talk with @kevinkreiser about this. and yeah, there's some problems with how we build shortcuts today (and same in this PR), see #4656 .

that's for another PR though, as we're not breaking anything here, so all good for final review.

@nilsnolde nilsnolde force-pushed the nn-shortcuts-access-restrictions branch 2 times, most recently from a3d1de5 to 4a61b00 Compare March 26, 2024 11:55
Comment on lines +273 to +274
uint32_t forward_restrictions_count = 0;
uint32_t reverse_restrictions_count = 0;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to initialize it, further down we only add to it. resulted in bogus restriction counts for the first level

@nilsnolde nilsnolde merged commit fca9135 into master Apr 8, 2024
6 of 9 checks passed
@nilsnolde nilsnolde deleted the nn-shortcuts-access-restrictions branch April 8, 2024 14:16
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.

None yet

2 participants