Abstract:Aiming to address the complex constraints and high computational complexity of the vehicle routing problem with time windows (VRPTW), as well as the weak local search capability and limited solution quality of the snake optimization algorithm (SO), a hybrid snake optimization algorithm (HSO) was proposed. The minimum position matching value method was employed for discrete decoding, thereby improving computational efficiency. A hybrid initialization strategy combining random insertion and the density-based spatial clustering of applications with noise (DBSCAN) algorithm was introduced to enhance the diversity of the initial population and broaden the coverage of the search space. Furthermore, snake behaviors, including searching for food, approaching food, fighting, and mating, were integrated with a local neighborhood search mechanism to strengthen the local search capability. Simulation experiments were conducted on the Solomon dataset, and the results were statistically analyzed by using the Wilcoxon rank-sum test and Friedman test. The experimental results demonstrated that the proposed HSO algorithm exhibited superior solution accuracy and stability for solving the VRPTW. Finally, application of the proposed HSO algorithm to a real-world urban agricultural product distribution problem further demonstrated its adaptability and practical value for solving complex combinatorial optimization problems.