Result of running ILS.
This matches PyVRP's Result class interface:
cost/1- Returns the cost of the best solution (infinity if infeasible)feasible?/1- Returns whether the best solution is feasiblebest- The best Solution foundstats- Statistics from the searchnum_iterations- Total iterations performedruntime- Runtime in milliseconds
Summary
Functions
Returns the cost of the best solution.
Returns whether the best solution is feasible.
Returns a summary string of the result.
Types
@type t() :: %ExVrp.IteratedLocalSearch.Result{ best: ExVrp.Solution.t(), num_iterations: non_neg_integer(), runtime: non_neg_integer(), stats: map() }
Functions
@spec cost(t()) :: non_neg_integer() | :infinity
Returns the cost of the best solution.
This is the objective the search minimises: unit_distance_cost times
distance, plus unit_duration_cost times duration, plus the fixed cost of
every vehicle used, plus the prizes of any clients left unvisited.
Returning best.distance instead makes callers rank solutions on one term
of that sum, so a caller comparing independent starts picks on a metric no
start optimised. That matters most when starts settle on different vehicle
counts, or when the distance matrix carries penalties rather than metres.
Returns :infinity if the solution is infeasible, matching PyVRP's behavior.
Returns whether the best solution is feasible.
Returns a summary string of the result.