[Paper Review] Hybrid Genetic Search for the CVRP: Open-Source Implementation and SWAP* Neighborhood
This paper introduces HGS-CVRP, an open-source, highly optimized implementation of the hybrid genetic search algorithm tailored for the capacitated vehicle routing problem (CVRP). It introduces the SWAP* neighborhood—a novel, efficiently explored move set that exchanges two customers between routes without insertion—demonstrating that its effective exploration significantly enhances solution quality and convergence speed, outperforming prior methods in both speed and optimality on standard benchmarks.
The vehicle routing problem is one of the most studied combinatorial optimization topics, due to its practical importance and methodological interest. Yet, despite extensive methodological progress, many recent studies are hampered by the limited access to simple and efficient open-source solution methods. Given the sophistication of current algorithms, reimplementation is becoming a difficult and time-consuming exercise that requires extensive care for details to be truly successful. Against this background, we use the opportunity of this short paper to introduce a simple -- open-source -- implementation of the hybrid genetic search (HGS) specialized to the capacitated vehicle routing problem (CVRP). This state-of-the-art algorithm uses the same general methodology as Vidal et al. (2012) but also includes additional methodological improvements and lessons learned over the past decade of research. In particular, it includes an additional neighborhood called SWAP* which consists in exchanging two customers between different routes without an insertion in place. As highlighted in our study, an efficient exploration of SWAP* moves significantly contributes to the performance of local searches. Moreover, as observed in experimental comparisons with other recent approaches on the classical instances of Uchoa et al. (2017), HGS still stands as a leading metaheuristic regarding solution quality, convergence speed, and conceptual simplicity.
Motivation & Objective
- To provide a simple, open-source, and high-performance implementation of the hybrid genetic search (HGS) algorithm for the capacitated vehicle routing problem (CVRP).
- To introduce and evaluate the SWAP* neighborhood, a new move type that exchanges two customers between routes without insertion.
- To demonstrate that efficient exploration of SWAP* moves leads to faster convergence and better solution quality compared to standard neighborhoods.
- To promote scientific progress by simplifying heuristic design and enabling reproducible, transparent research in combinatorial optimization.
- To provide a minimal yet powerful codebase that retains only essential components for maximum clarity and performance.
Proposed method
- The algorithm uses a hybrid genetic search framework combining crossover-based diversification and local search-based intensification.
- It employs a binary tournament selection with a fitness function that balances solution quality (fφ) and diversity (fdiv), using a weighted sum to guide parent selection.
- A two-phase local search is applied: first, a standard local search with Relocate, Swap, 2-Opt, and 2-Opt* moves; second, a dedicated exploration of the SWAP* neighborhood.
- The SWAP* neighborhood is explored in sub-quadratic time using geometric pruning and move filtering, enabling efficient handling of its Θ(n⁴) potential moves.
- The algorithm uses the optimal linear-time Split procedure (Vidal, 2016) to compute route costs and feasibility after moves.
- Infeasible solutions are handled via a linear penalty on excess load, enabling exploration near the feasibility boundary.
Experimental results
Research questions
- RQ1Can a simplified, open-source implementation of HGS achieve state-of-the-art performance on the CVRP while maintaining conceptual clarity?
- RQ2How does the inclusion of the SWAP* neighborhood—exchanging two customers between routes without insertion—affect solution quality and convergence speed?
- RQ3What is the computational cost and effectiveness of exploring the SWAP* neighborhood, given its large size (Θ(n⁴))?
- RQ4To what extent does SWAP* contribute to finding improving moves, especially in later stages of local search?
- RQ5Can efficient pruning and filtering strategies make the exploration of large neighborhoods like SWAP* practical and competitive with smaller neighborhoods?
Key findings
- HGS-CVRP achieves solution quality comparable to the original HGS (Vidal et al., 2012) but in a fraction of the computational time.
- The SWAP* neighborhood is responsible for approximately 15% of solution improvements, with a higher proportion of improvements found in later stages of local search.
- Despite its Θ(n⁴) size, SWAP* exploration consumes no more than 32% of the total CPU time due to effective pruning and filtering strategies.
- SWAP* is particularly effective on instances with shorter routes (lower average route size), where it finds more improving moves per unit effort.
- The algorithm outperforms all other recent CVRP methods in terms of solution quality and convergence speed on the Uchoa et al. (2017) benchmark instances.
- The computational time spent on SWAP* is significantly higher on instances with corner-depot locations or larger customer counts, due to increased move availability from the filtering strategy.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.