acco93 / avxs

This repository contains the code associated with the paper "A Hybrid Metaheuristic for Single Truck and Trailer Routing Problems".

Home Page:https://acco93.github.io/avxs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repository contains the code associated with the paper "A Hybrid Metaheuristic for Single Truck and Trailer Routing Problems".

Table of contents

Abstract

In the paper, we propose a general solution approach for a broad class of vehicle routing problems that all use a single vehicle, composed of a truck and a detachable trailer, to serve a set of customers with known demand and accessibility constraints. A more general problem, called the Extended Single Truck and Trailer Routing Problem (XSTTRP), is used as a common baseline to describe and model this class of problems. In particular, the XSTTRP contains, all together, a variety of vertex types previously only considered separately: truck customers, vehicle customers with and without parking facilities, and parking-only locations. To solve XSTTRP we developed a fast and effective hybrid metaheuristic, consisting of an iterative core part, in which routes that define high-quality solutions are stored in a pool. Eventually, a set-partitioning based post-optimization selects the best combination of routes that forms a feasible solution from the pool. The algorithm is tested on extensively studied literature problems such as the Multiple Depot Vehicle Routing Problem, the Location Routing Problem, the Single Truck and Trailer Routing Problem with Satellite Depots, and the Single Truck and Trailer Routing Problem. Finally, computational results and a thorough analysis of the main algorithm's components on newly designed XSTTRP instances are provided. The obtained results show that the proposed hybrid metaheuristic is highly competitive with previous approaches designed to solve specific specialized problems, both in terms of computing time and solution quality.

Software

Directories and files

The repository contains the following directories and files

  • instances contains the instances used to test the algorithm and a readme file that describes the file formats supported by the algorithm parser.
  • scripts contains a set of utility scripts to build the source code and to reproduce the published results. All the scripts assume that the structure of the directories is the one described in this document.
    • analysis.sh performs the analysis described in the Analysis section of the paper. It automatically takes care to compile the code with the required directives and run the executable with the required input parameters.
    • additional_analysis.sh performs the additional analysis requested in the revision.
    • build.sh compiles the code from the source directory and outputs an executable in the build directory.
    • cmake_install.sh installs cmake (the minimum required version is defined in source/CMakeLists.txt).
    • run.sh performs the experiments as published in the Computational Results of the paper. As for previous scripts, it automatically compiles the code with the required directives and run the executable with the required input parameters.
  • source contains the algorithm source code.
  • build will contain the algorithm executable when the source is compiled with scripts/build.sh. This directory is automatically generated by build.sh if it does not exist.
  • results/ contains the log for the computational results as well as a graphic representation of the solutions found by the algorithm.
  • bks.txt contains the list of the best known solution values for the considered instances. It is used by the algorithm to compute solution gaps.

Requirements

The following programs are needed either to build the code or to perform some extra tasks such as creating pdf files with the graphic representation of the solutions.

To correctly compile and build the executable and to run scripts/build.sh

  • cmake >= 3.10
  • g++ >= 6.3.0*
  • cplex >= 12.8*

To successfully run scripts/run.sh

  • cmake >= 3.10
  • g++ >= 6.3.0*
  • cplex >= 12.8*
  • pdftk
  • pdflatex

* suggested version. Previous (recent) versions should work too.

Build options

You can provide the following optional cmake compilation options

  • ENABLE_STATS turns on the logging of detailed statistics.
  • ENABLE_VERBOSE turns on the logging of very detailed results such as each solution representation and if used in combination with ENABLE_STATS the partial evolution in terms of 2D points (iteration, % gap) of the algorithm averaged over all instances and runs.
  • ENABLE_VND disables randomization in the improvement phase.
  • ENABLE_NGRANULAR turns on complete neighborhood exploration instead of granular one.
  • ENABLE_LONGER_IMPROVEMENT makes the algorithm perform δ = 1000 (instead of δ = 100) possible non improving iterations.
  • ENABLE_OPERATOR_XXX where XXX can be RELOCATE, SWAP, TWOPT, SEGSWAP or ROOTREF turns on the corresponding operator in the local search execution. All operators are enabled by default.
  • ENABLE_POLISHING_PHASE turns on the post-optimization polishing phase. It is enabled by default.
  • ENABLE_BEST_RNEI_ORDER orders the neighborhoods according to their RNEI. It has to be used in combination with ENABLE_VND.

The previous directives can be turn on or off by using -DENABLE_XXXX=ON or -DENABLE_XXXX=OFF, respectively. See the example below or check the scripts into the scripts directory.

Note that it is necessary to recompile the program to apply the changes

cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_VND=ON && cmake --build . --target all -- -j 4

As previously stated, use OFF to disable an already enabled feature

cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_POLISHING_PHASE=OFF && cmake --build . --target all -- -j 4

Usage

The algorithm requires a unique mandatory argument

  • files PATH1 PATH2 ... PATHN where each PATH identifies an instance to be processed.

In addition, you can provide the following optional command line arguments

  • help shows the help and exit
  • runs N where N is an integer value, tells the algorithm to execute N runs for every instance. Default is 1.
  • seed N where N is an integer value, specifies the seed of the std::mt19937 pseudo random number generator. In case of multiple runs, the value N is used as base seed and the real seed is computed as seed + run_number. The default seed is generated using std::random_device.
  • bks PATH specifies where to find the file with the best known solution values. Default is ../bks.txt.
  • near N where N is an integer value, forces the algorithm to use the N-near assignment fitness function during the assignment phase. Default 1-near for instances with fixed costs and 25-near otherwise.
  • rank R where R is a real value, forces the algorithm to use the R-rank assignment fitness function during the assignment phase. Default 1-near for instances with fixed costs and 25-near otherwise.
  • log PATH specifies where to store the log file. Default is a randomly named file in the directory where the executable is run.
  • tex-picture specifies the algorithm to generate the graphic representation of the final solution of each processed instance.

Arguments can be given in any order but must all be provided with --

./avxs --files ../instances/xsttrp/xsttrp25 ../instances/mdvrp/p18 --runs 5 --tex-pictures --log file.txt

License

GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007

About

This repository contains the code associated with the paper "A Hybrid Metaheuristic for Single Truck and Trailer Routing Problems".

https://acco93.github.io/avxs/

License:GNU General Public License v3.0


Languages

Language:TeX 99.5%Language:C++ 0.4%Language:Shell 0.1%Language:SystemVerilog 0.0%Language:CMake 0.0%