mamut_routing_lib.td.bks¶
Create and compare TD incumbents under td-binary64-exact-v1.
create_td_bks_from_solution
¶
create_td_bks_from_solution(
loaded: LoadedTDInstance | str | Path,
solution: BenchmarkSolution,
*,
authors: str,
metadata: dict[str, Any] | None = None,
objective_function: ObjectiveFunction | None = None,
backend: str = "native",
) -> BenchmarkBKS
Price a candidate, check any declared cost and bind exact witnesses to canonical routes.
Source code in MAMUT-routing-tools/MAMUT-routing-lib/src/mamut_routing_lib/td/bks.py
save_td_solution_as_bks_if_improved
¶
save_td_solution_as_bks_if_improved(
loaded: LoadedTDInstance | str | Path,
solution: BenchmarkSolution,
*,
authors: str,
metadata: dict[str, Any] | None = None,
objective_function: ObjectiveFunction | None = None,
backend: str = "native",
) -> BKSUpdateResult
Re-evaluate both route sets and store only a strict exact improvement.
A legacy incumbent keeps its original bytes on ties and worse proposals. Replacing an incumbent with a claim first archives its original record. Writers serialize per instance.
Source code in MAMUT-routing-tools/MAMUT-routing-lib/src/mamut_routing_lib/td/bks.py
annotate_td_bks_optimality
¶
annotate_td_bks_optimality(
loaded: LoadedTDInstance | str | Path,
optimality: SolverReportedOptimality | dict[str, Any],
objective_function: ObjectiveFunction | None = None,
*,
backend: str = "native",
) -> Path
Attach a solver claim of optimality to the existing incumbent under the declared objective.
The claim must be a SolverReportedOptimality whose target_profile is the
TD profile, and the incumbent must carry an exact evaluation that still verifies.
The legacy proven: true stamp is refused. Reported bounds do not certify the incumbent.