Repair operators

The pyvrp.repair module provides operators that are responsible for repairing a Solution after destruction in a large neighbourhood search (LNS) setting.

greedy_repair(solution: Solution, unplanned: list[int], data: ProblemData, cost_evaluator: CostEvaluator) Solution
greedy_repair(routes: list[Route], unplanned: list[int], data: ProblemData, cost_evaluator: CostEvaluator) Solution

Greedy repair operator. This operator inserts each client in the list of unplanned clients into the solution. It does so by evaluating all possible moves and applying the best one for each client, resulting in a quadratic runtime.

Raises:

ValueError: When the solution is empty but the list of unplanned clients is not.