This paper presents a mathematical model to solve the vehicle routing problem with soft time windows (VRPSTW) and distribution of products with multiple categories. In addition, we include multiple compartments and trips. Each compartment is dedicated to a single type of product. Each vehicle is allowed to have more than one trip, as long as it corresponds to the maximum distance allowed in a workday. Numerical results show the effectiveness of our model.
The vehicle routing problem (VRP) is a well-known problem in the operation research and combinatorial optimization presented by Dantzig and Ramser [
The vehicle routing problem with time windows (VRPTW) is a variant of the VRP (Figure
Service time interval in VRPTW.
Service time interval in VRPSTW.
The vehicle routing problem with multiple trips (VRPMT) is another variant of the classical VRP. Each vehicle can be scheduled for more than one trip, as long as it corresponds to the maximum distance allowed in the workday [
The vehicle routing problem with multiple compartments (VRPMC) is also a special case of the VRP. Each compartment of the vehicle has a limit and is dedicated to a single type of products [
Many papers present the different views of VRP; there has not been any VRP mathematical model for multiple compartments, trips, and time windows. Several papers presented VRP for single product type. However, in [
In this paper, we address the mathematical model for the VRP for multiple product types, compartments, and trips with soft time windows (VRPMPCMTSTW). The proposed VRP can be regarded as the extension to three problems which are the vehicle routing problem with multiple compartments, the vehicle routing problem with multiple trips, the vehicle routing problem with soft time windows.
The summary of the three mentioned problems is presented in Table
Comparison of the problems.
VRP | VRPMC | VRPMT | VRPSTW | This study | |
---|---|---|---|---|---|
Vehicle | Heter/homo | Single | Heter/homo | Heter/homo | Heter/homo |
Compartment | Single | Multiple | Single | Single | Multiple |
Trip | Single | Single | Multiple | Single | Multiple |
Time window | Not considered | Not considered | Not considered | Considered | Considered |
In this paper, we present our mathematical models in three cases to see the development process of our study. In the first case, we consider the VRP for multiple product types, compartments, and trips where there is not a time window (model 1). Then we consider the case with time window (model 2) and, finally, the case with soft time window (model 3).
From the above content, model 3 generalizes all previous models mentioned in this paper. It is worth pointing out that another goal of the formulation is to try to formulate the mathematical models which are feasible and solvable by available solvers in a reasonable time. In this research, all models are solved by using AIMMS 3.13 on a personal computer. The remainder of the paper is organized as follows. In Section
In this section, we present a mathematical model for the vehicle routing problem for multiple product types, compartments, and trips with soft time windows. The following notations are introduced to formulate the mathematical model.
Every customer can be served by one and only one vehicle. Every vehicle starts and ends only at the central depot. The total demand on one particular route must not exceed the capacity of the vehicle. Each customer must be served in the related hard time window. A service (wait) time in each customer is allowed. The hard time windows must not be violated. The soft time windows can be violated at a fixed cost.
The problem is solved under the following assumptions:
We minimize objective function (
This model can be extended to the model called vehicle routing problem for multiple product types, compartments, and trips with time windows (model 2). In the next model, we include the time windows for each node. Consider
Constraints (
Constraints (
Constraints
Proof of Proposition
The vehicle routing problem for multiple product types, compartments, and trips with time windows can be stated as follows:
Constraints (
Finally we consider the complete the generalization of all models mentioned in this paper. We include soft time windows for each time window allowing the vehicle to enter the depot earlier or later with some penalties. The vehicle routing problem for multiple product types, compartments, and trips with soft time windows (model 3) can then be stated mathematically as
The objective function differs from models 1 and 2 by adding the third component. The objective function is to minimize the sum of the cost of traveled distances, total of costs related to loading products, and the total penalties of the outrage from soft time windows. We then replaced constraints (
Let
Distance from a node
|
|
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
0 | 5 | 11 | 10 | 8 | 7 | 10 | 12 | 14 | 16 | 18 | 14 | 8 | 2 | 14 | 15 |
1 | 5 | 0 | 6 | 8 | 8 | 8 | 6 | 8 | 10 | 12 | 14 | 18 | 20 | 24 | 8 | 6 |
2 | 11 | 6 | 0 | 4 | 7 | 9 | 5 | 10 | 12 | 20 | 25 | 4 | 5 | 6 | 8 | 5 |
3 | 10 | 8 | 4 | 0 | 6 | 10 | 7 | 9 | 12 | 11 | 10 | 8 | 3 | 8 | 10 | 12 |
4 | 8 | 8 | 7 | 6 | 0 | 6 | 5 | 10 | 15 | 10 | 12 | 8 | 6 | 4 | 4 | 6 |
5 | 7 | 8 | 9 | 10 | 6 | 0 | 5 | 12 | 8 | 9 | 10 | 8 | 5 | 12 | 11 | 9 |
6 | 10 | 6 | 5 | 7 | 5 | 5 | 0 | 3 | 6 | 9 | 12 | 15 | 14 | 12 | 16 | 11 |
7 | 12 | 8 | 10 | 9 | 10 | 12 | 3 | 0 | 10 | 12 | 14 | 16 | 18 | 14 | 8 | 2 |
8 | 14 | 10 | 12 | 12 | 15 | 8 | 6 | 10 | 0 | 6 | 8 | 10 | 12 | 14 | 18 | 20 |
9 | 16 | 12 | 20 | 11 | 10 | 9 | 9 | 12 | 6 | 0 | 6 | 6 | 8 | 8 | 10 | 12 |
10 | 18 | 14 | 25 | 10 | 12 | 10 | 12 | 14 | 8 | 6 | 0 | 5 | 13 | 18 | 22 | 20 |
11 | 14 | 18 | 4 | 8 | 8 | 8 | 15 | 16 | 10 | 6 | 5 | 0 | 4 | 8 | 12 | 14 |
12 | 8 | 20 | 5 | 3 | 6 | 5 | 14 | 18 | 12 | 8 | 13 | 4 | 0 | 6 | 9 | 12 |
13 | 2 | 24 | 6 | 8 | 4 | 12 | 12 | 14 | 14 | 8 | 18 | 8 | 6 | 0 | 1 | 2 |
14 | 14 | 8 | 8 | 10 | 4 | 11 | 16 | 8 | 18 | 10 | 22 | 12 | 9 | 1 | 0 | 3 |
15 | 15 | 6 | 5 | 12 | 6 | 9 | 11 | 2 | 20 | 12 | 20 | 14 | 12 | 2 | 3 | 0 |
The time windows for each node
|
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
6 | 10 | 16 | 13 | 15 | 8 | 10 | 8 | 13 | 10 | 11 | 9 | 9 | 9 | 10 | 10 |
|
20 | 11 | 20 | 16 | 17 | 9 | 12 | 10 | 14 | 17 | 14 | 11 | 12 | 10 | 15 | 17 |
The demand at the node
|
|
1 | 2 | 3 | 4 | 5 |
---|---|---|---|---|---|---|
|
0 | 100 | 200 | 200 | 300 | 50 |
|
0 | 100 | 100 | 70 | 30 | 20 |
The demand at the node
|
|
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
---|---|---|---|---|---|---|---|---|---|---|---|
|
0 | 50 | 100 | 120 | 40 | 30 | 60 | 80 | 50 | 130 | 40 |
|
0 | 100 | 90 | 70 | 30 | 20 | 50 | 30 | 40 | 60 | 80 |
The demand at the node
|
|
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
0 | 20 | 100 | 30 | 40 | 10 | 30 | 30 | 60 | 10 | 20 | 40 | 20 | 100 | 20 | 40 |
|
0 | 80 | 60 | 70 | 30 | 20 | 40 | 40 | 10 | 20 | 70 | 20 | 50 | 10 | 50 | 30 |
We assume that there are two vehicle types:
The capacity for compartment
|
|
|
|
---|---|---|---|
|
200 | 200 | 100 |
|
300 | 300 | 200 |
The fixed cost of travelling
|
| |
---|---|---|
|
10 | 6 |
|
500 | 800 |
The cost of loading for product
|
|
|
---|---|---|
|
10 | 6 |
|
4 | 8 |
All models have been coded and solved by AIMMS 3.13 [
The solution for five customers.
Model 1 | Model 2 | Model 3 | |
---|---|---|---|
Objective value | 60346 | 61016 | 60476 |
|
|||
Loading cost | 59860 | 60500 | 59860 |
|
|||
Travel cost | 486 | 516 | 486 |
|
|||
Penalty cost | — | — | 130 |
|
|||
Vehicle 1 | |||
Trip 1 |
|
|
|
Trip 2 |
|
|
|
|
|||
Vehicle 2 | |||
Trip 1 |
|
|
|
Trip 2 |
|
|
|
|
|||
Times (seconds) | 0.37 | 0.27 | 0.5 |
The solution for ten customers.
Model 1 | Model 2 | Model 3 | |
---|---|---|---|
Objective value | 106574 | 110744 | 109130 |
|
|||
Loading cost | 105620 | 109780 | 107840 |
|
|||
Travel cost | 954 | 964 | 1010 |
|
|||
Penalty cost | — | — | 280 |
|
|||
Vehicle 1 | |||
Trip 1 |
|
|
|
Trip 2 |
|
|
|
|
|||
Vehicle 2 | |||
Trip 1 |
|
|
|
Trip 2 |
|
|
|
|
|||
Times (seconds) | 28 | 5 | 11 |
The solution for fifteen customers.
Model 1 | Model 2 | Model 3 | |
---|---|---|---|
Objective value | 74548 | 107098 | 83228 |
|
|||
Loading cost | 73540 | 105900 | 81760 |
|
|||
Travel cost | 1008 | 1198 | 1078 |
|
|||
Penalty cost | — | — | 390 |
|
|||
Vehicle 1 | |||
Trip 1 |
|
|
|
Trip 2 |
|
|
|
|
|||
Vehicle 2 | |||
Trip 1 |
|
|
|
Trip 2 |
|
|
|
|
|||
Times (seconds) | 287 | 1320 | 1599 |
The service time at node
Vehicle 1 | ||||||||
Trip 1 |
|
|
|
|
||||
|
|
|
|
|||||
Trip 2 |
|
|
|
|||||
|
|
|
||||||
|
||||||||
Vehicle 2 | ||||||||
Trip 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Trip 2 |
|
|
|
|
||||
|
|
|
|
The violation degree of the bound for soft time at node
|
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Vehicle 1 | |||||||||||||||
Trip 1 | 0.25 | 0.5 | |||||||||||||
Trip 2 | |||||||||||||||
Vehicle 2 | |||||||||||||||
Trip 1 | 0.5 | 0.45 | |||||||||||||
Trip 2 | |||||||||||||||
|
|||||||||||||||
|
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
|
|||||||||||||||
Vehicle 1 | |||||||||||||||
Trip 1 | |||||||||||||||
Trip 2 | 0.15 | ||||||||||||||
Vehicle 2 | |||||||||||||||
Trip 1 | 0.8 | ||||||||||||||
Trip 2 | 0.15 |
The load of the product
|
Product 1 | Product 2 |
---|---|---|
Vehicle 1, trip 1 | ||
Compartment 1 | 1 | |
Compartment 2 | 1 | |
Compartment 3 | 1 | |
Vehicle 1, trip 2 | ||
Compartment 1 | 1 | |
Compartment 2 | 1 | |
Compartment 3 | 1 | |
Vehicle 2, trip 1 | ||
Compartment 1 | 1 | |
Compartment 2 | 1 | |
Compartment 3 | 1 | |
Vehicle 2, trip 2 | ||
Compartment 1 | 1 | |
Compartment 2 | 1 | |
Compartment 3 | 1 |
The quantity of product
|
Product 1 | Product 2 | ||
---|---|---|---|---|
Moved from |
Delivered at |
Moved from |
Delivered at |
|
Vehicle 1, trip 1 | ||||
|
70 | 10 | 90 | 20 |
5–12 | 60 | 20 | 70 | 50 |
12-11 | 40 | 40 | 20 | 20 |
Vehicle 1, trip 2 | ||||
|
40 | 20 | 150 | 80 |
1–10 | 20 | 20 | 70 | 70 |
Vehicle 2, trip 1 | ||||
|
290 | 100 | 200 | 10 |
13-14 | 190 | 20 | 190 | 50 |
14-15 | 170 | 40 | 140 | 30 |
15–7 | 130 | 30 | 110 | 40 |
7-6 | 100 | 30 | 70 | 40 |
6–8 | 70 | 60 | 30 | 10 |
8-9 | 10 | 10 | 20 | 20 |
Vehicle 2, trip 2 | ||||
|
170 | 30 | 160 | 70 |
3-2 | 140 | 100 | 90 | 60 |
2–4 | 40 | 40 | 30 | 30 |
From the numerical examples, it is to be expected that the optimal values for the case where time windows are allowed are less than the case where the time windows are not allowed. Detailed results on each problem can be found in Tables
In this paper, we present a mathematical model for the vehicle routing problem for multiple product types, compartments, and trips with soft time windows. We have verified our feasibilities and attended the optimal solution for the problems. We use the software package AIMMS to solve the problems on a personal computer. The run times are acceptable. Numerical results show the effectiveness of our model.
The authors declare that there is no conflict of interests regarding the publication of this paper.
The authors would like to thank the referees for their valuable comments and suggestions. This research is supported by the Centre of Excellence in Mathematics, the Commission on Higher Education, Thailand.