6. Solving the MT-VRPB using a Collaborative Sequential Mat-heuristic approach
6.2. The Collaborative Sequential Approach for the MT-VRPB
140
141 Phase I: Initial solution –sweep-first-assignment-second approach (see Section 5.2) Phase II: Two-Level VNS Algorithm (see Sections 5.3 & 5.4)
Phase III: Solving the Multiple Trips aspect using the BPP (see Section 5.5) Phase IV: Solve the mathematical model using CPLEX
a. Choose the best solution k (in terms of feasibility, i.e., solution without overtime) from the data structure
b. If overtime is used in the solution k, then go to d Else, go to c
c. Prepare MIPstart for CPLEX
MIPstart = k [MIPstrat represents a feasible solution]
Call CPLEX_model and run until total allocated time of 2 hours is reached
Report optimal/incumbent solution
d. Set: [where represents CPLEX_model objective value and best heuristic solution cost with overtime]
Call CPLEX_model and run until total allocated time of 2 hours is reached
Report optimal/incumbent solution
Figure 6.1: The CSMH approach phases for the MT-VRPB
Phase II:
In Phase II, the Two-level VNS mechanism is used to improve the initial solution and obtain a pool of solutions. The Two-Level VNS is a composite mechanism that comprises two levels, called outer and inner levels. Several neighbourhood structures and local search refinement routines (developed in Section 5.3) are used to achieve a balanced diversification and intensification within the levels during the search process.
142 For both levels, a subset of neighbourhoods and a subset of local search refinement routines are proposed. These local search refinement routines are embedded within a multi-layer local search framework. For further details, see Section 5.4.
Phase III:
Phase III determines the multiple trip packing of the routes in the solutions by solving the Bin Packing Problem which is based on the pool of solutions obtained in Phase II.
For each solution in the pool, the BPP is solved by calling CPLEX optimiser within the Microsoft Visual Studio Environment followed by a repair mechanism if necessary known as the Bisection Method. Here, bin capacity is gradually increased by a certain percentage iteratively until routes are feasibly packed into bins; see Section 5.5 for more details.
Phase IV:
Phase IV chooses the best MT-VRPB solution from the data structure and passes it on to the CPLEX optimiser using a mechanism called mixed integer programming start
‘MIPstart’. For this stage the mathematical formulation model of the MT-VRPB is coded in C++ programming language within the Microsoft Visual Studio Environment that calls the CPLEX optimiser that uses the best packed solution from the Phase III as an incumbent solution. The MIPstart is explained in the next section.
Use of the MIPstart mechanism
The MIPstart is a mechanism provided by the IBM ILOG CPLEX Optimisation Studio through which one can provide the CPLEX optimiser with an initial solution. For instance, a first or second integer solution could be from a MIP problem which was
143 found previously or a feasible solution from a heuristic. The MIPstart may include various types of variables such as integer variables, semi-continuous variables and binary variables etc. An MIP starting variable/s can be established using some methods.
όor Concert Technology application users, the method ‘addMIPStart ‘is usedν whereas for the Callable Library applications method is called ‘CPXaddmipstarts’. Since we are using Concert Technology in our application, the former method is used. For more information on the types of variables see User’s εanual for CPδEX V12.5.1.
Preparing the MIP start for CPLEX optimiser:
If the chosen solution from the data structure is feasible with respect to the given planning period T, then the MIPstart variables have no problem in working with the formulation of the MT-VRPB. However if the chosen solution is not feasible in terms of T then the MIPstart will not take it as an input solution. This is because our basic formulation in Chapter 4 does not allow overtime to be used.
Basic Modification:
To overcome this hurdle, we have added constraint (6.1) in our MT-VRPB model formulation which enables the infeasible solutions as workable input bound for the MIPstart.
(6.1) Where, represents the objective value in our CPLEX model and the best heuristic solution cost (i.e., best solution with overtime chosen from data structure ). Note that this constraint is employed automatically for the False MIPstart condition (i.e.,
144 when none of the packed solutions is feasible in terms of maximum driving time and an infeasible (i.e., solution with overtime) solution is chosen).
The C++ programming language code that we have used to add the MIPstart in our model is provided in Appendix A. As it can be seen that we have two decision variables in our formulation where R � j represents the amount delivered/picked up on arc
and X � j � is a decision variable that represents X � j � if vehicle
travels arc , 0 otherwise. At this stage the solution found by the Two-Level VNS approach is prepared in a format that is understandable by CPLEX interactive optimiser.
Therefore, two multidimensional arrays represented as R VNS � j (integer in type) and
X VNS � j � (0, 1 in type) are created that contain the heuristic solution. Then these
(i.e., R VNS � j and X VNS � j � ) multidimensional arrays are first flattened into one-dimensional arrays (since CPLEX converts all multidimensional arrays into one- dimensional arrays and then starts working on them) and then added to the respective decision variable arrays (i.e., R � j and X � j � ) using ‘startVal.add’ method.
Transformation to CPLEX and an illustrative example:
Since our MT-VRPB formulation model is coded in C++ programming language, and therefore adding a MIPstart to a model that is implemented in the C++ API (Application Programming Interface) needs ‘IloCplex::addMIPStart’ method provided by ILOG IBM CPLEX 12.5. Moreover, we need to write and pass the heuristic solution in such format that is understandable by the CPLEX optimiser. The idea is to provide a copy of each decision variable with its corresponding values while the decision variables need to be the same type and same dimension. For example if CPLEX uses we need to provide another variable say with its values.
145 Test instance characteristics
n=6 (number of customers] (1,…,4, 5, 6) where 1 to 4 are deliveries and last 2 are backhauls b=2 [number of backhaul customer]
T=195 [planning period (maximum driving time)]
C=2000 [vehicle capacity]
v=2 [number of total Bins/vehicles]
q = [1000,800,500,1200,1500,300] [demand/supply]
Dist= [0,49,42,37,31,28,23]
[49,0,23,21,24,30,40]
[42,23,0,34,33,38,23]
[37,21,34,0,5,11,38] [distance matrix]
[31,24,33,5,0,6,35]
[28,30,38,11,6,0,35]
[23,40,23,38,35,35,0]
Solution routes obtained for test instance above where and are served by bin (vehicle) 1 and is served by bin 2.
Route 1:
dist demand/supply Dep: 0
Cust: 1 49.00 1500 Cust: 3 21.00 500 Cust: 5 11.00 0 Dep: 0 28.00 1500
C L_load B_load EmptSpace
1500 1500 0 0 1500 1500 0
Cost/Distance = 109.00
Route 2:
dist demand/supply Dep: 0
Cust: 2 42.00 800 Cust: 6 23.00 0 Dep: 0 23.00 300
C L_load B_load EmptSpace
1500 800 700 1500 300 1200
Cost/Distance = 88.00
Route 3:
dist demand/supply Dep: 0
Cust: 4 31 1200 Dep: 0 31 0
C L_load B_load EmptSpace
1500 1200 300 1500 0 1500
Cost/Distance = 62.00
Transforming the solution routes to CPLEX understandable format
R_VNS[i][j] =
0 1 2 3 4 5 6 0 0 1500 800 0 1200 0 0 1 0 0 0 500 0 0 0 2 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 5 1500 0 0 0 0 0 0 6 300 0 0 0 0 0 0
X_VNS[i][j][k] =
0 1 2 3 4 5 6 0 0 1 1 0 1 0 0 1 0 0 0 1 0 0 0 2 0 0 0 0 0 0 1 3 0 0 0 0 0 1 0 4 1 0 0 0 0 0 0 5 1 0 0 0 0 0 0 6 1 0 0 0 0 0 0
Figure 6.2: MIPstart construction for the MT-VRPB test instance
Depot
Depot
146 As an example, in our case, we construct a MIPstart as shown in Figure 6.2 which shows the characteristics of the test instance and how R_VNS and X_VNS multidimensional arrays are constructed.