Skip to content

Area vertex linking improvements#5209

Merged
vesameskanen merged 11 commits into
opentripplanner:dev-2.xfrom
HSLdevcom:optimize-complex-areas
Jun 22, 2023
Merged

Area vertex linking improvements#5209
vesameskanen merged 11 commits into
opentripplanner:dev-2.xfrom
HSLdevcom:optimize-complex-areas

Conversation

@vesameskanen

@vesameskanen vesameskanen commented Jun 22, 2023

Copy link
Copy Markdown
Contributor

Summary

  1. Vertex linker now checks access restrictions (no thru traffic) when connecting new vertices with surrounding area edges. Previously there was a bug that walk routing could not exit areas tagged as access=private or access=destination.

  2. Vertex linker no longer connects linked vertex inside an area with all visibility points, if the vertex was snapped to an existing visibility vertex due to small distance. Snapped visibility vertex already has the visibility connections, so there is no need to generate a new set of them. This fixes extremely slow linking near vertices which have many (sometimes over 100) existing connections.

  3. Vertex linker now has upper limit for visibility point connections. It is currently defined as class constant just like other linking parameters. It now has the value 300, meaning that routing can exit a complex area via maximally that many exit points. The are notoriously complex areas in Lund, Sweden, consisting of thousands of vertices, so this may have a positive effect on routing performance.

Issue

Closes #5203

Unit tests

  • One test updated to reflect the optimized 'snap point' linking
  • A new test which checks that no thru properties are considered in area linking

When vertex is linked to a private area, no thru restrictions must be considered properly.
Otherwise walking cannot exit the private area.
Sometimes VertexLinker snaps to an existing vertex close to the point to be linked.
In such a case, it is not necessary to generate new links with area visiblility points,
because that has been already done by walkable area builder.
@vesameskanen vesameskanen requested a review from a team as a code owner June 22, 2023 04:58
@vesameskanen vesameskanen added !Bug Apply to issues describing a bug and PRs witch fixes it. !Improvement A functional improvement or micro feature !Optimization The feature is to improve performance. labels Jun 22, 2023
@codecov

codecov Bot commented Jun 22, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 80.55% and no project coverage change.

Comparison is base (01218bc) 65.44% compared to head (6301da2) 65.44%.

Additional details and impacted files
@@            Coverage Diff             @@
##             dev-2.x    #5209   +/-   ##
==========================================
  Coverage      65.44%   65.44%           
- Complexity     14494    14500    +6     
==========================================
  Files           1754     1754           
  Lines          68021    68057   +36     
  Branches        7238     7246    +8     
==========================================
+ Hits           44515    44540   +25     
- Misses         21041    21046    +5     
- Partials        2465     2471    +6     
Impacted Files Coverage Δ
.../opentripplanner/street/model/edge/StreetEdge.java 86.96% <42.85%> (-0.61%) ⬇️
.../opentripplanner/routing/linking/VertexLinker.java 86.91% <89.65%> (+0.31%) ⬆️

... and 7 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@vpaturet vpaturet self-requested a review June 22, 2023 08:10
Comment thread src/main/java/org/opentripplanner/routing/linking/VertexLinker.java Outdated
….java

Co-authored-by: Leonard Ehrenfried <mail@leonard.io>

@vpaturet vpaturet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested locally with the problematic query mentioned in #5203, the routing is both correct and fast.

Comment thread src/main/java/org/opentripplanner/routing/linking/VertexLinker.java Outdated
@vesameskanen vesameskanen merged commit 81e1b70 into opentripplanner:dev-2.x Jun 22, 2023
@vesameskanen vesameskanen deleted the optimize-complex-areas branch June 22, 2023 13:40
t2gran pushed a commit that referenced this pull request Jun 22, 2023
@t2gran t2gran added this to the 2.4 (next release) milestone Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!Bug Apply to issues describing a bug and PRs witch fixes it. !Improvement A functional improvement or micro feature !Optimization The feature is to improve performance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance issue with vertex linking in complex area

4 participants