Early Pruning optimization for RAPTOR transfer relaxation#7503
Open
andrii-rohovyi wants to merge 4 commits intoopentripplanner:dev-2.xfrom
Open
Early Pruning optimization for RAPTOR transfer relaxation#7503andrii-rohovyi wants to merge 4 commits intoopentripplanner:dev-2.xfrom
andrii-rohovyi wants to merge 4 commits intoopentripplanner:dev-2.xfrom
Conversation
Sort transfers by duration and break the transfer loop early when arrival time exceeds the best known destination arrival time. Based on: Rohovyi et al., 'Early Pruning for Public Transport Routing', 2026 https://arxiv.org/abs/2603.12592
Use per-round destination arrival bounds instead of a single global bound. This prevents a fast multi-transfer path from pruning a slower few-transfer path across Range Raptor iterations, ensuring correctness for the [departureTime, arrivalTime, numTransfers] Pareto criteria. Additionally, track within-iteration best destination arrival time (reset each iteration) to maintain pruning power from earlier rounds within the same RAPTOR run. 100% identical results on 1,000 queries (Norway, 30/60/90min transfers).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Implement the Early Pruning optimization that reduces RAPTOR query time by breaking out of transfer iteration early when remaining (sorted) transfers cannot improve the solution. Following the discussion with @t2gran during the OTP meeting on April 7, 2026, this PR is submitted for review.
Issue
Closes #7470
Unit tests
Documentation
otp.raptor.earlyPruning(enabled by default, set to"false"to disable).