Expand description
The solver module contains basic building blocks for a metaheuristic among with the default implementation.
§Metaheuristic
A metaheuristic is a high-level algorithmic framework that provides a set of guidelines or strategies to develop heuristic optimization algorithms. Examples of metaheuristics include genetic/evolutionary algorithms, tabu search, simulated annealing, variable neighborhood search, (adaptive) large neighborhood search, ant colony optimization, etc.
§Multi-objective decision maker
Most VRPs, frequently used to model real cases, are set up with a single objective (e.g. minimizing the cost of the solution), however the majority of the problems encountered in logistics industry, are multi-objective in nature as the complexity of real-life logistics planning often cannot be reduced to cost only. Such non-cost factors are:
- balancing work across multiple workers
- minimization or maximization of fleet usage
- minimization of unassigned jobs
In most of the cases, these additional factors are contradicting to the cost minimization objective which, in fact, leads to nontrivial multi-objective optimization problem, where no single solution exists that simultaneously optimizes each objective.
§Evolutionary algorithm
An evolutionary algorithm (EA) is a generic population-based metaheuristic optimization algorithm. This crate provides a custom implementation of EA which can be divided into the following steps:
- initialization: on this step, an initial population is created using different construction heuristics.
- main loop begin: enter an evolution loop
- selection: an individual is selected from population. Best-fit individuals have more chances to be selected.
- mutation: a mutation operator is applied to selected individual. Default implementation
uses
ruin and recreate
principle described in next section. - population adjustments: new individual is added to population, then the population is sorted and shrinked to keep it under specific size limits with best-fit individuals and some intermediate.
- main loop end: exit evolution loop when one of termination criteria are met. See
termination
module for details.
As there is no crossover operator involved and offspring is produced from one parent, this algorithm can be characterized as parthenogenesis based EA. This approach eliminates design of feasible crossover operator which is a challenging task in case of VRP.
§Population
A custom algorithm is implemented to maintain diversity and guide the search maintaining trade
of between exploration and exploitation of solution space. See rosomaxa
crate for details.
§Ruin and Recreate principle
A ruin and recreate principle is introduced by Schrimpf et al. (2000)
and key idea here
is to ruin a quite large fraction of the solution and try to restore the solution as best as it
is possible in order to get a new solution better than the previous one. Original algorithm can
be described as a large neighborhood search that combines elements of simulated annealing and
threshold-accepting algorithms, but this crate only reuses ruin/recreate idea as a mutation
operator.
§Additionally..
The solver is not limited by R&R principle, additionally it utilizes some other heuristics and their combinations. They are picked based on their performance in terms of search quality and latency introduced. Reinforcement technics are used here.
Modules§
- processing
- Contains pre and post processing logic.
- search
- The mutation module specifies building blocks for mutation operator used by evolution.
Structs§
- Recreate
Initial Operator - Wraps recreate method as
InitialOperator
- Refinement
Context - A type which encapsulates information needed to perform solution refinement process.
- Solver
- Solves a Vehicle Routing Problem and returns a (solution, its cost) pair in case of success or error description, if solution cannot be found.
- VrpConfig
Builder - Provides the way to get ProblemConfigBuilder with reasonable defaults for VRP domain.
Enums§
- Refinement
Speed - Defines instant refinement speed type.
Traits§
- Heuristic
Filter Extra Property - Extends Extras within a new HeuristicFilterExtraProperty.
- Solution
Weights Solution State - Extends SolutionState within a new SolutionWeightsSolutionState.
Functions§
- create_
context_ operator_ probability - Creates a heuristic operator probability which uses context state.
- create_
default_ heuristic_ operator - Creates default heuristic operator (ruin and recreate) with default parameters.
- create_
default_ init_ operators - Creates default init operators.
- create_
default_ processing - Create default processing.
- create_
elitism_ population - Creates elitism population algorithm.
- create_
scalar_ operator_ probability - Creates a heuristic operator probability which uses
is_hit
method from passed random object. - get_
default_ heuristic - Gets default heuristic.
- get_
default_ telemetry_ mode - Creates default telemetry mode.B
- get_
dynamic_ heuristic - Gets dynamic heuristic using default settings.
- get_
static_ heuristic - Gets static heuristic using default settings.
- get_
static_ heuristic_ from_ heuristic_ group - Gets static heuristic using heuristic group.
Type Aliases§
- DynTermination
- A type alias for domain specific termination type.
- Elitism
Population - A type for elitism population.
- Greedy
Population - A type for greedy population.
- Heuristic
Filter Fn - A type to filter meta heuristics by name. Returns true if heuristic can be used.
- MaxGeneration
Termination - A type for max generation termination.
- MaxTime
Termination - A type for max time termination.
- MinVariation
Termination - A type for min variation termination.
- Problem
Config Builder - A type alias for evolution config builder.
- Rosomaxa
Population - A type for rosomaxa population.
- Target
Composite Termination - A type for composite termination.
- Target
Evolution Strategy - A type alias for domain specific evolution strategy.
- Target
Heuristic - A type alias for domain specific heuristic.
- Target
Heuristic Group - A heuristic group type alias.
- Target
Heuristic Probability - A heuristic probability type alias.
- Target
Population - A type alias for domain specific population.
- Target
Search Operator - A type for domain specific heuristic operator.