mamut_routing_tools.generation.writers¶
Instance artifact writers and parsers (CVRPLIB .vrp, workbench _meta.json, _manifest.json, and the lib-contract .vrp.json payloads).
instance_path_plan
¶
instance_path_plan(
city: str,
method: str,
n_customers: int,
route_count: int,
output_root: str | Path,
name_suffix: str = "",
) -> tuple[Path, str]
Folder and base name of an instance.
name_suffix disambiguates instances that would otherwise share a name --
bulk rows differing only by seed, for example. It is empty in the common
case, so the established <city>_<abbr>-n<N>-k<K> naming is unchanged.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/generation/writers.py
cvrplib_text
¶
cvrplib_text(
name: str,
comment: str,
coords: list[tuple[float, float]],
demands: list[int],
matrix: list[list[int]],
capacity: int,
) -> str
The CVRPLIB .vrp text :func:write_cvrplib writes.