You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Capacitated vehicle routing problem (CVRP) column generation algorithm
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.
Column generation algorithm (CG)
Following [1], this code uses a set covering model as the restricted main problem (RMP). Let $G = (V, E)$ be an undirected graph, $K$ a set of vehicles with capacity of $Q$, and let vertex 0 be the depot and vertices $V' = V \setminus {0}$ be the customers. Consider that there is a demand $d_i$ for each $i \in V'$ and there is a cost $w_ij$ associated to each edge $(i, j) \in E$. Also, let $R$ be a set of routes and $c_r$ the cost of route $r \in R$. The RMP is defined as below:
The initial RMP pool of columns $R$ is generated as following. First, each vertex is randomly assigned to one of the $|K|$ vehicles where the capacity can hold the vertex demand. Then, we use the LKH [4] algorithm to find a route (TSP solution) for each vehicle.
A new column is generated by solving the subproblem. Here, a prize collecting travelling salesman problem (PCTSP) is solved using the dual values ($\pi_i$) of the main problem as the visiting prizes as described by [1, 5]. The PCTSP formulation is defined as follows:
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.
Prerequisites
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.
[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.