The Vehicle Routing Problem (VRP) is a Routing Problem where you seek to service a number of customers with a fleet of (homogeneous or heterogeneous) vehicles starting from one depot. The basic idea is to service clients - represented by nodes in a graph - by the vehicles. Lots of theoric and industrial problems can be modelled as a VRP. The problem’s origins can be traced back to the fifties (see [Dantzig1959] for instance). It includes the TSP (a VRP with one vehicle) as a special case, and is, as such, a computationally complex problem.
[Dantzig1959] |
|
We again use the excellent C++ ePiX library[1] to visualize VRP and CVRP solutions in TSPLIB format.
[1] | The ePiX library uses the engine to create beautiful graphics. |
Overview:
We first introduce the VRP and the TSPLIB instances for the Capacitated Routing Vehicle Problem. The TPSLIB instance format is the de facto format to represent CVRP instances in the scientific community. We then present a basic program to solve the bare VRP. To do so, we show how to interact directly with the underlying CP solver. Next, the CVRP is introduced and explained. Capacities are modelled with Dimensions. Finally, we discuss the multi-depots variant of the VRP in general and how to fix some parts of the routes while letting the CP solver assign the other clients to vehicles, i.e. how to complete the partial solution.
Prerequisites:
Files:
You can find the code in the directory documentation/tutorials/cplusplus/chap10.
The files in this directory are:
Content: