Skip to content

mamut-routing (mamut-routing-lib)

The command-line interface of mamut-routing-lib: list local benchmark instances, download and verify release archives, solve with PyVRP and propose best-known solutions, and export static instances to the classic CVRPLIB .vrp format. Install it with the cli extra:

pip install "mamut-routing-lib[cli]"      # or: uv add "mamut-routing-lib[cli]"
mamut-routing --help

The reference below is generated from the Typer application at build time.

mamut-routing

CLI for the MAMUT-routing benchmark library: list and solve local benchmark instances.

Usage:

mamut-routing [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--version, -V boolean Show the mamut-routing-lib version and exit. None
--benchmarks-dir path Local benchmark directory. Defaults to $MAMUT_ROUTING_BENCHMARKS_ROOT or $MAMUT_ROUTING_ROOT/benchmarks or ./benchmarks. None
--help boolean Show this message and exit. False

Subcommands

  • bks: Maintenance of stored best-known solutions.
  • check: Check an externally found solution with the reference checker.
  • export: Export local benchmark instances to classic solver formats (CVRPLIB .vrp, Solomon .txt).
  • list: List local benchmark instances available to solve.
  • remote: Commands for remote benchmark archives published as GitHub release assets.
  • solve: Solve benchmark instances with a registered solver and check every result.
  • solvers: Registered solvers: PyVRP, KAYROS and external executables (solvers config).
  • verify-manifest: Verify an edition's inputs and complete binary64 materialization.

mamut-routing bks

Maintenance of stored best-known solutions.

Usage:

mamut-routing bks [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--help boolean Show this message and exit. False

Subcommands

  • submit: Propose an externally found solution as the BKS of an instance.

mamut-routing bks submit

Propose an externally found solution as the BKS of an instance.

The solution is checked, then stored next to the instance as .bks..json only if it strictly beats the stored BKS (exact rational comparison under the instance's binary64 profile). A tie keeps the incumbent. A file written by solve --output-dir brings its run's provenance (solver, version, seed, budget); the flags override it. Exit status 0 for created / replaced / kept, 1 when the checker rejects the solution, 2 on a usage error.

Usage:

mamut-routing bks submit [OPTIONS] INSTANCE_PATH SOLUTION_PATH

Options:

Name Type Description Default
--authors text Who found the solution, as it should be credited (required; or set $MAMUT_ROUTING_BKS_AUTHORS). None
--objective choice (HierarchicalVehicleCost | MonoCost | Duration | FleetCostDuration) Objective (default: the family's published one). None
--method text Method label, e.g. 'lkh3' or a paper reference. None
--seed integer Seed of the run that found it. None
--time-limit-s float Budget of that run, in seconds. None
--solver-version text Solver version or commit. None
--meta text Extra metadata as KEY=VALUE (JSON values are decoded); repeatable. None
--ids text How stop ids are numbered in the solution file: 'auto' (1..n with 0 as a depot marker, unless the file covers 0..n-1 exactly), 'one-based' or 'zero-based'. auto
--backend text Exact evaluator: native (default) or python. native
--dry-run boolean Report what the store would do without writing. False
--help boolean Show this message and exit. False

mamut-routing check

Check an externally found solution with the reference checker.

The routes are mapped onto the instance's ids (depot 0, customers 1..n) and priced by the same checker that validates every BKS, static or time-dependent. A declared cost that differs from the checker's is reported, not trusted. Exit status 0 when valid, 1 when the checker rejects the routes, 2 when the file cannot be read or does not fit the instance.

Usage:

mamut-routing check [OPTIONS] INSTANCE_PATH SOLUTION_PATH

Options:

Name Type Description Default
--objective choice (HierarchicalVehicleCost | MonoCost | Duration | FleetCostDuration) Objective (default: the family's published one). None
--ids text How stop ids are numbered in the solution file: 'auto' (1..n with 0 as a depot marker, unless the file covers 0..n-1 exactly), 'one-based' or 'zero-based'. auto
--backend text Exact evaluator: native (default) or python. native
--json boolean Print the verdict as JSON. False
--help boolean Show this message and exit. False

mamut-routing export

Export local benchmark instances to classic solver formats (CVRPLIB .vrp, Solomon .txt).

Usage:

mamut-routing export [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--help boolean Show this message and exit. False

Subcommands

  • vrp: Export benchmark instances to the classic CVRPLIB .vrp format (or Solomon .txt).

mamut-routing export vrp

Export benchmark instances to the classic CVRPLIB .vrp format (or Solomon .txt).

Selection mirrors list and solve: positional INSTANCE_PATHS or a recursive scan of --benchmarks-dir filtered by --problem-type / --benchmark-name / --metric-variant / --instance-id / --instance-name. Slim collection instances (Poryos2026, Mamut2026) hydrate their matrix from the sha-pinned distances sidecar. Time-dependent instances have no static matrix: explicit TD paths are an error, scanned ones are skipped with a warning.

mamut-routing --benchmarks-dir ./benchmarks export vrp \
    --problem-type CVRP --benchmark-name Mamut2026 --output-dir ./vrp-out

Usage:

mamut-routing export vrp [OPTIONS] [INSTANCE_PATHS]...

Options:

Name Type Description Default
--problem-type choice (CVRP | VRPTW | TDVRPTW | TDVRP) Filter by CVRP or VRPTW. None
--benchmark-name choice (Sintef2008 | Dimacs2021 | Poryos2026 | Mamut2026 | Ortec2022 | Dabia2013 | Ari2018 | Vu2020 | Rifki2020 | Lera2026 | Blauth2024) Filter by benchmark family. None
--metric-variant choice (fastest | shortest | euclidean) Filter by metric variant. None
--instance-id text Filter by exact path-derived aggregate instance ID. None
--instance-name text Filter by exact stored instance name. None
--output-dir path Write outputs under this directory, mirroring each path relative to --benchmarks-dir (flat for files outside it). Default: next to each source .vrp.json. None
--format text 'vrp' (CVRPLIB/TSPLIB .vrp; CVRP or CVRPTW sections) or 'solomon' (Solomon/Gehring-Homberger .txt, VRPTW with euclidean metric only). vrp
--edge-weight-type text 'EXPLICIT' writes the full cost matrix (faithful to the published costs). 'EUC_2D' writes coordinates only, for instances whose costs are a rounding of the Euclidean distance of their coordinates (not Dimacs2021, whose costs are floor(10 * d)); classic readers then use TSPLIB nint distances, which can differ from the published costs by that rounding. EXPLICIT
--comment text Override the COMMENT line (default: reconstructed from the instance). None
--force / --no-force boolean Overwrite existing outputs (default: report them as 'exists'). False
--collection-root path Collection root (directory holding mamut-collection.json) for slim instances copied out of their collection tree. None
--jobs integer range (1 and above) Parallel workers for batches. Defaults to max(1, CPU count - 2). None
--quiet / --no-quiet boolean Only print errors and the summary. False
--help boolean Show this message and exit. False

mamut-routing list

List local benchmark instances available to solve.

Mirrors the selection model of solve: positional INSTANCE_PATHS or a recursive scan of --benchmarks-dir filtered by --problem-type / --benchmark-name / --metric-variant / --instance-id / --instance-name. Use --paths-only to pipe into solve, e.g.

mamut-routing list --problem-type CVRP --paths-only \
    | xargs -r mamut-routing solve --time-limit-s 30

Usage:

mamut-routing list [OPTIONS] [INSTANCE_PATHS]...

Options:

Name Type Description Default
--problem-type choice (CVRP | VRPTW | TDVRPTW | TDVRP) Filter by CVRP or VRPTW. None
--benchmark-name choice (Sintef2008 | Dimacs2021 | Poryos2026 | Mamut2026 | Ortec2022 | Dabia2013 | Ari2018 | Vu2020 | Rifki2020 | Lera2026 | Blauth2024) Filter by benchmark family. None
--metric-variant choice (fastest | shortest | euclidean) Filter by metric variant. None
--instance-id text Filter by exact path-derived aggregate instance ID. None
--instance-name text Filter by exact stored instance name. Note that instance names have no uniqueness guaranty. None
--paths-only / --no-paths-only boolean Print only matching file paths (one per line). False
--show-path / --no-show-path boolean Include each matching file path in the table. False
--summary / --no-summary boolean Append a recap with counts per problem / benchmark / metric / size. True
--help boolean Show this message and exit. False

mamut-routing remote

Commands for remote benchmark archives published as GitHub release assets.

Usage:

mamut-routing remote [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--repo text GitHub repo (owner/name). Defaults to $MAMUT_ROUTING_RELEASE_REPO or 'ANR-MAMUT/MAMUT-routing'. None
--token text GitHub token. Defaults to $MAMUT_ROUTING_GITHUB_TOKEN. Unnecessary for public releases with sufficient rate limits. None
--tag text Release tag (e.g. snapshot-2026-05-22-28f9199). Defaults to the latest release. None
--help boolean Show this message and exit. False

Subcommands

  • fetch: Download (and optionally extract) one or more benchmark archives.
  • list: List benchmark archives available in the remote release manifest.
  • manifest: Print the parsed release manifest as JSON.
  • verify: Verify sha256 of locally downloaded archives against the remote manifest.

mamut-routing remote fetch

Download (and optionally extract) one or more benchmark archives.

Archives are kept at /. With --extract (default) each family lands in the canonical tree, e.g. /Sintef2008 or /Poryos2026, so list and discover_benchmark_instances work on the fetched tree. Re-fetching replaces the family directory, including files written into it since (e.g. BKS saved by solve).

Usage:

mamut-routing remote fetch [OPTIONS] [FILENAMES]...

Options:

Name Type Description Default
--problem-type choice (CVRP | VRPTW | TDVRPTW | TDVRP) N/A None
--benchmark-name choice (Sintef2008 | Dimacs2021 | Poryos2026 | Mamut2026 | Ortec2022 | Dabia2013 | Ari2018 | Vu2020 | Rifki2020 | Lera2026 | Blauth2024) N/A None
--all boolean Download every asset in the manifest. False
--extract / --no-extract boolean Extract each archive into the canonical tree under --benchmarks-dir (default). True
--force boolean Replace an existing family directory even if it was not extracted by remote fetch (e.g. a git checkout). A previously fetched directory is always replaced. False
--help boolean Show this message and exit. False

mamut-routing remote list

List benchmark archives available in the remote release manifest.

Usage:

mamut-routing remote list [OPTIONS]

Options:

Name Type Description Default
--problem-type choice (CVRP | VRPTW | TDVRPTW | TDVRP) N/A None
--benchmark-name choice (Sintef2008 | Dimacs2021 | Poryos2026 | Mamut2026 | Ortec2022 | Dabia2013 | Ari2018 | Vu2020 | Rifki2020 | Lera2026 | Blauth2024) N/A None
--help boolean Show this message and exit. False

mamut-routing remote manifest

Print the parsed release manifest as JSON.

Usage:

mamut-routing remote manifest [OPTIONS]

Options:

Name Type Description Default
--help boolean Show this message and exit. False

mamut-routing remote verify

Verify sha256 of locally downloaded archives against the remote manifest.

Usage:

mamut-routing remote verify [OPTIONS]

Options:

Name Type Description Default
--problem-type choice (CVRP | VRPTW | TDVRPTW | TDVRP) N/A None
--benchmark-name choice (Sintef2008 | Dimacs2021 | Poryos2026 | Mamut2026 | Ortec2022 | Dabia2013 | Ari2018 | Vu2020 | Rifki2020 | Lera2026 | Blauth2024) N/A None
--help boolean Show this message and exit. False

mamut-routing solve

Solve benchmark instances with a registered solver and check every result.

Every solution is priced by the reference checker; COST is the checker's cost and GAP its distance to the BKS stored before the solve. Nothing is kept by default: --output-dir DIR saves every solution, and --save-bks --authors NAME stores a solution that strictly beats the stored BKS (exact binary64 rational costs, keeping ties) next to the instance. PyVRP needs the 'pyvrp' extra: pip install "mamut-routing-lib[pyvrp]".

Usage:

mamut-routing solve [OPTIONS] [INSTANCE_PATHS]...

Options:

Name Type Description Default
--problem-type choice (CVRP | VRPTW | TDVRPTW | TDVRP) Filter by problem type. None
--benchmark-name choice (Sintef2008 | Dimacs2021 | Poryos2026 | Mamut2026 | Ortec2022 | Dabia2013 | Ari2018 | Vu2020 | Rifki2020 | Lera2026 | Blauth2024) Filter by benchmark family. None
--metric-variant choice (fastest | shortest | euclidean) Filter by metric variant. None
--instance-id text Filter by exact derived aggregate instance ID. None
--instance-name text Filter by exact stored instance name. None
--solver text Choose pyvrp (default, CVRP/VRPTW), kayros (TDVRP/TDVRPTW, Duration or FleetCostDuration), or an external executable -- filo2, ails2 (CVRP, euclidean variants), hgs-cvrp (CVRP, any metric; patched reader), lkh3 (CVRP/VRPTW) -- configured in the solvers config. mamut-routing solvers list shows what is available here. pyvrp
--solvers-config path Solvers config TOML (default: $MAMUT_ROUTING_SOLVERS_CONFIG, then $XDG_CONFIG_HOME/mamut-routing/solvers.toml). Never read from the working directory. None
--keep-artifacts path Keep each external solver's input, output and log under DIR// (debugging, audits). None
--objective choice (HierarchicalVehicleCost | MonoCost | Duration | FleetCostDuration) Objective. Default: MonoCost for CVRP/VRPTW (CVRP is always MonoCost), Duration for TD instances. None
--time-limit-s, --time-limit integer range (1 and above) Wall-clock budget per instance, in seconds. 15
--seed integer Solver random seed. 42
--output-dir, -o path Write each solution to DIR/.-seed.json (routes, checker verdict, provenance); mamut-routing check and bks submit read these files. None
--save-bks, --update-bks / --no-save-bks, --no-update-bks boolean Store the solution as the instance's BKS when it strictly improves it (needs --authors). Off by default. False
--authors text Who to credit in a stored BKS (required with --save-bks; or set $MAMUT_ROUTING_BKS_AUTHORS). None
--display / --no-display boolean Forward PyVRP's per-iteration display to stdout. False
--jobs integer range (1 and above) Parallel solve workers for multi-instance selections. Defaults to max(1, CPU count - 2). Single-instance solves keep the time progress bar. None
--help boolean Show this message and exit. False

mamut-routing solvers

Registered solvers: PyVRP, KAYROS and external executables (solvers config).

Usage:

mamut-routing solvers [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--help boolean Show this message and exit. False

Subcommands

  • init: Write a commented starter solvers config: one table per built-in external solver.
  • list: List every registered solver: availability here, version, what it solves, and how to enable it.

mamut-routing solvers init

Write a commented starter solvers config: one table per built-in external solver.

Every table is commented out; uncomment the solvers you have built, set their paths, then check them with mamut-routing solvers list. Solvers already on PATH are marked in the file.

Usage:

mamut-routing solvers init [OPTIONS] [PATH]

Options:

Name Type Description Default
--force boolean Overwrite an existing file. False
--print boolean Print the starter config instead of writing it. False
--help boolean Show this message and exit. False

mamut-routing solvers list

List every registered solver: availability here, version, what it solves, and how to enable it.

Usage:

mamut-routing solvers list [OPTIONS]

Options:

Name Type Description Default
--solvers-config path Solvers config TOML (default: $MAMUT_ROUTING_SOLVERS_CONFIG, then $XDG_CONFIG_HOME/mamut-routing/solvers.toml). Never read from the working directory. None
--json boolean Print the solvers as JSON. False
--help boolean Show this message and exit. False

mamut-routing verify-manifest

Verify an edition's inputs and complete binary64 materialization.

Usage:

mamut-routing verify-manifest [OPTIONS] INSTANCE_PATH

Options:

Name Type Description Default
--sha256 text Expected manifest file digest. None
--atf-cache-root path Root of regenerated ATF sidecars. None
--help boolean Show this message and exit. False