Coder Social home page Coder Social logo

mesax1 / isc-cvrp Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 16.98 MB

Code for paper: Machine-Learning Component for Multi-Start Metaheuristics to Solve the Capacitated Vehicle Routing Problem

CMake 0.44% Makefile 0.06% C++ 94.28% C 0.32% Shell 4.05% Python 0.85%
cvrp machine-learning metaheuristic vrp

isc-cvrp's Introduction

Code for paper: Machine-Learning Component for Multi-Start Metaheuristics to Solve the Capacitated Vehicle Routing Problem

Overview

This repository contains the code and the data of the paper: Machine-Learning Component for Multi-Start Metaheuristics to Solve the Capacitated Vehicle Routing Problem. Pre-print available at: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4120102.

Folder structure

Files and shell scripts are structured as follows:

${repo_root_directory}         # e.g. amazon-sagemaker-amazon-routing-challenge-sol
└── GRASP_MLP/                       # GRASP with VND local search and ISC component
    └── src/                 # C++ files
└── ONLY_GRASP/                       # GRASP only with VND local search
    └── src/                 # C++ files
└── RR_GRASP_MLP/                       # GRASP with Ruin-and-Recreate local search and ISC component
    └── src/                 # C++ files
└── RR_ONLY_GRASP/                       # GRASP only with Ruin-and-Recreate local search
    └── src/                 # C++ files   
└── instances/                      # Instances of CVRP with CVRPLIB format
└── results/                       # Results folder
    └── complete_grasp/            #Store results for each iteration of the GRASPS with only local search
    └── consolidated_results/      #Store the consolidated results of the experiments executed using the bash scripts "generate_timed_experiment.sh" or "generate_vnds_timed_experiment.sh
    └── evolution/                 #Store the evolution/convergence of the improvement of a solution during the GRASP execution
    └── features_datasets/         #Store the features that describe initial solutions generated on each iteration of the GRASPS
    └── solutions_datasets/        #Store results for each iteration of the GRASPS with local search and ISC during training phase
    └── validation_solutions/      #Store results for each iteration of the GRASPS with local search and ISC during classification phase
    

├── generate_timed_experiment.sh            # Bash script to reproduce our experiments of Ruin-and-Recreate local search results on a Linux Computer with Bash and SLURM
├── generate_vnds_timed_experiment.sh       # Bash script to reproduce our experiments of VND local search results on a Linux Computer with Bash and SLURM
├── consolidate_rr_results.py       #Python script to consolidate results of the generate_timed_experiment.sh 
├── consolidate_vnd_results.py      #Python script to consolidate results of the generate_vnds_timed_experiment.sh

Requirements

Intel oneAPI DPC++/C++ Compiler

Boost 1.78 library

Running the Experiment

To run the experiment first compile the GRASPs that you want to use (In this case, we show the code examples for the Ruin-and-Recreate variants.

cd RR_GRASP_MLP
make
cd ..
cd RR_ONLY_GRASP
make

Now run the GRASP models to solve a CVRP instance by running the commands

The format is:

SEED = Number of seed to use with the random numbers generator
METHOD = 1 Always
INSTANCE = name of the cvrp instance to solve, such as X-n979-k58.vrp
./grasp_mlp $SEED $METHOD $INSTANCE

First, GRASP with only Ruin-and-Recreate

cd RR_ONLY_GRASP/
./only_grasp 10 1 X-n101-k25.vrp
cd ..

Second, GRASP with Ruin-and-Recreate and ISC

cd RR_GRASP_MLP/
./grasp_mlp 10 1 X-n101-k25.vrp
cd ..

The results will be stored in the folder

└── results/ 

Reproducing the results of our work

On a Linux computer, with Bash and Slurm, such as the Apolo supercomputer from Universidad EAFIT https://www.eafit.edu.co/apolo:

  1. Clone this repository
mkdir GRASP_ISC
cd GRASP_ISC
git clone https://github.com/mesax1/ISC-CVRP.git

If necessary, load C++ modules, with the Intel compiler, boost library, Python

module load intel/2022_oneAPI-update1 boost-1.78.0-gcc-11.2.0-ga5km6r
  1. Compile the different GRASP codes
cd RR_GRASP_MLP
make
cd ..
cd RR_ONLY_GRASP
make
cd GRASP_MLP
make
cd ..
cd ONLY_GRASP
make
  1. Execute the experiments bash script 3.1 Ruin-and-recreate local search
generate_timed_experiment.sh

3.2 VND local search

generate_vnds_timed_experiment.sh
  1. When the experiments end, execute the results consolidation script 4.1 Ruin-and-recreate local search
consolidate_rr_results.py

4.2 VND local search

consolidate_vnd_results.py
  1. The results are stored in the /results/consolidated_results/ folder

isc-cvrp's People

Contributors

mesax1 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

tingyingwu2010

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.