ExVrp.MinimiseFleet (ExVrp v0.4.2)

Copy Markdown View Source

Fleet minimisation for VRP instances.

Attempts to reduce the number of vehicles needed to achieve a feasible solution to the given problem instance, subject to a stopping criterion.

Warning

This function is currently unable to solve instances with multiple vehicle types. Support for such a setting may be added in future versions.

Summary

Functions

Attempts to reduce the number of vehicles needed to achieve a feasible solution to the given problem instance.

Same as minimise/3 but raises on error.

Functions

minimise(model, stop, opts \\ [])

@spec minimise(ExVrp.Model.t(), ExVrp.StoppingCriteria.t(), keyword()) ::
  {:ok, ExVrp.VehicleType.t()} | {:error, String.t()}

Attempts to reduce the number of vehicles needed to achieve a feasible solution to the given problem instance.

Parameters

  • model - The VRP model with a given vehicle composition
  • stop - Stopping criterion that determines how much effort to spend
  • opts - Options:
    • :seed - Seed value for RNG (default: 0)

Returns

Returns {:ok, vehicle_type} with the smallest fleet composition that admits a feasible solution, or {:error, reason} if validation fails.

Raises

Returns an error when the instance contains more than one vehicle type or when the instance contains optional clients.

Examples

{:ok, vehicle_type} = MinimiseFleet.minimise(model, StoppingCriteria.max_iterations(100))

minimise!(model, stop, opts \\ [])

Same as minimise/3 but raises on error.