# Path Planning for Conformal Antenna Surface Detection Based on Improved Genetic Algorithm
## 3 Improved Genetic Algorithm Combining the Historical Optimal Population
### Adaptive Crossover and Mutation Operators
\tag{3}\]  
\[P_{mutation}=\left\{ \begin{array}{l}P_{mutation}+\frac{1}{GENEKATION},\,if\, \,t<THRESHOLD/10\\ P_{mutation}+\frac{1}{GENEKATION},\,if\,\,t\geq THRESHOLD/10\end{array} \right. \tag{4}\]  
where \(P_{cross}\) represents the crossover probability of each round, for which the initial value is 0.9 and the minimum value is set to 0.4; \(P_{mutation}\) denotes the mutation probability of each round, for which the initial value is 0.1 and the maximum value is set to 0.9; \(GENERATION\) represents the upper limit of iterations, which is set to 1000; \(THRESHOLD\) denotes the upper limit of the number of generations the fitness remains unchanged, which is set to 100; \(t\) represents the number of generations for which the optimal path length is continuously constant; and the iteration ends if \(t\) exceeds \(THRESHOLD\). In the later stages of iteration, the paths represented by the individuals in the population are already largely free of crossovers, meaning that the 2-opt mutation is no longer useful. Therefore, this work adopted an adaptive mutation operation, which is shown in the following: for 2-opt, the operator is executed only when the random number \(P>P_{mutation}\); for other mutation operations, it is executed only when the random number \(P<P_{mutation}\), as shown in Figure 5. Together with the adaptive adjustment strategy of mutation probability described in the previous section, it can serve the purpose of optimizing the cross-path mainly using the 2-opt mutation in the early stage, and jumping out to the locally optimal solution mainly using various other mutation operators in the later stages. Taking kroA100 in TSPLIB as an example, the comparison results between this work's method and the literature [23] method with the same remaining parameters are shown in Figure 7, where (a) and (b) represent the change curves of the crossover and mutation probabilities of this work's method and the method described in the literature [23] at one time. It can be seen that the method described in this paper could automatically adjust the crossover and variation probabilities when falling into the local optimal solution, and the 2-opt operator was invoked more frequently in the early stage to accelerate the iteration, which had a better chance of reaching or converge to the optimal solution. The final paths obtained by the two methods are indicated by (c) and (d), respectively. The length of the former was 21,285.44, and the length of the latter was 21,448.46, which shows that the method described in this paper achieved a better result, and the result was the optimal solution of kroA100. A comparison of the results of multiple trials is shown in Table 2, where the error rate was calculated using Formula (5). \[P_{f}=\frac{f_{average}-f_{best}}{f_{best}}\times 100\% \tag{5}\]  
where \(P_{f}\) denotes the error rate; \(f_{average}\) denotes the average value of the path length after 10 trials; \(f_{best}\) refers to the optimal value of the path length, which is 21,285.44 for kroA100. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Method** & **Number of Tests** & **Average Length** & **Error Rate** &
\begin{tabular}{c} **Average Number** \\ **of Iterations** \\ \end{tabular} \\ \hline Methodology of this paper & 10 & 21,329.9 & 0.211\% & 162.5 \\ Method described & & 21,442.2 & 0.739\% & 216.8 \\ in the literature [23] & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of the results of the method described in this paper with the method described in the literature [23].