A C++ implementation of a column generation algorithm for the CVRP [1] using GUROBI's API and CVRPSEP package [2]. In addition, this code uses the LKH heuristic [4] to compute the TSP cost of the initial pool of columns. Note that the LKH code is distributed for academic and non-commercial use only.
Following [1], this code uses a set covering model as the restricted main problem (RMP). Let
The initial RMP pool of columns
A new column is generated by solving the subproblem. Here, a prize collecting travelling salesman problem (PCTSP) is solved using the dual values (
The subtour elimination constraints (9) are separeted using the CVRPSEP package. In this code it is used this fork of the CVRPSEP package which fixes some minor issues. Please refer to [3] for further details.
-
CMake.
-
C++17 compiler or an early version.
-
Boost library (program_options)
-
GUROBI solver (9 or an early version). Academics can obtain it via this link.
Go to the source code folder and to compile type:
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug
cmake --build build
for the debug version or
cmake -H. -Bbuild
cmake --build build
for the release version.
To run with a configuration file:
$ ./build/cg_cvrp -f [configuration file path]
See the "example.cfg" file at the "input" folder for an example of the input configuration file and
$ ./build/cg_cvrp --help
to see usage.
[3] CVRPSEP package SAS software repository.
[4] Lin-Kernighan heuristic (LKH) for solving the traveling salesman problems.
[5] Bixby, A.E., Coullard, C., Simchi-Levi, D. The capacitated prize-collecting traveling salesman problem. Working paper, Department of Industrial Engineering and Engineering Management, Northwestern University, 1997.