# Research on Application of Improved Quantum Optimization Algorithm in Path Planning
## 2 Bloch Sphere Quantum Genetic Algorithm
### Selection of Fitness Function  
The selection of the fitness function directly affects the convergence speed of GA and whether it can find the optimal solution. This is because the genetic algorithm does not use external information in the evolutionary search, and it searches with the adaptation of each individual of the population degree only based on the fitness function [37; 38; 39]. The complexity of the fitness function is the main component of the complexity of GA, and the design of the fitness function should be as simple as possible to minimize the time complexity of the calculation. By establishing a mapping relationship between the objective function of the optimization problem and the fitness of the individual, the optimization of the objective function of the optimization problem can be realized in the process of group evolution.  
There are three gene chains for each chromosome, which correspond to three objective function values. The chromosome should be represented by the best gene chain. Considering the size of the obstacle region and the distance between the starting point and the target one, an adaptive individual initialization mechanism is proposed. By calculating the Euclidean distance between the starting point and the target one, the fitness function can be derived as  
\[Fit(i)=sqrt(B1(1)-B2(1))^{2}+(B1(2)-B2(2))^{2}+(B1(3)-B2(3))^{2}, \tag{20}\]  
The chromosome with the smallest fitness value in the population is selected as the contemporary optimal chromosome, and the one with the smallest objective function value among its three gene chains is the contemporary optimal chain. \(B_{i}\) (\(i=1,\ 2,\ 3\)) represents the position of each point, and the shortest distance or the fitness function is obtained according to the shortest distance formula of the three-dimensional graph.  
The quality of the chromosomes in the iterative process needs to be measured in order to drive the chromosomes to keep approaching the best position in the whole region. The main consideration of the metric fitness in three-dimension path planning in intelligent construction is the shortest path. To make the planned paths shorter in time, a three-sample method is used for interpolation, and the path length of the scatter is obtained by calculating the three samples after differencing the interpolated values. The adaptation value formula is shown as (21).  
\[Fitness=\sum_{k=1}^{K}sqrt(x_{k+1}-x_{k})^{2}+(y_{k+1}-y_{k})^{2}+(z_{k+1}-z_{k}) ^{2}, \tag{21}\]  
where \(K\) represents the number of interpolations, and \(k\) represents the order of interpolation. The total path length is obtained by summing the distances of all path segments. The smaller the value is, the shorter the path is.  
The inertial weight \(\omega\) is an important parameter for the speed of chromosome memory predecessors. In the early stage of the algorithm, for a larger search range, larger inertia weights are needed to improve the performance of a large search range, while in the later stage a more refined search is needed. Therefore, a linear decreasing strategy is used to adjust the weights, and the inertia weights will vary linearly between the maximum and minimum values to balance the search capability. Also, to balance the range difference between the inertia weight values and the chromosome velocity, the path range coefficient A which prevents the divergence of the weight values, is introduced as follow.  
\[\omega(x)=\text{A}*\omega_{\text{max}}*(\omega_{\text{max}}-\omega_{\text{min }})(\textit{maxgen}-x)/\textit{maxgen}, \tag{22}\]  
where \(\omega_{\text{max}}\) is the maximum inertia weight, \(\omega_{\text{min}}\) is the minimum inertia weight and _maxgen_ is the maximum number of iterations.