# Solving the Container Relocation Problem by Using a Metaheuristic Genetic Algorithm
## 5 Results and Discussion
Furthermore, we have implemented the linear programming model for CRP to get optimal results for small bay sizes (last column in Table 2). As stated before, CRP is NP-hard problem. Hence, using the linear programming model to resolve CRP, we managed to get results for bay sizes 3 \(\times\) 3, 4 \(\times\) 3, 3 \(\times\) 4, 4 \(\times\) 4, 3 \(\times\) 5, and 5 \(\times\) 3 in which there are no more than 15 containers inside the bay. The obtained results are the optimal results for these bay sizes. Additionally, the process of obtaining the results with linear programming model was very slow even for such small bay sizes. The highlighted results (emboldened) indicate the best results obtained for each test instance considering the different sizes of the bay. It can be seen that the proposed method achieves the best or the second best results for each test instance along with the solution proposed in [24]. For the bay sizes 3 \(\times\) 3, 4 \(\times\) 4, 4 \(\times\) 5 and 4 \(\times\) 7, the proposed method achieved the best results, even better than [24]. By introducing the linear programming model, we also proved that our method gives optimal results for small bay sizes. Considering that for large bay sizes, where linear programming cannot be used, there are currently no better results than those obtained by the method from [24] or our new method, we can conclude that our method solves CRPs very successfully. \begin{table}
\begin{tabular}{c c} \hline
**Parameter** & **Value** \\ \hline Number of generations & 300 \\ Size of population & 100 \\ Mutation rate & 0.05 \\ Number of genes within the chromosome & 10 \(\times\) number of containers in CRP \\ Percentage of selected chromosomes from & 0.5 \\ previous generation & set \\ Elitism & set \\ \hline \end{tabular}
\end{table} 
Table 1: The genetic algorithm setup for resolving CRPs. We also confirmed this claim using the statistical t-test, which is used to compare the means of two sample groups. We ran 50 simulations for all test sets of CRP for our previous method [17] and the method proposed in this paper. The null hypothesis (H0) for these two sample groups was that the difference between the means of these groups is zero. Since the t-value was 2218.5, the null hypothesis is definitely rejected. Higher values of the t-value indicate that there is a large difference between the two sample groups, as shown by the results in Table 1 (266.04 vs. 280.66). As mentioned earlier, our previous method introduces four rules for container relocation, one of which applies to the relocation of the next blocking container depending on the random selection process within the genetic algorithm. The drawback of this method was favoring container relocation to the nearest possible stack satisfying the applied relocation rule, thus optimizing the horizontal movement of reshuffled containers. Since the main objective of the CRP test set in [24] is to minimize the number of reshuffles (relocations of blocking containers), in certain situations, if the reshuffled container is not relocated to the nearest possible stack (column), the total number of relocations will be smaller at the end. In Figure 13, an example of a different solution of container relocation, between our previous method [17] and the proposed method, is shown. As stated before, our previous method proposes four different relocation rules of blocking containers (Rule R1--relocate the container to the nearest stack in which all containers will be retrieved later than the blocking container, Rule R2--relocate the container to the nearest empty stack, Rule R3--relocate the container to the nearest and the lowest stack, and Rule R4--Relocate the container to the nearest stack that is not full to the maximum stacking height). According to Figure 13, the container with priority 4 must be retrieved next. Given that container 9 blocks container 4, it must be relocated. Considering four rules proposed in [17], only rules R3 and R4 are applicable for relocation of the container 9.