This repository contains the code associated with the paper "A Hybrid Metaheuristic for Single Truck and Trailer Routing Problems".
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.
avxs
algorithm [Stable version]xmm
XSTTRP map maker [Active repository]
The repository contains the following directories and files
instances
contains the instances used to test the algorithm and areadme
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 thesource
directory and outputs an executable in thebuild
directory.cmake_install.sh
installscmake
(the minimum required version is defined insource/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 withscripts/build.sh
. This directory is automatically generated bybuild.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.
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.10g++
>= 6.3.0*cplex
>= 12.8*
To successfully run scripts/run.sh
cmake
>= 3.10g++
>= 6.3.0*cplex
>= 12.8*pdftk
pdflatex
* suggested version. Previous (recent) versions should work too.
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 withENABLE_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
whereXXX
can beRELOCATE
,SWAP
,TWOPT
,SEGSWAP
orROOTREF
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 withENABLE_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
The algorithm requires a unique mandatory argument
files PATH1 PATH2 ... PATHN
where eachPATH
identifies an instance to be processed.
In addition, you can provide the following optional command line arguments
help
shows the help and exitruns N
whereN
is an integer value, tells the algorithm to executeN
runs for every instance. Default is1
.seed N
whereN
is an integer value, specifies the seed of thestd::mt19937
pseudo random number generator. In case of multiple runs, the valueN
is used as base seed and the real seed is computed asseed + run_number
. The default seed is generated usingstd::random_device
.bks PATH
specifies where to find the file with the best known solution values. Default is../bks.txt
.near N
whereN
is an integer value, forces the algorithm to use theN-near
assignment fitness function during the assignment phase. Default1-near
for instances with fixed costs and25-near
otherwise.rank R
whereR
is a real value, forces the algorithm to use theR-rank
assignment fitness function during the assignment phase. Default1-near
for instances with fixed costs and25-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
GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007