rmpca - Route Optimization TUI & Agent Engine
A powerful Terminal User Interface (TUI) and Command-Line Interface (CLI) for route optimization using both the Chinese Postman Problem (CPP) and multi-vehicle Vehicle Routing Problem (VRP) algorithms. Extract road networks from Overture Maps or OpenStreetMap, compile them into efficient binary formats, and optimize routes with turn penalties and depot constraints.
Features
- π₯οΈ Interactive TUI: Beautiful terminal interface built with
ratatui - π€ Agent-First CLI: Purpose-built
agentcommand for JSON-task automation - πΊοΈ Data Extraction: Extract road networks from Overture Maps S3 (Parquet) or OpenStreetMap PBF files
- π§Ή GeoJSON Cleaning: Repair geometries, deduplicate edges, and optimize graph topology
- π§ Binary Compilation: Convert GeoJSON to optimized
.rmpbinary format with CRC32 integrity checking - π Route Optimization (CPP): Solve the Chinese Postman Problem with turn penalties and oneway support
- π VRP Engine: Multi-vehicle routing with multiple solvers:
- Clarke-Wright Savings: Classic heuristic for capacity and distance
- Sweep Algorithm: Geometric partitioning
- Local Search: 2-Opt and Or-Opt path improvements
- π Resource Discovery:
listcommand to discover maps and routes programmatically - β‘ Asynchronous Runtime: Fully non-blocking I/O using
tokiofor high-performance extraction and processing
Installation
From crates.io
From source
Modes of Operation
1. Interactive TUI
Launch the full interface by running rmpca without arguments.
2. Command-Line Interface (CLI)
Use rmpca <COMMAND> for scripts, agents, and batch processing. All commands support a --json flag for structured output.
# Discover resources
# Run a task via Agent (JSON payload)
# Multi-vehicle VRP
# Single-vehicle CPP Optimization (Outputs GPX)
CLI Commands
| Command | Description |
|---|---|
extract |
Fetch data from Overture Maps or OSM |
clean |
Repair and simplify GeoJSON networks |
compile |
Convert GeoJSON to efficient .rmp binary |
optimize |
Single-vehicle CPP route optimization |
vrp |
Multi-vehicle Routing Problem solver |
agent |
Execute complex tasks from JSON payloads |
list |
Enumerate maps, routes, and solvers |
pipeline |
Run extract β clean β compile β optimize |
AI Agent Task Format
The agent command consumes a JSON payload, allowing agents to trigger complex workflows without manual flag management.
Usage (TUI)
1. Extract Road Network
- Navigate to Extract Data view
- Set bounding box (format:
min_lat,min_lon,max_lat,max_lon) - Toggle between OSM and Overture sources
- Output:
extract_YYYYMMDD_HHMMSS.geojson
2. Compile to Binary
- Navigate to Compile Map view
- Set input GeoJSON file path
- Output:
.rmpbinary file
3. Browse & Optimize
- Use Browse Cached Maps to select a compiled map
- Configure turn penalties and depot in the Optimize Route view
- Run optimization to generate a GPX/GeoJSON route
Binary Format (.rmp)
The .rmp format is a compact binary representation optimized for graph traversals:
[4 bytes] Magic "RMP1"
[4 bytes] Node count (u32 LE)
[4 bytes] Edge count (u32 LE)
[N * 16] Nodes: lat(f64) + lon(f64)
[E * 17] Edges: from(u32) + to(u32) + weight_m(f64) + oneway(u8)
[4 bytes] CRC32 checksum
Library Usage
use ;
// VRP Solver Example
let vrp_input = VRPSolverInput ;
let solver = get_solver?;
let output = solver.solve.await?;
Data Sources
Overture Maps
- Status: β Production Ready
- Source: AWS S3 public bucket (
overturemaps-us-west-2) - Format: Parquet/WKB via
reqwestandparquetcrates
OpenStreetMap
- Status: β Production Ready
- Source: Local
.osm.pbffiles - Parser:
osmpbfcrate
Performance
- Snapping: 1-meter precision node deduplication
- Compression: ~90% reduction vs GeoJSON
- Speed: Optimization on 10,000+ edges in <500ms
Roadmap
- v0.3.0: VRP Engine Integration (Clarke-Wright, Sweep, 2-Opt)
- v0.3.5: Agent & List commands for machine-to-machine workflows
- v0.4.0: Fully Async pipeline and OSM PBF support
- v0.5.0: Time Window support (VRPTW) and 3D terrain-aware routing
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.