ExVrp.IteratedLocalSearch.Result (ExVrp v0.4.2)

Copy Markdown View Source

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 feasible
  • best - The best Solution found
  • stats - Statistics from the search
  • num_iterations - Total iterations performed
  • runtime - 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

t()

@type t() :: %ExVrp.IteratedLocalSearch.Result{
  best: ExVrp.Solution.t(),
  num_iterations: non_neg_integer(),
  runtime: non_neg_integer(),
  stats: map()
}

Functions

cost(result)

@spec cost(t()) :: non_neg_integer() | :infinity

Returns the cost of the best solution.

Returns :infinity if the solution is infeasible, matching PyVRP's behavior.

feasible?(result)

@spec feasible?(t()) :: boolean()

Returns whether the best solution is feasible.

summary(result)

@spec summary(t()) :: String.t()

Returns a summary string of the result.