## 3 Hybrid Algorithms Design
### Genetic Algorithm  
(1) Chromosome Representation  
In this study, a chromosome CH contains two sub-chromosomes, \(P\) and \(W\), which represent the production quantity of a product and the number of workers, respectively. The genes in each chromosome are integer. Figure 1 is a simple example of a chromosome with \(I\) product categories and \(T\) periods.  
(2) Initialization  
Analysis of the feasible range of \(PP_{it}\): For the same product in the same period, production in advance and backordering or loss of sales cannot occur at the same time. If the total amount of demand in the current period and the quantity of backorders in the previous period is greater than the sum of production capacity and inventory at the beginning of the current period, stockout occurs. Therefore, in this case, the product should be produced with the maximum production capacity due to the existence of stockout cost. Otherwise, the minimum \(PP_{it}\) should meet the sum of the product demand in the planning period and the quantity of backorder in the previous period according to Constraint (20). Thus, the minimum \(PP_{it}\) in the planning period can be obtained by  
\[\text{MinPP}_{it}=\max\left\{0,\min\left\{PD_{it}+\sum_{t_{2}=1}^{t-1}B_{it-1 }(t-t_{2})-CI_{it},PN_{it}\right\}\right\} \tag{23}\]  
Moreover, the maximum production quantity should not exceed the production capacity and inventory capacity according to Constraints (18) and (19).  
\[\text{MaxPP}_{it}=\min\left\{CN_{i}+PD_{it}+\sum_{t_{2}=1}^{t-1}B_{it-1}(t-t_{ 2})-CI_{it},PN_{it}\right\} \tag{24}\]  
Analysis of the feasible range of \(W_{it}\): The minimum and maximum \(W_{tk}\) can be obtained according to the production quantity and the labor cost and stability in the workforce (\(\lceil\ \rceil\) indicates rounding up).  
\[\text{MinW}_{tk}=\left\lceil\ (\sum_{i=1}^{I}PP_{it}\cdot PW_{ik})/\left(WR+ WO\right)\right\rceil \tag{25}\]  
\[\text{MaxW}_{tk}=\max\left\{W_{tk-1},\left\lceil(\sum_{i=1}^{I}PP_{it}\cdot PW _{ik})/WR\right\rceil\right\} \tag{26}\]  
Obviously, the chromosomes satisfy Constraints (18)-(22) in the process of initialization. Calculation of the stockout quantity: If the total amount of demand in the current period and the quantity of backorders in the previous period is greater than the sum of production  
Figure 1: An example of a chromosome.  
capacity and inventory at the beginning of the current period, the products will be out of stock; otherwise, the products will be produced in advance. So, the stockout quantity can be calculated by  
\[\max\left\{PD_{it}+\sum\limits_{t^{\prime\prime}=1}^{t-1}B_{it-1}(t-t^{\prime \prime})-CI_{it}-PP_{it},0\right\} \tag{27}\]  
(3) Genetic Operators  
The genetic operators in this paper are almost the same as that of the genetic algorithm in [20], mainly including the partheno crossover operator (only utilizable for sub-chromosome \(P\)), arithmetic crossover operator, production mutation operator, mutation operator for the number of workers, and repairing infeasible gene operators, which will not be introduced in detail here.  
The GA has the characteristics of random multi-point search and implicit parallelism, while a simple genetic algorithm is prone to being premature and has slow convergence. As shown in Figure 2, the same experiment is calculated 10 times using the designed GA, and it can be seen that sometimes the algorithm will fall into the local optimal solution.