## 3 Hybrid Algorithm--RSO-IGA  
The RSO-IGA algorithm establishes an intrinsic connection between the two subproblems of 3D bin packing and route planning, enabling a more holistic solution for 3L-CVRP. Initially, an improved Clarke-Wright savings algorithm generates route set \(P_{t}\) with 3D constraints as the initial population for the IGA. This enhanced CW algorithm accelerates convergence to optimal solutions, thereby improving computational efficiency. Set \(g=1\). Use the roulette wheel selection method in the IGA algorithm to perform selection operations. The selected solutions undergo crossover with probability \(P_{e}\). The crossed solutions are then subjected to 3D constraint validation. If the constraints are not satisfied, the crossover is repeated; if satisfied, mutation is performed with probability \(P_{m}\). After mutation, another 3D constraint validation is conducted. Note that the 3D constraints here are distinct from 3D loading constraints. Even if a path plan satisfies Equations (9)-(12), it may not guarantee that all the packages can fit into the delivery vehicle. Therefore, after crossover and mutation in the IGA algorithm, the RSO method is applied to validate 3D loading constraints and eliminate invalid solutions. This step enhances algorithm efficiency by avoiding infeasible solutions that fail loading requirements. The offspring population \(O_{t}\) is merged with parent population \(P_{t}\), followed by objective function evaluation. An elitism selection mechanism then identifies \(N\) elite individuals to form the new parent population. Then, set \(g=g+1\), and the process iterates until termination criterion \(g\leq g_{max}\) is met, ultimately outputting the optimized solution. This dual-phase validation mechanism and elite retention strategy effectively balance solution quality and computational efficiency while maintaining 3D feasibility constraints, and the algorithm flow is illustrated in Figure 3.  
The specific pseudo-code steps of the hybrid Algorithm 1 are shown below. ```
Input: Customer points \(D\), vehicle dimensions (\(L\), \(W\), \(H\)), AHP weights (\(w_{1}\), \(w_{2}\)) Genetic params: pop_size, max_gen, \(P_{c}\), \(P_{m}\) Output: Optimized routes \(R\_best\) with feasible 3D packing schemes
1: Initialize:
2: Generate initial population \(P_{0}\) using Improved CW savings algorithm (Algorithm 3)
3: Decode each individual to routes \(R\_chrom\) and packing layers (\(L\_chrom\), \(P\_chrom\))
4: Validate packing feasibility via RSO Algorithm (Algorithm 2)
5: for \(gen=1\) to max_gen do:
6: # IGA Phase

### Three-Dimensional Bin Packing Algorithm Based on the Residual Space Optimization Strategy

The purpose of three-dimensional bin packing is to verify whether the goods at customer points along the planned route can be loaded into the vehicle under the LIFO constraint. This paper adopts

Figure 3: Algorithm flow chart. a three-dimensional bin packing algorithm based on the residual space optimization strategy for verification. The packing rules are as follows:

1. Residual space segmentation: As shown in Figure 4, the red dashed lines represent the cutting planes. When horizontal or vertical cutting is applied, the remaining three subspaces are independent of each other. Among them, the subspace \(Space_{1}\) remains the same under both cutting methods, while \(Space_{2}\) and \(Space_{3}\) are subspaces with equal height. The optimization of the residual space segmentation method can be equivalent to the optimization of the residual space in two-dimensional bin packing with height constraints. 2. Parcel placement rules: placing boxes with larger base areas at the bottom ensures better loading capacity for subsequent items. Therefore, under the premise of optimizing residual space, the placement rules are described as follows:

1. Sort the parcels based on the size of their base area in descending order, prioritizing the loading of parcels with larger base areas;
2.