A hybrid genetic algorithm for multi-depot and periodic vehicle routing problems Michel Gendreau CIRRELT and MAGI École Polytechnique de Montréal ROUTE 2011 Sitges, May 31- June 3, 2011
Co-authors Thibaut Vidal, Ph.D student, Université de Montréal and UTT Teodor Gabriel Crainic, co-supervisor, ESG, UQÀM Nadia Lahrichi and Walter Rei, ESG, UQÀM ROUTE 2011, Sitges, May 31-June 3, 2011 2
Outline of the presentation 1) Rich vehicle routing problems: concepts and literature review 2) A hybrid genetic algorithm for the periodic multi-depot VRP 3) Empirical studies on diversity management procedures ROUTE 2011, Sitges, May 31-June 3, 2011 3
Rich Vehicle Routing Problems (1/3) Success story of the vehicle routing problem, but still many challenges to address efficiently real life applications In particular, when solving VRP with many attributes and large size Attributes = extensions of the academic VRP, such as heterogeneous fleet, variable travel times, multi-depots Book by Golden, Raghavan and Wasil : The vehicle routing problem: latest advances and new challenges Several attributes together = rich formulations ROUTE 2011, Sitges, May 31-June 3, 2011 4
Rich Vehicle Routing Problems (2/3) Elements of literature on Rich VRP : Solving Rich VRP models, Workshop Molde (2005) Special issue of CEJOR (2006) edited by Hartl, Hasle, and Janssens Two SINTEF working papers by Bräysy, Gendreau, Hasle, and Løkketangen (2008) Several recent papers dealing with specific Rich VRPs. ROUTE 2011, Sitges, May 31-June 3, 2011 5
Rich Vehicle Routing Problems (3/3) Some very frequent attributes from the literature: Route length and duration Multi-Depot (MDVRP) Periodic (PVRP) Time-Windows Mixed Fleet Multi-Compartment Backhauls Pick-up and deliveries Location routing MDPVRP Appear in many real life problem settings ROUTE 2011, Sitges, May 31-June 3, 2011 6
More details on the MDPVRP Multiple depots Periodic Planning on several days For each customer, acceptable combinations of visits called patterns Goal: Each customer must be assigned to a single depot and a single pattern Routes must be constructed for each depot and day In such a way that the total cost of all the resulting routes is minimized. ROUTE 2011, Sitges, May 31-June 3, 2011 7
Literature on the MDPVRP Heuristics: Sequential or iterative approaches Hadjiconstantinou & Baldacci (1998) Yang and Chu (2000) Heuristics: Integrated approaches Tackle the problem as a whole Parthanadee and Logendran (2006) : Tabu Search for a complex variant of the problem. However, customers may be served from different depots on different days. Crainic et al. (2009) : Integrative Cooperative Search. No complete results published up to now. Preliminary results on the MDPVRPTW Exact approaches: Kang et al. (2005) Baldacci and Mingozzi (2009) ROUTE 2011, Sitges, May 31-June 3, 2011 8
Hybrid genetic algorithm for the MDPVRP (1/6) Existing Hybrid GA s for VRP, VRPTW, MDVRP Few work on periodic problems General Methodology: Evolving a population of solutions by means of genetic operators such as selection, crossover and mutation. Survival of the fittest drives the population towards good solutions. To speed up the evolution, random mutation replaced by a local search based education operator. ROUTE 2011, Sitges, May 31-June 3, 2011 9
Hybrid genetic algorithm for the MDPVRP (2/6) From previous authors: Solution representation : Prins (2004), without trip delimiters Selection operator : Binary Tournament New contributions: Tackling the general problem New operators New diversity management methods ROUTE 2011, Sitges, May 31-June 3, 2011 10
Hybrid genetic algorithm for the MDPVRP (3/6) Search Space: Accepting infeasible solutions not respecting route related constraints : load or duration Always respect the number of vehicles Adaptive penalties: Amount of infeasible solutions is monitored; penalties are adjusted during run time to obtain about 20% feasible solutions naturally Repair operator to obtain more feasible solutions Double population to protect genetic material of feasible solutions ROUTE 2011, Sitges, May 31-June 3, 2011 11
Hybrid genetic algorithm for the MDPVRP (4/6) Double population management: A feasible individual is included in the feasible population An infeasible individual included in the infeasible population probability P rep to be repaired and added in the feasible one Each population (μ+λ) strategy where any new offspring is directly included (and thus can reproduce): Initial populations of μ individuals Each new individual is included in the population As a population reaches the size (μ+λ), we operate the selection of survivors to discard λ individuals Good properties : Profit from new individuals, including those with bad fitness Preserve an elite ROUTE 2011, Sitges, May 31-June 3, 2011 12
Hybrid genetic algorithm for the MDPVRP (5/6) Solution representation Representation as a giant TSP tour without trip delimiters (Prins 2004) In MDPVRP context, a tour for each couple (day, depot) Polynomial «Split» algorithm to obtain the best segmentation of each sequence into routes ROUTE 2011, Sitges, May 31-June 3, 2011 13
Hybrid genetic algorithm for the MDPVRP (6/6) Selection by binary tournament : For each parent, pick randomly two individuals in the population with uniform probability and keep the one with best fitness. Linked with the choice of a fitness evaluation function. ROUTE 2011, Sitges, May 31-June 3, 2011 14
New Crossover operator for the MDPVRP (1/3) New Periodic Crossover with insertions: one offspring inherits information from both parents 1) Choose for each day which parent (or both parents) provide the genetic material 2) Transmit the genetic information from the first parent 3) Complete with information from the second parent 4) Eventually fill the remaining required visits ROUTE 2011, Sitges, May 31-June 3, 2011 15
New Crossover operator for the MDPVRP (2/3) For each couple (day, depot) choosing randomly the amount of information transmitted from parent 1 : Copy the whole sequence of services for this couple, or Do not copy any information for this couple, or Copy a substring In a random order of (day, depot), visits are added from parent 2. A visit is copied only if: The entire sequence of parent 1 has not been copied for this couple The insertion is compatible with at least one pattern of the customer ROUTE 2011, Sitges, May 31-June 3, 2011 16
New Crossover operator for the MDPVRP (3/3) After this process, some customers can have an incomplete pattern : Remaining visits are added after the split algorithm, using a minimum cost insertion criteria. ROUTE 2011, Sitges, May 31-June 3, 2011 17
Education operator (1/2) Two level local search: Route Improvement (RI) dedicated to improve the routes by moving customer or depot visits (nodes). For each node v 1 in random order and each node v 2 in random order, we test insertion, swap, 2-opt, 2-opt* involving v 1 and v 2 (some restrictions if v 1 is a depot). Pattern Improvement (PI) = calculate for each route in each (day/depot) the insertion cost of a customer evaluate the cost of a pattern change and operate if negative. First improvement rule. Stops when all moves have been tested without success. Called in sequence RI-PI-RI. ROUTE 2011, Sitges, May 31-June 3, 2011 18
Education operator (2/2) Speeding-up the local search: Move evaluation in O(1) in RI thanks to Nagata and Bräysy (2009) penalty framework for infeasible solutions with respect to time windows. Granular search: Testing only moves involving correlated nodes (X% close in terms of distance / time-windows) Correlation measure Memories: Remembering the insertion costs in PI. During RI: remembering for each couple (node, route) if the route has changed since last cycle of moves involving the node. ROUTE 2011, Sitges, May 31-June 3, 2011 19
Enhanced diversity management (1/3) Diversity management is crucial to evade premature convergence and obtain high quality solutions. Previous methods to maintain diversity: Prins (2004): dispersal rule based on fitness during insertion in the population Sörensen et Sevaux (2006) «Memetic Algorithm with Population Management (MA PM)»: dispersal rule based on a distance measure We go a step further, and introduce a promotion of diversity during the very evaluation of individuals. ROUTE 2011, Sitges, May 31-June 3, 2011 20
Enhanced diversity management (2/3) Individual evaluation: Biased Fitness is a tradeoff between fitness rank fit(i), and rank in terms of contribution to the diversity dc(i). During selection of the parents: Balance strength with innovation during reproduction, and thus favors exploration of the search space Increased level of diversity in the population. ROUTE 2011, Sitges, May 31-June 3, 2011 21
Enhanced diversity management (3/3) Individual evaluation: Biased Fitness is a tradeoff between fitness rank fit(i), and rank in terms of contribution to the diversity dc(i). During selection of the survivors: Removing the individual I with worst BF(I) also guarantees some elitism in terms of real fitness value. ROUTE 2011, Sitges, May 31-June 3, 2011 22
Experimental setup Problem benchmarks: Cordeau, Gendreau, Laporte (1998) instances for PVRP and MDVRP New instances for MDPVRP derived from the previous benchmarks Instances ranging from 48 to 417 customers, up to a planning horizon of 10 days, and 6 depots. Up to about 900 services for some periodic problems. Experiments conducted on a 2.4 Ghz AMD Opteron 250 CPU Conversion of run-times using Dongarra factors, to compare with other authors ROUTE 2011, Sitges, May 31-June 3, 2011 23
Parameter calibration Genetic algorithms are known to rely on many parameters Finding good parameter values is already a very hard problem, correlation between parameters Often, a lot of research time is dedicated to calibration Meta-calibration setup A metaheuristic to solve the calibration problem P: P Finding suitable parameters for the GA Solution = parameter values Evaluation = launching the GA with these parameters on a training set of instances Solved using the Evolutionary Strategy with Covariance Matrix Adaptation (CMA-ES) of Hansen and Ostermeier (2001) ROUTE 2011, Sitges, May 31-June 3, 2011 24
Results on PVRP instances (1/2) State of the art algorithms then and now: Cordeau, Gendreau, Laporte (1997): Tabu Search Hemmelmayr, Doerner, Hartl (2009): Variable Neighborhood Search Gulczynski, Golden,Wasil (2011): Integer programming + record-to-record travel Benchmark Best approach in 1997 Best approach in 2011 HGSADC "old" set "new" larger set nb customers > 150 Cordeau et al. (1997) Gulczynski et al. (2011) Dev. to BKS : +1.62% +0.94% Cordeau et al. (1997) Hemmelmayr et al. (2009) +2.48% +1.53% Cordeau et al. (1997) Hemmelmayr et al. (2009) +3.23% +2.16% +0.14% +0.38% +0.35% ROUTE 2011, Sitges, May 31-June 3, 2011 25
Results on PVRP instances (2/2) All best known solutions have been retrieved, including 15 optimal results from Baldacci et al. (2010) Many have been improved 19 new BKS Small standard deviation : 0.13% for the previous results Behavior as the termination criterion increases: CGL HDH HDH HDH HGSADC HGSADC HGSADC 15.10 3 it 10 7 it 10 8 it 10 9 it 10 4 it 2.10 4 it 5.10 4 it T 3.96 min 3.09 min --- --- 5.56 min 13.74 min 28.21 min % +1.82% +1.45% +0.76% +0.39% +0.20% +0.12% +0.07% ROUTE 2011, Sitges, May 31-June 3, 2011 26
Results on MDVRP instances (1/2) State of the art algorithms then and now: Cordeau, Gendreau, Laporte (CGL 1997) : Tabu Search Pisinger and Ropke (PR 2007) : Adaptive Large Neighborhood Search Benchmark Best approach in 1997 Best approach in 2011 HGSADC "old" set "new" larger set nb customers > 150 Cordeau et al. (1997) Pisinger and Ropke (2007) +0.58% +0.35% Cordeau et al. (1997) Pisinger and Ropke (2007) +1.85% +0.34% Cordeau et al. (1997) Pisinger and Ropke (2007) +1.40% +0.45% +0.00% -0.04% -0.03% ROUTE 2011, Sitges, May 31-June 3, 2011 27
Results on MDVRP instances (2/2) Results with different running times CGL RP RP HGSADC HGSADC HGSADC 15.10 3 it 25.10 3 it 50.10 3 it 10 4 it 2.10 4 it 5.10 4 it T --- 1.97 min 3.54 min 2.24 min 8.99 min 19.11 min % +0.96% +0.52% +0.34% -0.01% -0.04% -0.06% All best known solutions have been retrieved, including 5 optimal results from Baldacci and Mingozzi (2009) Many have been improved 9 new BKS Very small standard deviation : 0.03% ROUTE 2011, Sitges, May 31-June 3, 2011 28
Results on MDPVRP instances New instances Compare to our BKS from multiple long runs Inst n d t Average Gap % T BKS p01 48 4 4 2019.07 0% 0.35 2019.07 p02 96 4 4 3547.45 0% 1.49 3547.45 p03 144 4 4 4491.08 0,12% 7.72 4480.87 p04 192 4 4 5151.73 0,23% 22.10 5141.17 p05 240 4 4 5605.60 0,49% 30 5570.45 p06 288 4 4 6570.28 0,36% 30 6524.42 p07 72 6 6 4502.06 0,04% 2.18 4502.02 p08 144 6 6 6029.58 0,43% 7.96 6023.98 p09 216 6 6 8310.19 0,90% 27.79 8257.80 p10 288 6 6 9972.35 1,86% 30 9818.42 +0.42% 15.96 min Good overall gap for a hard problem, a relatively small standard deviation of 0.30% One could investigate cooperation schemes to increase performance ROUTE 2011, Sitges, May 31-June 3, 2011 29
Results on CVRP instances The algorithm was tested on the traditional benchmarks from the VRP literature. The 14 instances (p01-p14) of Christodes et al. (1979), ranging from 50 to 199 customers The 20 large-scale instances (pr01-pr20) of Golden et al. (1998) Excellent results were obtained: Average gap of 0.11% compared to 0.10% for Nagata and Bräysy! ROUTE 2011, Sitges, May 31-June 3, 2011 30
Empirical studies on diversity management methods (1/2) Several diversity management methods, average results: HGA : No diversity management method HGA-DR : Dispersal rule on objective space HGA-PM : Dispersal rule on solution space HGA-PD : Promotion of diversity during fitness evaluation Benchmark HGA HGA-DR HGA-PM HGA-PD PVRP MDVRP MDPVRP T 6.86 min 7.01 min 7.66 min 8.17 min % +0.64% +0.49% +0.39% +0.13% T 7.93 min 7.58 min 9.03 min 8.56 min % +1.04% +0.87% +0.25% -0.04% T 25.32 min 26.68 min 28.33 min 40.15 min % +4.80% +4.07% +3.60% +0.44% ROUTE 2011, Sitges, May 31-June 3, 2011 31
Empirical studies on diversity management methods (2/2) Behavior of HGA-PD during a random run: Higher entropy (average distance between two individuals) Better final solution Diversity can increase during run time ROUTE 2011, Sitges, May 31-June 3, 2011 32
Conclusions Hybrid genetic algorithm for a class of rich VRPs, some methodological contributions: Specialized crossover for the MDPVRP Education : multi-level local search, with granularity and memory Diversity management method during fitness evaluation Management of infeasible solutions in a separate population Improvement of the state of the art on all the problems under consideration New promising concepts to generalize Progress towards even more attributes, and real life case studies ROUTE 2011, Sitges, May 31-June 3, 2011 33