genetics-js-mdccvrp
v1.0.5
Published
Solver for the MDCCVRP using evolutionary algorithms
Downloads
17
Maintainers
Readme
Solver for the Multi Depot Cumulative Capacitated Vehicle Routing Problem
Introduction
The Multi Depot cumulative Capacitated Vehicle routing Problem is an optimizationproblem for vehicle routes which was recently formulated. Its objective is to minimize the arrival time of a fleet of vehicles to a group of clients, taking into account the capacity ofthe vehicles. This problem can be very useful when applied to natural disaster situations, where the arrival time to the possible victims is crucial.
Installation
The package can be installed through npm:
npm install genetics-js-mdccvrp
Usage
There are two ways to use the package, you can either execute the script solve with the CLI or you can integrate the solver in your web application.
CLI
To execute the solver, run the script solve specifying if the algorithm to execute is the memetic or the random algorithm using the commands of the same name with the arguments below.
| Argument | Description | Required | Default | | :------: | ----------------------------- | -------- | ------- | | -f | Instance location | yes | - | | --fs | Fleet size | yes | - | | --cr | Crossover rate | No | 0.8 | | -p | Population size | No | 20 | | -c | Constructive initializer | No | false | | -r | Random initializer | No | true | | --ls | Local search type (LS or ILS) | No | LS | | --ns | Neighborhood size | No | 5 | | -i | Iterations for the ILS | No | 10 | | -g | Maximum generations | No | 100 | | -t | Maximum time of the execution | No | - |
Solver integration
In order to integrate the solver, the algorithm parameters with the type:
SimpleMemeticParams<
FitnessProportionalSelectionParams<
RouteIndividual, List<BaseNode>>, BaseRouteCrossoverParams
>
Then pass them to the algorithm and it can be executed when passed an instance and a fleet size.
import { SimpleMemetic } from 'genetics-js-mdccvrp';
const algorithm = new SimpleMemetic(algorithmParams);
alogorithm.solve(instance, fleetSize);
Implementations
This package has been used to implement the following projects:
- Web solver for the MDCCVRP - Cristo Navarro
Author
- Cristo Navarro - CristoNavarro - ([[email protected]]) - 2021
License
This project is licensed under the MIT License