# A Quantum-Behaved Neurodynamic Approach for Nonconvex Optimization with Constraints
## 4 Function Tests  
In this section, we consider two multimodal benchmark problems, i.e., the constrained six-hump camel back function [6] and the constrained Rastrigrin function, to illustrate the proposed optimization approach. The first example is provided to verify the convergence performance of the proposed QNSO algorithm, while the second example is provided to demonstrate the constraint processing ability of the algorithm. **Example 1**. : _Consider the six-hump camel back function [6]_  
\[ \begin{array}{ll}\min&f(x_{1},x_{2})=(4-2.1x_{1}^{2}+\frac{x_{4}^{4}}{3})x_ {1}^{2}+x_{1}x_{2}+4(x_{2}^{2}-1)x_{2}^{2},\\ \mbox{subject to}&-2\leq x_{i}\leq 2,\ i=1,2.\end{array} \]  
Figure 2 shows the contour map of the six-hump camel back function with box constraints. It is seen that there are multiple local minima in the area. In fact, the optimization problem has six minima  
\[\left\{ \begin{array}{ll}f(-1.6071,-0.5687)=2.1043,\\ f(1.6071,0.5687)=2.1043,\\ f(-1.7036,0.7961)=-0.2155,\\ f(1.7036,-0.7961)=-0.2155,\\ f(0.0898,-0.7127)=-1.0316,\\ f(-0.0898,0.7127)=-1.0316.\end{array} \right.\]  
Figure 1: Flow chart of the QNSO algorithm. Two of them are the global minima, located at \(x^{*}=(-0.0898,0.7127)\) and \(x^{*}=(0.0898,-0.7127)\), respectively. To carry out the QNSO algorithm, set swarm size \(q=3\), parameter \(\beta=\frac{1}{2}\), tolerance error precision \(\varepsilon=10^{-6}\), the maximum iteration number \(K_{\max}=10\), \(M_{1}=-20\), and \(\gamma=1000\). Before performing the simulation, initialize the position \(X_{ij}\in[-2,2]\) of particles, \(i=1,2,3\), \(j=1,2\), using uniform random distribution. After 50 experiments, we obtain the two global minima at every experiment. Except two experiments, the global minima are found at the first step iteration for most cases, which shows that the QNSO algorithm has a high efficiency and good accuracy to find the optimal solution for the problem in this example. In order to verify the convergence efficiency of the proposed method, we compare the optimization results of the QNSO algorithm with the results derived by the approaches in [6,29]. For the neural networks in all the three methods, we take the scaling parameter \(\epsilon=10^{-3}\). Figures 3-5 show the convergence of the trajectory of the proposed neural network (7), the projection neural network in [6], and the recurrent neural network in [29] at the first iteration, respectively. As shown in the figures, each particle converges to its local optimum shortly. It can be seen that, among the three methods, the proposed neural network has the fastest convergence speed. Figure 3: Convergence of the proposed neural network. Figure 2: Contour map of \(f\) in Example 1, where different color lines represent contours corresponding to different values of \(f\). Figure 6 shows the behavior of particles in the search process by the proposed QNSO algorithm. The initial positions of particles are randomly selected. After one iteration, two particles reach the global minima along the direction perpendicular to the contour. Figure 4: Convergence of the neural network in [6]. Figure 5: Convergence of the neural network in [29]. **Example 2**. : _Consider the optimization problem of the constrained Rastrigrin function described by_  
\[ \begin{array}{ll}\min&f(x)=\sum\limits_{i=1}^{n}\left(x_{i}^{2}-10\cos\left(2 \pi x_{i}\right)+10\right),\\ \text{subject to}&-6\leq x_{i}\leq 6,\\ &\sum\limits_{i=1}^{n}x_{i}^{2}\geq 4.5,\end{array}  \tag{11}\]  
_which has hundreds of local minima and many global minima for \(n\geq 4\). Note that the origin, which is the global minimum point for unconstrained Rastrigrin function, is not within the feasible range.