# On the Use of Learnheuristics in Vehicle Routing Optimization Problems with Dynamic Inputs

^{1}

^{2}

^{3}

^{4}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Problem Description

## 3. Literature Review

#### 3.1. Literature on the DVRP

#### 3.2. Literature on Metaheuristics and Statistical Learning Hybridization

## 4. Proposed Methodology

#### 4.1. Metaheuristic Algorithm

#### 4.2. Statistical Learning Model

#### 4.3. Hybridization of the Metaheuristic Algorithm and the Statistical Learning Model

Algorithm 1 Procedure to build a DVRP solution using the BR-CWS heuristic. |

1: procedure BuildDVRPsol(inputs)2: solution ← generateBaseSolution(inputs) ▹inputs: coordinates, demands and vehicles’ capacity 3: savings ← computeSavings(solution, whiteBox) ▹ edges list decreasingly sorted by savings 4: while (savings is not empty) do5: index ← generate random number ▹ given probability distribution6: edge ← get edge from savings by index7: savings ← delete edge from savings8: if (mergeFeasible(edge)) then9: route ← emptyRoute 10: route ← mergeRoutes(edge, solution) 11: realCost ← blackBox.getRealCost(route) 12: solution.update(realCost) ▹ update solution with the real cost of the route 13: whiteBox.update(route, realCost) ▹ update White Box 14: savings ← computeSavings(solution, whiteBox) ▹ update savings 15: end if16: end while17: return $solution$18: end procedure |

Algorithm 2 Procedure to compute the savings list. |

1: procedure ComputeSavings(solution, whiteBox)2: savings ← emptyList 3: exteriorNodes ← getExteriorNodes(nodes) 4: for $i=1$ to exteriorNodes.size $-1$ do5: for $j=i+1$ to exteriorNodes.size do 6: iRoute ← getRoute(exteriorNodes(i) 7: jRoute ← getRoute(exteriorNodes(j)) 8: mergedRoute ← mergeRoutes(iRoute, jRoute) 9: iRealCost ← getCost(iRoute) ▹ Black Box 10: jRealCost ← getCost(jRoute) 11: mergedPredictedCost ← whiteBox.predictCost(mergedRoute, solution) ▹ Based on the state of the problem 12: routeSavings ← iRealCost + jRealCost - mergedPredictedCost 13: add routeSavings to savings14: end for15: end for16: savings.sort ▹ Sort in descending order 17: return savings18: end procedure |

## 5. Computational Experiments

^{®}Core

^{™}i5-8250U @ $1.60$ GHz and 8 GB of RAM has been used to execute the application.

#### 5.1. Description of Instances

#### 5.2. Parameters of the Algorithm and the Tests

#### 5.3. Computational Results

## 6. Analysis of the Results

## 7. Conclusions

## Author Contributions

## Funding

## Acknowledgments

## Conflicts of Interest

## References

- Demir, E.; Bektaş, T.; Laporte, G. A review of recent research on green road freight transportation. Eur. J. Oper. Res.
**2014**, 237, 775–793. [Google Scholar] [CrossRef] [Green Version] - Reyes, L.; Calvet, L.; Juan, A.; Faulin, J.; Bove, L. Sustainable urban freight transport: A multi-depot vehicle routing problem considering different cost dimensions. J. Heuristics
**2018**. [Google Scholar] [CrossRef] - Faulin, J.; Grasman, S.; Juan, A.; Hirsch, P. Sustainable Transportation and Smart Logistics: Decision-Making Models and Solutions; Elsevier: Amsterdam, The Netherlands, 2018. [Google Scholar]
- Juan, A.A.; Mendez, C.A.; Faulin, J.; de Armas, J.; Grasman, S.E. Electric vehicles in logistics and transportation: A survey on emerging environmental, strategic, and operational challenges. Energies
**2016**, 9, 86. [Google Scholar] [CrossRef] - Demartini, M.; Pinna, C.; Aliakbarian, B.; Tonelli, F.; Terzi, S. Soft Drink Supply Chain Sustainability: A Case Based Approach to Identify and Explain Best Practices and Key Performance Indicators. Sustainability
**2018**, 10, 3540. [Google Scholar] [CrossRef] - Demartini, M.; Orlandi, I.; Tonelli, F.; Anguitta, D. A manufacturing value modeling methodology (MVMM): A value mapping and assessment framework for sustainable manufacturing. In Proceedings of the International Conference on Sustainable Design and Manufacturing, Bologna, Italy, 26–28 April 2017; Springer: Berlin, Germany, 2017; pp. 98–108. [Google Scholar]
- Eurostat. Sustainable Development in the European Union: 2015 Monitoring Report of the EU Sustainable Development Strategy; European Union: Brussels, Belgium, 2015; pp. 1–351. [Google Scholar]
- Cáceres-Cruz, J.; Arias, P.; Guimarans, D.; Riera, D.; Juan, A.A. Rich vehicle routing problem: A survey. ACM Comput. Surv. (CSUR)
**2015**, 47, 32. [Google Scholar] [CrossRef] - Cassettari, L.; Demartini, M.; Mosca, R.; Revetria, R.; Tonelli, F. A Multi-Stage Algorithm for a Capacitated Vehicle Routing Problem with Time Constraints. Algorithms
**2018**, 11, 69. [Google Scholar] [CrossRef] - Dutkiewicz, L.; Kucharska, E.; Raczka, K.; Grobler-Debska, K. ST method-based algorithm for the supply routes for multilocation companies problem. In Knowledge, Information and Creativity Support Systems: Recent Trends, Advances and Solutions; Springer: Berlin, Germany, 2016; pp. 123–135. [Google Scholar]
- Friedman, J.; Hastie, T.; Tibshirani, R. The Elements of Statistical Learning; Springer Series in Statistics; Springer: New York, NY, USA, 2001; Volume 1. [Google Scholar]
- Gendreau, M.; Potvin, J.Y. Handbook of Metaheuristics; Springer: Berlin, Germany, 2010; Volume 2. [Google Scholar]
- Calvet, L.; Ferrer, A.; Gomes, M.I.; Juan, A.A.; Masip, D. Combining statistical learning with metaheuristics for the multi-depot vehicle routing problem with market segmentation. Comput. Ind. Eng.
**2016**, 94, 93–104. [Google Scholar] [CrossRef] - Calvet, L.; Armas, J.D.; Masip, D.; Juan, A.A. Learnheuristics: Hybridizing metaheuristics with machine learning for optimization with dynamic inputs. Open Math.
**2017**, 15, 261–280. [Google Scholar] [CrossRef] - Wilson, N.; Sussman, J.; Wong, H. Scheduling Algorithms for a Dial-a-Ride System; PB 201 808; Massachusetts Institute of Technology, Urban Systems Laboratory: Cambridge, MA, USA, 1971. [Google Scholar]
- Ichoua, S.; Gendreau, M.; Potvin, J.Y. Vehicle dispatching with time-dependent travel times. Eur. J. Oper. Res.
**2003**, 144, 379–396. [Google Scholar] [CrossRef] - Kok, A.L.; Hans, E.W.; Schutten, J.M. Vehicle routing under time-dependent travel times: The impact of congestion avoidance. Comput. Oper. Res.
**2012**, 39, 910–918. [Google Scholar] [CrossRef] [Green Version] - Ichoua, S.; Gendreau, M.; Potvin, J.Y. Exploiting Knowledge About Future Demands for Real-Time Vehicle Dispatching. Transp. Sci.
**2006**, 40, 211–225. [Google Scholar] [CrossRef] [Green Version] - Pillac, V.; Guéret, C.; Medaglia, A.L. An event-driven optimization framework for dynamic vehicle routing. Decis. Support Syst.
**2012**, 54, 414–423. [Google Scholar] [CrossRef] [Green Version] - Fleischmann, B.; Gietz, M.; Gnutzmann, S. Time-Varying Travel Times in Vehicle Routing. Transp. Sci.
**2004**, 38, 160–173. [Google Scholar] [CrossRef] - Van Woensel, T.; Kerbache, L.; Peremans, H.; Vandaele, N. Vehicle routing with dynamic travel times: A queueing approach. Eur. J. Oper. Res.
**2008**, 186, 990–1007. [Google Scholar] [CrossRef] - Sáez, D.; Cortés, C.E.; Núñez, A. Hybrid adaptive predictive control for the multi-vehicle dynamic pick-up and delivery problem based on genetic algorithms and fuzzy clustering. Comput. Oper. Res.
**2008**, 35, 3412–3438. [Google Scholar] [CrossRef] - Avci, M.; Topaloglu, S. A hybrid metaheuristic algorithm for heterogeneous vehicle routing problem with simultaneous pickup and delivery. Expert Syst. Appl.
**2016**, 53, 160–171. [Google Scholar] [CrossRef] - Psaraftis, H.N.; Wen, M.; Kontovas, C.A. Dynamic Vehicle Routing Problems: Three Decades and Counting. Networks
**2016**, 67, 3–31. [Google Scholar] [CrossRef] - Talbi, E.G. Combining metaheuristics with mathematical programming, constraint programming and machine learning. Ann. Oper. Res.
**2016**, 240, 171–215. [Google Scholar] [CrossRef] - Jourdan, L.; Dhaenens, C.; Talbi, E.G. Using Datamining Techniques to Help Metaheuristics: A Short Survey; Hybrid Metaheuristics; Springer: Berlin, Heidelberg, 2006; pp. 57–69. [Google Scholar]
- Corne, D.; Dhaenens, C.; Jourdan, L. Synergies between operations research and data mining: The emerging use of multi-objective approaches. Eur. J. Oper. Res.
**2012**, 221, 469–479. [Google Scholar] [CrossRef] - Zhang, J.; Zhang, Z.H.; Lin, Y.; Chen, N.; Gong, Y.J.; Zhong, J.H.; Chung, H.S.; Li, Y.; Shi, Y.H. Evolutionary computation meets machine learning: A survey. IEEE Computat. Intell. Mag.
**2011**, 6, 68–75. [Google Scholar] [CrossRef] - Martí, R.; Lozano, J.A.; Mendiburu, A.; Hernando, L. Multi-start methods. In Handbook of Heuristics; Springer: Berlim, Germany, 2016; pp. 1–21. [Google Scholar]
- Clarke, G.; Wright, J.W. Scheduling of Vehicles from a Central Depot to a Number of Delivery Points. Oper. Res.
**1964**, 12, 568–581. [Google Scholar] [CrossRef] - Faulin, J.; Juan, A.A. The ALGACEA-1 method for the capacitated vehicle routing problem. Int. Trans. Oper. Res.
**2008**, 15, 599–621. [Google Scholar] [CrossRef] - Juan, A.A.; Faulin, J.; Ruiz, R.; Barrios, B.; Caballé, S. The SR-GCWS hybrid algorithm for solving the capacitated vehicle routing problem. Appl. Soft Comput.
**2010**, 10, 215–224. [Google Scholar] [CrossRef] - Dominguez, O.; Juan, A.A.; Faulin, J. A biased-randomized algorithm for the two-dimensional vehicle routing problem with and without item rotations. Int. Trans. Oper. Res.
**2014**, 21, 375–398. [Google Scholar] [CrossRef] - Juan, A.A.; Pascual, I.; Guimarans, D.; Barrios, B. Combining biased randomization with iterated local search for solving the multidepot vehicle routing problem. Int. Trans. Oper. Res.
**2015**, 22, 647–667. [Google Scholar] [CrossRef] - Dominguez, O.; Juan, A.A.; Barrios, B.; Faulin, J.; Agustin, A. Using biased randomization for solving the two-dimensional loading vehicle routing problem with heterogeneous fleet. Ann. Oper. Res.
**2016**, 236, 383–404. [Google Scholar] [CrossRef] - Dominguez, O.; Guimarans, D.; Juan, A.A.; de la Nuez, I. A biased-randomised large neighbourhood search for the two-dimensional vehicle routing problem with backhauls. Eur. J. Oper. Res.
**2016**, 255, 442–462. [Google Scholar] [CrossRef] - de Armas, J.; Ferrer, A.; Juan, A.A.; Lalla-Ruiz, E. Modeling and solving the non-smooth arc routing problem with realistic soft constraints. Expert Syst. Appl.
**2018**, 98, 205–220. [Google Scholar] [CrossRef] - Juan, A.A.; Lourenço, H.R.; Mateo, M.; Luo, R.; Castella, Q. Using iterated local search for solving the flow-shop problem: Parallelization, parametrization, and randomization issues. Int. Trans. Oper. Res.
**2014**, 21, 103–126. [Google Scholar] [CrossRef] - Ferrer, A.; Guimarans, D.; Ramalhinho, H.; Juan, A.A. A BRILS metaheuristic for non-smooth flow-shop problems with failure-risk costs. Expert Syst. Appl.
**2016**, 44, 177–186. [Google Scholar] [CrossRef] [Green Version] - Martin, S.; Ouelhadj, D.; Beullens, P.; Ozcan, E.; Juan, A.A.; Burke, E.K. A multi-agent based cooperative approach to scheduling and routing. Eur. J. Oper. Res.
**2016**, 254, 169–178. [Google Scholar] [CrossRef] [Green Version] - Grasas, A.; Juan, A.A.; Faulin, J.; de Armas, J.; Ramalhinho, H. Biased Randomization of Heuristics using Skewed Probability Distributions: A survey and some applications. Comput. Ind. Eng.
**2017**, 110, 216–228. [Google Scholar] [CrossRef] - Keith, T.Z. Multiple Regression and Beyond: An Introduction to Multiple Regression and Structural Equation Modeling; Routledge: Abingdon-on-Thames, UK, 2014. [Google Scholar]
- Czarn, A.; MacNish, C.; Vijayan, K.; Turlach, B.; Gupta, R. Statistical exploratory analysis of genetic algorithms. IEEE Trans. Evolut. Comput.
**2004**, 8, 405–421. [Google Scholar] [CrossRef]

**Figure 1.**Diagram of the learnheuristics methodology applied to construct a single solution for the DVRP.

**Figure 2.**Multiple boxplots comparing the gaps of the different costs relative to the DRC by instance set with a uniformly distributed error term $\u03f5\in [-{10}^{-3},{10}^{-3}]$.

**Figure 3.**Multiple boxplots comparing the gaps of the different costs relative to the DRC with a uniformly distributed error term $\u03f5\in [-{10}^{-3},{10}^{-3}]$.

**Table 1.**Results for the static and dynamic approaches with a uniformly distributed error term $\u03f5\in [-{10}^{-3},{10}^{-3}]$.

Instances | Cost | # Routes | Gapw.r.t.DRC (%) | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|

Name | # Nodes | vCap | DFC | DRC | SRC | SFC | Dynamic | Static | DFC | SRC | SFC |

A-n32-k5 | 35 | 100 | 864.04 | 863.05 | 871.49 | 816.73 | 5 | 5 | 0.11 | 0.98 | −5.37 |

A-n38-k5 | 41 | 100 | 749.47 | 749.08 | 866.13 | 756.09 | 5 | 6 | 0.05 | 15.63 | 0.94 |

A-n55-k9 | 62 | 100 | 1096.38 | 1096.97 | 1212.64 | 1111.01 | 9 | 9 | −0.05 | 10.54 | 1.28 |

A-n60-k9 | 67 | 100 | 1405.68 | 1404.75 | 1532.85 | 1381.52 | 9 | 9 | 0.07 | 9.12 | −1.65 |

A-n61-k9 | 69 | 100 | 1090.09 | 1089.57 | 1256.55 | 1096.9 | 10 | 10 | 0.05 | 15.33 | 0.67 |

A-n65-k9 | 72 | 100 | 1255.78 | 1256.14 | 1455.82 | 1247.41 | 10 | 10 | −0.03 | 15.90 | −0.69 |

A-n80-k10 | 88 | 100 | 1831.57 | 1832.1 | 2133.16 | 1828.91 | 10 | 10 | −0.03 | 16.43 | −0.17 |

B-n35-k5 | 38 | 100 | 1039.05 | 1040.42 | 1215.04 | 1008.91 | 5 | 5 | −0.13 | 16.78 | −3.03 |

B-n50-k7 | 55 | 100 | 758.91 | 758.12 | 880.08 | 751.18 | 7 | 7 | 0.10 | 16.09 | −0.92 |

B-n52-k7 | 57 | 100 | 748.98 | 750.9 | 842.1 | 763.72 | 7 | 7 | −0.26 | 12.15 | 1.71 |

B-n64-k9 | 72 | 100 | 931.49 | 930.4 | 1025.43 | 913.85 | 10 | 10 | 0.12 | 10.21 | −1.78 |

B-n67-k10 | 75 | 100 | 1039.52 | 1040.37 | 1285.71 | 1095.47 | 10 | 11 | -0.08 | 23.58 | 5.30 |

B-n78-k10 | 86 | 100 | 1270.07 | 1272.61 | 1506.71 | 1278.83 | 10 | 10 | -0.20 | 18.40 | 0.49 |

E-n101-k14 | 113 | 112 | 1156.23 | 1155.55 | 1316.35 | 1143.58 | 14 | 14 | 0.06 | 13.92 | −1.04 |

E-n22-k4 | 24 | 6000 | 378.47 | 378.27 | 431.31 | 388.77 | 4 | 4 | 0.05 | 14.02 | 2.78 |

E-n23-k3 | 24 | 4500 | 641.18 | 639.43 | 653.12 | 572.47 | 3 | 3 | 0.27 | 2.14 | −10.47 |

E-n30-k3 | 32 | 4500 | 527.92 | 527 | 547.88 | 512.14 | 4 | 4 | 0.17 | 3.96 | −2.82 |

E-n33-k4 | 35 | 8000 | 875.96 | 876.15 | 910.05 | 844.53 | 4 | 4 | −0.02 | 3.87 | −3.61 |

E-n51-k5 | 54 | 160 | 575.43 | 575.67 | 631.93 | 573.68 | 5 | 6 | −0.04 | 9.77 | −0.35 |

E-n76-k10 | 84 | 140 | 916.5 | 917.56 | 1017.11 | 880.7 | 11 | 11 | −0.12 | 10.85 | −4.02 |

E-n76-k14 | 89 | 100 | 1093.28 | 1094.58 | 1255.58 | 1063.17 | 15 | 15 | -0.12 | 14.71 | −2.87 |

F-n135-k7 | 140 | 2210 | 1258.53 | 1255.19 | 1313.82 | 1213.29 | 7 | 7 | 0.27 | 4.67 | −3.34 |

M-n101-k10 | 109 | 200 | 896.75 | 895.96 | 1025.6 | 893.89 | 10 | 10 | 0.09 | 14.47 | −0.23 |

M-n200-k16 | 215 | 200 | 1454.7 | 1458.34 | 1599.36 | 1379.05 | 17 | 17 | −0.25 | 9.67 | −5.44 |

P-n22-k8 | 29 | 3000 | 606.91 | 606.77 | 659.59 | 589.39 | 9 | 9 | 0.02 | 8.71 | −2.86 |

P-n40-k5 | 43 | 140 | 514.3 | 514.17 | 556.51 | 501.05 | 5 | 5 | 0.03 | 8.23 | −2.55 |

P-n50-k10 | 59 | 100 | 728.22 | 727.61 | 839.86 | 718.37 | 11 | 11 | 0.08 | 15.43 | −1.27 |

P-n55-k15 | 70 | 70 | 974.68 | 975.69 | 1164.2 | 982.59 | 16 | 17 | -0.10 | 19.32 | 0.71 |

P-n65-k10 | 73 | 130 | 871.76 | 871.1 | 964.59 | 832.12 | 10 | 10 | 0.08 | 10.73 | −4.47 |

P-n70-k10 | 79 | 135 | 884.76 | 885.17 | 1018.95 | 885.85 | 11 | 11 | -0.05 | 15.11 | 0.08 |

Averages | 0.00 | 12.02 | −1.25 |

© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Arnau, Q.; Juan, A.A.; Serra, I.
On the Use of Learnheuristics in Vehicle Routing Optimization Problems with Dynamic Inputs. *Algorithms* **2018**, *11*, 208.
https://doi.org/10.3390/a11120208

**AMA Style**

Arnau Q, Juan AA, Serra I.
On the Use of Learnheuristics in Vehicle Routing Optimization Problems with Dynamic Inputs. *Algorithms*. 2018; 11(12):208.
https://doi.org/10.3390/a11120208

**Chicago/Turabian Style**

Arnau, Quim, Angel A. Juan, and Isabel Serra.
2018. "On the Use of Learnheuristics in Vehicle Routing Optimization Problems with Dynamic Inputs" *Algorithms* 11, no. 12: 208.
https://doi.org/10.3390/a11120208