Manages and dynamically adjusts penalty weights for constraint violations.
This is a direct port of PyVRP's PenaltyManager. It tracks the feasibility of registered solutions and adjusts penalties to target a specific feasibility rate (default 65%). This balances exploration between feasible and infeasible solution space.
Summary
Functions
Creates a CostEvaluator using the current penalty values.
Creates a PenaltyManager with initial penalties computed from problem data.
Creates a CostEvaluator using maximum penalty values. Used for final solution evaluation.
Creates a new PenaltyManager with explicit initial penalties.
Returns the current penalties as a tuple.
Registers a solution and updates penalties if needed.
Types
Functions
Creates a CostEvaluator using the current penalty values.
@spec init_from(reference(), ExVrp.PenaltyManager.Params.t()) :: t()
Creates a PenaltyManager with initial penalties computed from problem data.
This mirrors PyVRP's PenaltyManager.init_from() - it computes reasonable
initial penalty values based on the problem's cost structure.
Creates a CostEvaluator using maximum penalty values. Used for final solution evaluation.
@spec new([float()], float(), float(), ExVrp.PenaltyManager.Params.t()) :: t()
Creates a new PenaltyManager with explicit initial penalties.
Returns the current penalties as a tuple.
Registers a solution and updates penalties if needed.
Tracks the feasibility of the solution across load, time window, and distance
dimensions. After solutions_between_updates registrations, penalties are
adjusted to target the configured feasibility rate.