Development of Vehicle Routing Problem (VRP) Models in Python to Optimize Last-Mile Distribution Routes in an SME
Authors
Industrial Engineering, Instituto Tecnológico de Pachuca, Pachuca de Soto, Mexico. (Mexico)
Industrial Engineering, Instituto Tecnológico de Pachuca, Pachuca de Soto, Mexico. (Mexico)
Industrial Engineering, Instituto Tecnológico de Pachuca, Pachuca de Soto, Mexico. (Mexico)
Industrial Engineering, Instituto Tecnológico de Pachuca, Pachuca de Soto, Mexico. (Mexico)
Acosta Martínez Nayeli Abigail
Industrial Engineering, Instituto Tecnológico de Pachuca, Pachuca de Soto, Mexico. (Mexico)
Article Information
DOI: 10.47772/IJRISS.2026.102500010
Subject Category: Operations Research
Volume/Issue: 10/25 | Page No: 162-220
Publication Timeline
Submitted: 2026-10-21
Accepted: 2026-10-26
Published: 2026-11-14
Abstract
Small and medium-sized enterprises (SMEs) that produce perishable food often plan last-mile distribution reactively, which raises fuel consumption, extends working days and forces vehicles to return to the plant for additional product. This study develops and evaluates vehicle routing problem (VRP) models implemented in Python for a family-owned cheese SME located in Apaxco de Ocampo, State of Mexico, which serves about 35 commercial destinations per day with more than 900 kg of product using two light trucks of 600 and 800 kg. The research followed the Design Thinking approach in five phases. The empathize and define phases characterized the current operation, three delivery corridors and the isolated fuel cost of each destination. The ideate phase formulated a heterogeneous capacitated VRP with working-day limits, multiple trips and order release times. The prototype phase implemented the model in Python using a Clarke-Wright savings heuristic, a simulated annealing metaheuristic and an exact mixed-integer verification solved with HiGHS. In the test phase, three scenarios were compared under identical orders, vehicles and assumptions: the current dispatching rules, a static scenario with all orders ready at 07:00 and a dynamic scenario with staggered production releases. Under the dynamic scenario, the model reduced the travelled distance from 382.0 to 285.4 km (25.3 %), daily fuel cost from MXN 1,293 to MXN 966, trips from six to four and minutes beyond the working day by 61.2 %. When production and dispatch were synchronized, distance fell to 152.8 km (60.0 %) with two trips and no overtime. A Monte Carlo experiment with 30 simulated days yielded a mean distance reduction of 35.1 %, and the exact verification confirmed the optimal sequence of every route. The results show that route optimization must be accompanied by the synchronization of production and dispatch.
Keywords
Vehicle Routing Problem, Last-Mile Distribution, Python, Design Thinking, Small And MediumSized Enterprises
Downloads
References
1. Álvarez-Miranda, E., Epstein, R., Pereira, J., Sinnl, M., & Urrutia, R. (2025). A multi-criteria districting approach with a lexicographic compactness metric: An application to the Chilean postal service. Computers & Operations Research, 173, 106845. https://doi.org/10.1016/j.cor.2024.106845 [Google Scholar] [Crossref]
2. Brown, T. (2008). Design thinking. Harvard Business Review, 86(6), 84–92. [Google Scholar] [Crossref]
3. Clarke, G., & Wright, J. W. (1964). Scheduling of vehicles from a central depot to a number of delivery points. Operations Research, 12(4), 568–581. https://doi.org/10.1287/opre.12.4.568 [Google Scholar] [Crossref]
4. Comisión Nacional para el Uso Eficiente de la Energía. (2025, March 21). Rendimiento de combustible en vehículos ligeros de venta en México [Fuel economy of light-duty vehicles sold in Mexico]. Government of Mexico. https://www.gob.mx/conuee/documentos/rendimiento-de-combustible-en-vehiculos-ligeros-de-venta-en-mexico [Google Scholar] [Crossref]
5. Comisión Nacional para el Uso Eficiente de la Energía. (2026). Catálogo de rendimiento de combustible en vehículos ligeros de venta en México [Fuel economy catalog of light-duty vehicles sold in Mexico] [Data set]. Datos.gob.mx. https://www.datos.gob.mx/dataset/catalogo_rendimiento_combustible_vehiculos_ligeros_venta_mexico [Google Scholar] [Crossref]
6. Dahlan, A. F., Cheng, C.-Y., Sae-chai, P., Jientrakul, R., & Yuangyai, C. (2025). Crowdsourced adaptive vehicle routing framework for last-mile delivery in dynamic traffic environments. Annals of Operations Research. https://doi.org/10.1007/s10479-025-06806-2 [Google Scholar] [Crossref]
7. Dantzig, G. B., & Ramser, J. H. (1959). The truck dispatching problem. Management Science, 6(1), 80–91. https://doi.org/10.1287/mnsc.6.1.80 [Google Scholar] [Crossref]
8. Dribel, O., Ait El Cadi, A., Riane, F., & Benmansour, R. (2025). Optimizing last-mile delivery with crowdshipping and relay points: A tabu search approach. IFAC-PapersOnLine, 59(10), 3047–3052. https://doi.org/10.1016/j.ifacol.2025.09.512 [Google Scholar] [Crossref]
9. Errami, N., Queiroga, E., Sadykov, R., & Uchoa, E. (2024). VRPSolverEasy: A Python library for the exact solution of a rich vehicle routing problem. INFORMS Journal on Computing, 36(4), 956–965. https://doi.org/10.1287/ijoc.2023.0103 [Google Scholar] [Crossref]
10. Fonseca-Galindo, J. C., Surita, G. de C., Maia Neto, J., de Castro, C. L., & Lemos, A. P. (2022). A multi-agent system for solving the dynamic capacitated vehicle routing problem with stochastic customers using trajectory data mining. Expert Systems with Applications, 195, 116602. https://doi.org/10.1016/j.eswa.2022.116602 [Google Scholar] [Crossref]
11. GasMapa. (2026, October 20). Precios de combustibles en México [Fuel prices in Mexico]. https://www.gasmapa.com/ [Google Scholar] [Crossref]
12. González-Romero, I., Bastero-Sellán, J., Comesaña Benavides, J. A., & Prado Prado, J. C. (2026). Economic, environmental, and social sustainability in last-mile delivery: Solving the multi-trip vehicle routing problem. Central European Journal of Operations Research, 34(4), 1237–1260. https://doi.org/10.1007/s10100-026-01017-x [Google Scholar] [Crossref]
13. Google for Developers. (n.d.-a). Capacity constraints. OR-Tools. https://developers.google.com/optimization/routing/cvrp [Google Scholar] [Crossref]
14. Google for Developers. (n.d.-b). Vehicle routing problem. OR-Tools. https://developers.google.com/optimization/routing/vrp [Google Scholar] [Crossref]
15. Google for Developers. (n.d.-c). Vehicle routing problem with time windows. OR-Tools. https://developers.google.com/optimization/routing/vrptw [Google Scholar] [Crossref]
16. Guiamexican. (n.d.). Leche, productos lácteos, embutidos en Zumpango [Milk, dairy products and cold cuts in Zumpango]. https://guiamexican.com/leche-productos-lacteos-embutidos/zumpango [Google Scholar] [Crossref]
17. Hasso Plattner Institute of Design at Stanford. (2010). An introduction to design thinking: Process guide. Stanford University. [Google Scholar] [Crossref]
18. He, P., Li, J., Jiang, Y., & Wang, X. (2018). Collaborative transportation planning distinguishing old and new shippers for small-medium enterprise. Journal of Industrial and Production Engineering, 35(3), 170–180. https://doi.org/10.1080/21681015.2018.1443165 [Google Scholar] [Crossref]
19. Hsiao, Y.-H., Chen, M.-C., Lu, K.-Y., & Chin, C.-L. (2018). Last-mile distribution planning for fruit-and-vegetable cold chains. The International Journal of Logistics Management, 29(3), 862–886. https://doi.org/10.1108/IJLM-01-2017-0002 [Google Scholar] [Crossref]
20. Kirkpatrick, S., Gelatt, C. D., & Vecchi, M. P. (1983). Optimization by simulated annealing. Science, 220(4598), 671–680. https://doi.org/10.1126/science.220.4598.671 [Google Scholar] [Crossref]
21. Klein, P. S., & Schiffer, M. (2024). RoutingBlocks: An open-source Python package for vehicle routing problems with intermediate stops. INFORMS Journal on Computing, 36(4), 966–973. https://doi.org/10.1287/ijoc.2023.0104 [Google Scholar] [Crossref]
22. Li, Y., & Yang, J. (2024). The last-mile delivery vehicle routing problem with handling cost in the front warehouse mode. Computers & Industrial Engineering, 190, 110076. https://doi.org/10.1016/j.cie.2024.110076 [Google Scholar] [Crossref]
23. Liao, S., Dai, Y., & Ma, Z. (2025). Vehicle routing problem with roaming locations for simultaneous pickup and delivery services. OPSEARCH, 63(2), 1172–1192. https://doi.org/10.1007/s12597-025-00934-w [Google Scholar] [Crossref]
24. Maghfiroh, M. F. N., & Hanaoka, S. (2018). Dynamic truck and trailer routing problem for last mile distribution in disaster response. Journal of Humanitarian Logistics and Supply Chain Management, 8(2), 252–278. https://doi.org/10.1108/JHLSCM-10-2017-0050 [Google Scholar] [Crossref]
25. Malik, S., Khonji, M., Elbassioni, K., & Dias, J. M. M. (2025). CODEL: Collaborative multi-robot parcel delivery for last-mile logistics. In Advances in Service and Industrial Robotics (Mechanisms and Machine Science, pp. 706–714). Springer. https://doi.org/10.1007/978-3-032-02106-9_78 [Google Scholar] [Crossref]
26. MXFirmas. (n.d.). Tiendas de lácteos en Zumpango de Ocampo, Estado de México [Dairy stores in Zumpango de Ocampo, State of Mexico]. https://mxfirmas.com/EMX-Zumpango-de-Ocampo/Tiendas-de-lacteos [Google Scholar] [Crossref]
27. Nieto de Almeida, A., Crespo-Pereira, D., & García del Valle, A. (2012). ELOCONS: un algoritmo de construcción de rutas eficiente para la pequeña y mediana empresa de distribución [ELOCONS: An efficient route construction algorithm for small and medium-sized distribution companies]. DYNA Ingeniería e Industria, 87(3), 222–228. https://doi.org/10.6036/4360 [Google Scholar] [Crossref]
28. Ortuño, M. T., Ferrer, J. M., Flores, I., & Tirado, G. (2021). Optimization of humanitarian logistics. In International Encyclopedia of Transportation (pp. 195–200). Elsevier. https://doi.org/10.1016/B978-0-08-102671-7.10243-X [Google Scholar] [Crossref]
29. Pan, B., Zhang, Z., & Lim, A. (2021). Multi-trip time-dependent vehicle routing problem with time windows. European Journal of Operational Research, 291(1), 218–231. https://doi.org/10.1016/j.ejor.2020.09.022 [Google Scholar] [Crossref]
30. Rashidi, M. H., Nourinejad, M., & Roorda, M. J. (2025). Generating practical last-mile delivery routes using a data-informed insertion heuristic. Transportation Research Part C: Emerging Technologies, 179, 105278. https://doi.org/10.1016/j.trc.2025.105278 [Google Scholar] [Crossref]
31. Sanabria-Rey, J. G., Solano-Charris, E. L., Vega-Mejía, C. A., & Quintero-Araujo, C. L. (2021). Solving last-mile deliveries for dairy products using a biased randomization-based spreadsheet. A case study. American Journal of Mathematical and Management Sciences, 41(1), 51–69. https://doi.org/10.1080/01966324.2021.1910886 [Google Scholar] [Crossref]
32. SteadieSeifi, M., Dellaert, N., Nuijten, W., & Van Woensel, T. (2017). A metaheuristic for the multimodal network flow problem with product quality preservation and empty repositioning. Transportation Research Part B: Methodological, 106, 321–344. https://doi.org/10.1016/j.trb.2017.07.007 [Google Scholar] [Crossref]
33. Thipparthy, K. R., Khalaf, M., Yogi, K. S., Alghayadh, F. Y., Yusupov, A., Maguluri, L. P., & Ofori-Amanfo, P. (2024). Optimizing delivery routes for sustainable food delivery for multiple food items per order. Discover Sustainability, 5(1). https://doi.org/10.1007/s43621-024-00326-y [Google Scholar] [Crossref]
34. Utama, D. M., Dewi, S. K., Wahid, A., & Santoso, I. (2020). The vehicle routing problem for perishable goods: A systematic review. Cogent Engineering, 7(1), 1816148. https://doi.org/10.1080/23311916.2020.1816148 [Google Scholar] [Crossref]
35. Virtanen, P., Gommers, R., Oliphant, T. E., Haberland, M., Reddy, T., Cournapeau, D., ... SciPy 1.0 Contributors. (2020). SciPy 1.0: Fundamental algorithms for scientific computing in Python. Nature Methods, 17(3), 261–272. https://doi.org/10.1038/s41592-019-0686-2 [Google Scholar] [Crossref]
36. Yang, K., Zhang, Z., Zhao, J., & Liang, Z. (2025). A neighborhood-based matheuristic for the vehicle routing problem with delivery options. Transportation Research Part E: Logistics and Transportation Review, 203, 104366. https://doi.org/10.1016/j.tre.2025.104366 [Google Scholar] [Crossref]
37. Yu, V. F., Lin, S.-W., Zhou, L., & Baldacci, R. (2024). A fast simulated annealing heuristic for the multi-depot two-echelon vehicle routing problem with delivery options. Transportation Letters, 16(8), 921–932. https://doi.org/10.1080/19427867.2023.2257923 [Google Scholar] [Crossref]
38. Yu, X., Li, Y., Liu, J., & Zhou, H. (2024). Solving low-carbon last mile delivery problem using discrete marine predators algorithm. Applied Soft Computing, 165, 112112. https://doi.org/10.1016/j.asoc.2024.112112 [Google Scholar] [Crossref]
39. Zhou, L., Baldacci, R., Vigo, D., & Wang, X. (2018). A multi-depot two-echelon vehicle routing problem with delivery options arising in the last mile distribution. European Journal of Operational Research, 265(2), 765–778. https://doi.org/10.1016/j.ejor.2017.08.011 [Google Scholar] [Crossref]