Rust-Based RAPTOR Transit Router Sparks Interest for Memory-Efficient Public Transport Planning

BigGo Editorial Team
Rust-Based RAPTOR Transit Router Sparks Interest for Memory-Efficient Public Transport Planning

The emergence of Farebox, a new public transit routing implementation written in Rust, has generated significant interest within the transportation technology community, particularly for its innovative approach to memory-efficient route planning.

Memory Efficiency Breakthrough

Farebox's implementation of the RAPTOR (Round-Based Public Transit Optimized Router) algorithm has achieved remarkable memory efficiency, with reports indicating that the Puget Sound region's timetable consumes only about 40 MiB on disk while the server process uses approximately 100k of RAM. This exceptional performance is achieved through zero-copy techniques and memory mapping, making it potentially suitable for mobile devices - a capability that distinguishes it from more resource-intensive solutions like OpenTripPlanner.

I have thought about offline trip planning on a phone, but running OTP is out of the question as a graph can be gigabytes and take minutes to load.

Key Technical Specifications:

  • Memory Usage: ~40 MiB on disk (Puget Sound timetable)
  • Server Process RAM: ~100k
  • Implementation Language: Rust
  • Core Algorithm: RAPTOR
  • Transfer Routing: Valhalla integration

Alternative to Traditional Systems

The project positions itself as a complement to OpenTripPlanner, particularly focusing on areas not covered by existing instances. Its integration with Valhalla for transfers and first/last mile routing, combined with multi-agency and timezone-aware capabilities, makes it a promising solution for comprehensive transit planning. While some limitations exist, such as the absence of route shapes in itineraries and pre-computed transfers restricting per-request walking/cycling customization, the project maintains a clear scope for future development.

Current Limitations:

  • No route shapes in itineraries
  • Pre-computed transfers only
  • Limited per-request walking/cycling customization
  • Some routing bugs with long-distance routes

Community Reception and Future Potential

The transit technology community has shown particular interest in Farebox's potential for offline mobile applications and its memory-efficient approach. Developers and transit professionals are especially intrigued by the possibility of planet-scale coverage from a single instance, which could significantly reduce hosting costs. While some routing bugs have been identified, such as unexpected long-distance bus routes appearing in place of high-speed rail options, the project maintains active development and community engagement.

The project also hints at future implementation of rRAPTOR routing, which would enable simultaneous calculation of itineraries across multiple departure times - a feature not typically available in traditional A* search implementations through time-dependent routing graphs.

Technical Note: RAPTOR (Round-Based Public Transit Optimized Router) is an algorithm specifically designed for public transit routing that processes routes in rounds, typically offering better performance than traditional A search methods for transit networks.*

Reference: Farebox - Fast RAPTOR implementation in Rust designed for memory-constrained machines