Skip to content

Early Pruning optimization for RAPTOR transfer relaxation#7503

Open
andrii-rohovyi wants to merge 4 commits intoopentripplanner:dev-2.xfrom
andrii-rohovyi:dev-2.x
Open

Early Pruning optimization for RAPTOR transfer relaxation#7503
andrii-rohovyi wants to merge 4 commits intoopentripplanner:dev-2.xfrom
andrii-rohovyi:dev-2.x

Conversation

@andrii-rohovyi
Copy link
Copy Markdown

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

  • All existing OTP unit tests pass with the change.
  • No new unit tests were added — the optimization is a performance improvement that preserves identical routing results.
  • Manual verification: benchmarked on 1,000 random queries in the Norway (Oslo region) graph across 30/60/90 min max transfer durations. Results are 100% identical to baseline (0 differences in paths found).
  • Performance improvement: +8.5% at 30 min, +8.2% at 60 min, +10.4% at 90 min transfer duration.
  • No regression on the standard OTP Norway SpeedTest (45 test cases, identical path counts).

Documentation

  • Design and rationale documented in code comments, referencing the paper: Rohovyi, Abuaisha, Walsh — "Early Pruning for Public Transport Routing", accepted at WCTR 2026 (https://arxiv.org/abs/2603.12592).
  • The optimization can be toggled via system property otp.raptor.earlyPruning (enabled by default, set to "false" to disable).
  • No new user-facing configuration options were added.

@andrii-rohovyi andrii-rohovyi requested a review from a team as a code owner April 8, 2026 03:30
@t2gran t2gran self-assigned this Apr 8, 2026
  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).
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.

Early Pruning optimization for RAPTOR transfer relaxation

2 participants