Evovrp
🧬 Solving MDVRP using evolutionary algorithms.
Install / Use
/learn @mpinta/EvovrpREADME
evovrp
Solving multi-depot vehicle routing problem (MDVRP) using evolutionary algorithms.
Requirements
- Python 3.6+
- Pip
Dependencies in order for the project to run are:
numpy, imageio, matplotlib and NiaPy==2.0.0rc4
You can install them using the setup.py script:
$ git clone https://github.com/mpinta/evovrp
$ cd evovrp
$ python setup.py install
Usage
In main.py import any evolutionary algorithm from the NiaPy library and set the input parameters of the main function:
file_name- location of a dataset file,algorithm- imported evolutionary algorithm from the NiaPy library,iterations- number of iterations,population_size- number of instances inside one generation,phenotype_coding- genotype-to-phenotype coding method;method.Method.FIRSTfor the first andmethod.Method.SECONDfor the second method.
Example
The following code solves p01 MDVRP case from the C-mdvrp dataset using a genetic algorithm of 10 generations, population size of 5 and first genotype-to-phenotype coding method:
from NiaPy.algorithms.basic.ga import GeneticAlgorithm
if __name__ == '__main__':
main('C-mdvrp/p01', GeneticAlgorithm, 50, 5, method.Method.FIRST)
You can run the program with following commands:
$ cd evovrp/evovrp
$ python main.py
Output
Once the evaluation finishes, program returns information about the instance with the best fitness value into the console. It creates .png format images and associated .gif animations for each instance, solving the MDVRP case. Program also creates gif animation of best instances from each generation and a bar graph, showing all fitness values through generations.
Datasets
Used datasets are taken from the University of Málaga - Networking and Emerging Optimization Groups website about vehicle routing problem:
Both used datasets are designed by Cordeau.
Publications
The code was originally used in the following publications:
Pintarič Matic, (2019).
Reševanje problema usmerjanja vozil s pomočjo evolucijskih algoritmov.
Maribor: University of Maribor, Faculty of Electrical Engineering and Computer Science.
Pintarič Matic, Karakatič Sašo, (2019).
Solving multi-depot vehicle routing problem with particle swarm optimization.
In: Iztok Fister Jr., Andrej Brodnik, Matjaž Krnc and Iztok Fister (eds.). Proceedings of the 2019 6th Student Computer Science Research Conference - StuCoSReC, (pp. 53-56).
Koper: University of Primorska Press.
Disclaimer
The goal of the project is not optimization of evolutionary algorithms, but the use of different algorithms to solve the multi-depot vehicle routing problem.
Related Skills
node-connect
338.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
83.6kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
83.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
338.7kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
