## 4 Two-Stage Algorithm Combining Genetic Algorithm and Quasi-Physical Approach
### Assignment Task  
#### 4.2.1 Formulation of the Assignment Subproblem  
The upper stage solves the assignment task. It takes as input the list of geometrical features of the components and the containers (dimensions, masses and exclusion zones). The output of the upper stage is an archive of \(N_{AS}\) assignment schemes corresponding to \(N_{AS}\) lists of assigned containers to each component. Thus, the design variables to optimize are \(\mathbf{p}_{s}^{d}=\{p_{s,j}^{d}\}_{i\in\{1,\ldots,N\}}\), where \(p_{s,j}^{d}\in\{1,\ldots,n\}\).  
In order to minimize the global inertia, the components should be distributed among the containers such that their center of gravity along the \(z\) axis is centered at the center of gravity of the empty module. Then, the assignment objective function consists in minimizing the terms of the global inertia equations depending on the \(p_{z,j}^{c}\) variables while positioning the center of gravity of the components along the \(z\) axis in a tolerance zone centered at the empty module center of gravity and while not exceeding a 65% occupation rate per container (without loss of generality). Indeed, for the SMLP problem, larger occupation rates might lead to unfeasible layout configurations [123]. The corresponding optimization subproblem is formulated as follows:  
\[\begin{split}\min_{\mathbf{p}_{s}^{d}}&\sum_{i=1}^ {N}m_{i}(p_{z,i}^{d}(\mathbf{p}_{s}^{d})-z_{e})^{2}\\ \text{w.r.t.}&\mathbf{p}_{s}^{d}\in F_{\text{pf}} \subseteq\{1,2,3,4\}^{N}\\ \text{s.t.}&\mathpzc{SG}(\mathbf{p}_{s}^{d})\leq 0\\ & g_{O}^{j}(\mathbf{p}_{s}^{d})\leq 0\quad\text{for}\ j\in\{1,2,3,4\} \end{split} \tag{23}\]  
where \(p_{z,j}^{d}\) are the positions of the center of inertia of the components of mass \(m_{i}\) that are defined by the values of \(\mathbf{p}_{s}^{d}\) in the assignment list. \(z_{e}\) is a position of reference, which is taken as the center of gravity of the empty module. The inequality constraints are, respectively, as follows:  
* The balancing constraint: \[g_{CG}(\mathbf{p}_{s}^{d})=\left|\frac{\sum_{i=1}^{N}m_{i}p_{z,i}^{d}}{\sum_{i =1}^{N}m_{i}}-z_{e}\right|-\delta_{CG,z}\] (24) The value of \(\delta_{CG,z}\) represents the size of the tolerance zone for the positioning of the center of gravity along the z-axis. Without loss of generality, it is taken as equal to 3.0, which corresponds to the size of the tolerance zones along the x- and y-axes [19; 20; 48; 112; 117] so that the center of gravity must be positioned in a sphere of tolerance with a radius of 3.0 mm centered at the geometrical center of gravity of the empty module.
* The occupation rate constraints defined for each surface \(j\): \[g_{O}^{j}(\mathbf{p}_{s}^{d})=\frac{A_{j}^{components}}{A_{j}^{container}}-OR_{lim}\] (25) where \(A_{j}^{components}\) is the total area of the components assigned to container \(j\) and \(A_{j}^{container}\) is the area of container \(j\). \(OR_{lim}\) corresponds to the occupation rate that should not be exceeded in each container. It is taken equal to 0.65 to ensure a compromise between container filling and problem feasibility, as shown in [123; 124].