# Modification of Genetic Algorithm Based on Extinction Events and Migration
## 3 Genetic Algorithm Modification
### Algorithm Validation  
Figures 4 and 5 present convergence tests for the classic algorithm and modified algorithm, starting from the same initial population. The results are presented on the basis of the Eggholder function optimization. The modified algorithm [63] reaches the global minimum region, while the classic algorithm, in the vast majority of cases, reaches one of the local minimums, and is unable to go beyond it. As for the GEGA, a seemingly chaotic convergence change in relation to the mean value can be noted. This change is also \"chaotic\" as far as the best-fit value is concerned; however, it improves steadily. The considerable difference between the best-fit value and the mean value results from the behavior of the three worst-fit individuals in the population. This makes it possible to extend the population gene pool and facilitates going beyond the local minimum. A total of 100 attempts to search for Eggholder and Rastrigin function minimum were made. Optimization results for the Eggholder are presented in Figure 6, and such results for the Rastrigin function are presented in Figure 7. The examination included optimal solutions indicated by the classic algorithm (GA) (highlighted blue) and solutions indicated by the modified GEGA (highlighted orange), while the real global minimum of the objective function is marked with a grey line. Figure 5: Convergence for the modified Great Extinction Genetic Algorithm (GEGA). Figure 6: Results of optimization of Eggholder function for Genetic Algorithm (GA), Great Extinction Genetic Algorithm (GEGA), Whale Optimization Algorithm (WOA), Slime Mould Algorithm (SMA), and Sparrow Search Algorithm (SSA). It can be observed that, unlike the classic algorithm, the modified algorithm is able to find the global minimum, with a small number of objective function value calculations. The modified GEGA moreover indicates clearly deeper local minimums than the classic algorithm. Both for the Eggholder function and Rastrigin function, almost all optimization results were better than the best results achieved with the classic algorithm, starting from the same initial population. The classic algorithm appears to be more effective than the modified algorithm only for 17 initial populations for the Eggholder function and one population for the Rastrigin function. The results were also compared with other contemporary algorithms such as Whale Optimization Algorithm (WOA) [64], Slime Mould Algorithm (SMA) [65], and Sparrow Search Algorithm (SSA) [66], as shown in Table 1 as well as Figures 6 and 7. For both the Eggholder function and the Rastrigin function, the results are clearly distributed in two bands, with the band for the results of the GEGA clearly narrower and closer to the line of the global minimum of the function than for the GA. This is evidenced by the smaller value of the standard deviation and the smaller value of the arithmetic mean. It should be noted, however, that the suggested GEGA initially indicates the area where the global minimum is suspected, and then uses the gradient algorithm to indicate local minima. The final optimization in the GEGA using gradient methods was not included in the count of the total calculated number of solutions. The number of iterations used to determine the final minimum of the \"fmincon\" function ranged from one to two. The use of gradient methods for the classical algorithm did not affect the determined minimum. In Figure 8, the convergence for the WOA, SSA, and SMA algorithms was presented. Compared to the other algorithms, for the Rastrigin function, the GEGA has the smallest standard deviation and the highest accuracy in finding the global minimum. For Eggholder functions, all tested algorithms have similar accuracy and uncertainty of solutions. This may be due to the fact that GEGA uses a variable, instantaneous solution space, which allows it to track trends in changes in the local minima of the function.