mamut-tools (MAMUT-routing-tools)¶
The local generation and solving suite of MAMUT-routing-tools: OpenStreetMap city acquisition, the road-graph engine, per-instance generation (CVRP, VRPTW and the time-dependent twins), converters, BKS route geometry, solving, and the local workbench GUI.
The reference below is generated from the Typer application at build time.
mamut-tools¶
Local MAMUT-routing tool suite: OSM acquisition, road-graph engine, route geometry, and instance generation.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--version, -V |
boolean | Show the installed version and package location, then exit. | None |
--help |
boolean | Show this message and exit. | False |
Subcommands
- bks-campaign: BKS campaigns: baseline, resumable multi-solver runs, single-writer harvest, reports (TOML spec).
- convert: Converters for external benchmark distributions.
- generate: Interactive CVRP/VRPTW instance generation on city road graphs.
- geometry: BKS route-geometry materialization.
- gui: Local workbench GUI (loopback server owned by the CLI).
- osm: OSM city acquisition (Nominatim + Overpass).
- roadgraph: Road-graph engine (OpenStreetMapX-compatible construction).
- solve: Solve an instance with any registered solver and check the result.
mamut-tools bks-campaign¶
BKS campaigns: baseline, resumable multi-solver runs, single-writer harvest, reports (TOML spec).
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help |
boolean | Show this message and exit. | False |
Subcommands
- baseline: Freeze the stored BKS of the selected instances (baseline.csv) before the campaign runs.
- harvest: Write improved BKS: each instance's best valid run, unless clearly worse than the baseline (the only writer).
- plan: Dry run: what
runwould do -- runs to do and done, core-hours, makespan, memory, refusals. - report: Write ledger.csv (one row per run) and cross-solver.csv (best per kind, gaps, seed spread).
- run: Run the campaign's remaining runs (resumable). Workers never write BKS;
harvestdoes. - status: Runs archived so far, by status, and the last
runsummary.
mamut-tools bks-campaign baseline¶
Freeze the stored BKS of the selected instances (baseline.csv) before the campaign runs.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--force |
boolean | Replace an existing baseline. | False |
--help |
boolean | Show this message and exit. | False |
mamut-tools bks-campaign harvest¶
Write improved BKS: each instance's best valid run, unless clearly worse than the baseline (the only writer).
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--offer-all |
boolean | Offer every instance's best run, even below the baseline. | False |
--dry-run |
boolean | Report what the store would do without writing. | False |
--workers |
integer range (1 and above) |
Parallel instances (one process each). | 1 |
--help |
boolean | Show this message and exit. | False |
mamut-tools bks-campaign plan¶
Dry run: what run would do -- runs to do and done, core-hours, makespan, memory, refusals.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--only |
text | Regex on instance ids/names (smoke tests, partial runs). | None |
--retry-failed |
boolean | Count failed / timed-out runs as to do. | False |
--json |
boolean | N/A | False |
--help |
boolean | Show this message and exit. | False |
mamut-tools bks-campaign report¶
Write ledger.csv (one row per run) and cross-solver.csv (best per kind, gaps, seed spread).
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help |
boolean | Show this message and exit. | False |
mamut-tools bks-campaign run¶
Run the campaign's remaining runs (resumable). Workers never write BKS; harvest does.
First Ctrl-C: no new run starts and the running ones finish. Second: abort
(solvers are killed with their process groups). Interrupted runs leave no
record. The next run starts them in fresh workers and skips completed
records, including those from older campaigns. A worker that dies (out of
memory) gets a failed record (--retry-failed runs it again); the
other runs carry on.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--only |
text | Regex on instance ids/names (smoke tests, partial runs). | None |
--workers |
integer range (1 and above) |
Override resources.workers. | None |
--memory-gb |
float | Override resources.memory_gb. | None |
--retry-failed |
boolean | Re-run failed / timed-out runs. | False |
--max-tasks |
integer range (1 and above) |
Stop after starting this many runs. | None |
--help |
boolean | Show this message and exit. | False |
mamut-tools bks-campaign status¶
Runs archived so far, by status, and the last run summary.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help |
boolean | Show this message and exit. | False |
mamut-tools convert¶
Converters for external benchmark distributions.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help |
boolean | Show this message and exit. | False |
Subcommands
- blauth2024: Convert the Blauth et al. 2024 delivery-only instances into the canonical Blauth2024 family.
mamut-tools convert blauth2024¶
Convert the Blauth et al. 2024 delivery-only instances into the canonical Blauth2024 family.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--output-dir |
path | Family collection root to write into (benchmarks/Blauth2024 or a preview dir): instances go to TDVRPTW/n= |
_required |
--sizes |
text | Comma-separated sizes to convert. | 10,500 |
--cities |
text | Comma-separated upstream city names, or 'all'. | all |
--upstream-commit |
text | Upstream git commit recorded in provenance (default: read from the checkout). | None |
--verify / --no-verify |
boolean | Re-load every emitted instance and re-check the atf_sha256 pin. | True |
--help |
boolean | Show this message and exit. | False |
mamut-tools generate¶
Interactive CVRP/VRPTW instance generation on city road graphs.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help |
boolean | Show this message and exit. | False |
Subcommands
- derive-td: Derive the TDVRP + TDVRPTW twins of a generated instance (traffic -> ATFs -> TW lift).
- derive-vrptw: Derive the fastest-metric VRPTW twin of an already generated CVRP base.
- materialize-distances: Rebuild the distance sidecars a large instance ships as pins rather than bytes.
- preview: Preview a selection as GeoJSON (no artifacts written).
- single: Generate one instance (3 metric .vrp files + meta + manifest + .vrp.json).
mamut-tools generate derive-td¶
Derive the TDVRP + TDVRPTW twins of a generated instance (traffic -> ATFs -> TW lift).
Exits 1 with the reason when the twins cannot be certified (nothing is written then). Existing twins are kept only if they were derived from the current inputs with the same --seed; --force re-derives regardless.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--model |
text | Traffic model: bpr or wave. | bpr |
--intensity |
text | Traffic intensity: light, moderate, or heavy. | moderate |
--all, --all-combos |
boolean | Derive all model x intensity combinations (6 twins each). | False |
--seed |
integer | N/A | 42 |
--force / --no-force |
boolean | Overwrite existing twins/sidecars. | False |
--help |
boolean | Show this message and exit. | False |
mamut-tools generate derive-vrptw¶
Derive the fastest-metric VRPTW twin of an already generated CVRP base.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--tw-method |
text | N/A | route_centered |
--seed |
integer | N/A | 0 |
--help |
boolean | Show this message and exit. | False |
mamut-tools generate materialize-distances¶
Rebuild the distance sidecars a large instance ships as pins rather than bytes.
Instances above the size where a distance matrix is worth storing publish the road graph and the matrix's sha256, not the matrix. This recomputes them from the committed road sidecar and refuses to write anything whose digest does not match the pin, so what lands on disk is byte-for-byte what the instance was published against.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--collection-root |
path | Collection root; found from the marker file above the instance when omitted. | None |
--force / --no-force |
boolean | Rebuild sidecars that are already present. | False |
--help |
boolean | Show this message and exit. | False |
mamut-tools generate preview¶
Preview a selection as GeoJSON (no artifacts written).
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--n |
integer | N/A | 50 |
--method |
text | N/A | poi_categories |
--seed |
integer | N/A | 0 |
--depot-mode |
text | N/A | center |
--customer-mode |
text | N/A | random_clustered |
--osm-path |
path | N/A | None |
--output-dir |
path | N/A | None |
--help |
boolean | Show this message and exit. | False |
mamut-tools generate single¶
Generate one instance (3 metric .vrp files + meta + manifest + .vrp.json).
The result's "action" is created, unchanged (identical content already there, nothing written), renamed or replaced.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--n |
integer | Number of customers. | 50 |
--method |
text | Sampling method: poi_categories, parametric_attach, hybrid. | poi_categories |
--seed |
integer | N/A | 0 |
--demand-type |
integer range (between 1 and 7) |
N/A | 7 |
--avg-route-size |
integer range (between 1 and 7) |
N/A | 4 |
--depot-mode |
text | random, center, corner. | center |
--customer-mode |
text | random, clustered, random_clustered. | random_clustered |
--vrptw / --no-vrptw |
boolean | Also derive the fastest-metric VRPTW twin. | False |
--tw-method |
text | route_centered or reachable_interval. | route_centered |
--osm-path |
path | Explicit OSM extract path. | None |
--output-dir |
path | Workspace directory (default: the resolved workspace). | None |
--replace / --no-replace |
boolean | When an instance of the same name but different content exists: replace it, deleting its derived twins and BKS (--replace), or keep it and write |
False |
--help |
boolean | Show this message and exit. | False |
mamut-tools geometry¶
BKS route-geometry materialization.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help |
boolean | Show this message and exit. | False |
Subcommands
- materialize-plan: Materialize a route-geometry group plan (website build contract).
mamut-tools geometry materialize-plan¶
Materialize a route-geometry group plan (website build contract).
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--repo-root |
path | MAMUT-routing repo root the plan paths are relative to. | _required |
--result-dir |
path | Directory for per-group result files. Prints to stdout when omitted. | None |
--help |
boolean | Show this message and exit. | False |
mamut-tools gui¶
Local workbench GUI (loopback server owned by the CLI).
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help |
boolean | Show this message and exit. | False |
Subcommands
- run: Run the GUI server in the foreground (development mode).
- start: Start the workbench GUI server as a managed background process.
- status: Show the GUI server status.
- stop: Stop the workbench GUI server.
mamut-tools gui run¶
Run the GUI server in the foreground (development mode).
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--port |
integer | N/A | 8788 |
--output-dir |
path | N/A | None |
--help |
boolean | Show this message and exit. | False |
mamut-tools gui start¶
Start the workbench GUI server as a managed background process.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--port |
integer | Port to bind (0 = pick a free one). | 0 |
--output-dir |
path | Workspace directory. | None |
--open / --no-open |
boolean | Open the tokened URL in the default browser. | True |
--help |
boolean | Show this message and exit. | False |
mamut-tools gui status¶
Show the GUI server status.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--output-dir |
path | N/A | None |
--help |
boolean | Show this message and exit. | False |
mamut-tools gui stop¶
Stop the workbench GUI server.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--output-dir |
path | N/A | None |
--help |
boolean | Show this message and exit. | False |
mamut-tools osm¶
OSM city acquisition (Nominatim + Overpass).
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help |
boolean | Show this message and exit. | False |
Subcommands
- fetch-city: Download a filtered, road-graph-compatible OSM extract for a city.
- refresh-pois: Backfill amenities mapped as ways and relations into existing extracts.
- validate: Reject incomplete or Overpass-error extracts before graph construction.
mamut-tools osm fetch-city¶
Download a filtered, road-graph-compatible OSM extract for a city.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--country |
text | Optional country to disambiguate the geocode. | `` |
--osm-dir |
path | Directory for the downloaded |
osmdata |
--padding-km |
float | Extra bbox padding in km. | 0.0 |
--max-radius-km |
float | Clamp the administrative bbox to a square of this radius around the place's geocode point (0 = no clamp). | 0.0 |
--profile |
text | Data profile: generation, road_cache, or full. | generation |
--poi-category |
text | POI amenity category to include (repeatable; generation profile only). | None |
--tile-cache-dir |
path | Persistent validated Overpass tile cache (default: |
None |
--tile-cache / --no-tile-cache |
boolean | Reuse successful tiles across interrupted or repeated downloads. | True |
--help |
boolean | Show this message and exit. | False |
mamut-tools osm refresh-pois¶
Backfill amenities mapped as ways and relations into existing extracts.
Extracts fetched before ways and relations were queried hold only the POIs mapped as nodes -- roughly two thirds of a real city's amenities -- and nothing invalidates them, so generation keeps drawing from the smaller pool. Only the amenity query is re-run: the road network in each file is left alone, so this is far cheaper than re-fetching the cities.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--osm-dir |
path | Directory holding the |
None |
--output-dir |
path | Workspace directory, when --osm-dir is not given. | None |
--check |
boolean | Report coverage and exit without downloading anything. | False |
--all |
boolean | Refresh every extract, not only those missing way-mapped POIs. | False |
--poi-category |
text | Amenity category to backfill (repeatable; default: the full catalog). | None |
--tile-cache / --no-tile-cache |
boolean | Reuse successful tiles across interrupted or repeated runs. | True |
--help |
boolean | Show this message and exit. | False |
mamut-tools osm validate¶
Reject incomplete or Overpass-error extracts before graph construction.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help |
boolean | Show this message and exit. | False |
mamut-tools roadgraph¶
Road-graph engine (OpenStreetMapX-compatible construction).
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help |
boolean | Show this message and exit. | False |
Subcommands
- info: Build the road graph and print vertex/edge statistics.
mamut-tools roadgraph info¶
Build the road graph and print vertex/edge statistics.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--only-intersections / --all-nodes |
boolean | N/A | True |
--trim / --no-trim |
boolean | N/A | True |
--help |
boolean | Show this message and exit. | False |
mamut-tools solve¶
Solve an instance with any registered solver and check the result.
Prints JSON. "cost" is the reference checker's cost of the routes and
"validation" gives its verdict. The optional "solver_report" preserves
the objective and units the solver reported. "solver_cost" displays its
comparable routing cost in family units when available. "status" is the solver's termination
(KAYROS: finished / converged / time_limit). With --save-bks --authors,
"bks_update" reports the store's action (created, replaced or
kept_existing, with "tie" when the stored BKS costs exactly the same).
The flags are those of mamut-routing solve (--time-limit and
--update-bks still work). The JSON is a solution file mamut-routing
check and bks submit read. Exit status 1 when "ok" is false (the
solver failed or the checker rejected its routes).
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--time-limit-s, --time-limit |
integer range (1 and above) |
Wall-clock budget in seconds. | 30 |
--seed |
integer | N/A | 42 |
--objective |
text | MonoCost or HierarchicalVehicleCost for static routing, Duration or FleetCostDuration for TD routing. Defaults to MonoCost for static routing and Duration for TD routing. | None |
--solver |
text | Solver: pyvrp (CVRP/VRPTW), kayros (TDVRP/TDVRPTW, Duration or FleetCostDuration), or an external executable -- filo2, hgs-cvrp, ails2, lkh3, or one of yours -- from the solvers config. mamut-routing solvers list shows what is available. |
pyvrp |
--solvers-config |
path | Solvers config TOML (default: $MAMUT_ROUTING_SOLVERS_CONFIG, then ~/.config/mamut-routing/solvers.toml). | None |
--keep-artifacts |
path | Keep an external solver's input, output and log in this directory. | None |
--save-bks, --update-bks / --no-save-bks, --no-update-bks |
boolean | Write a BKS file next to the instance when the solution improves it (needs --authors). | False |
--authors |
text | Who to credit in a written BKS (or $MAMUT_ROUTING_BKS_AUTHORS). | None |
--help |
boolean | Show this message and exit. | False |