# Quantum Behaved Particle Swarm Optimization Algorithm Based on Artificial Fish Swarm

Authors: Dong Yumin; Zhao Li
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

Quantum behaved particle swarm algorithm is a new intelligent optimization algorithm; the algorithm has less parameters and is easily implemented. In view of the existing quantum behaved particle swarm optimization algorithm for the premature convergence problem, put forward a quantum particle swarm optimization algorithm based on artificial fish swarm. The new algorithm based on quantum behaved particle swarm algorithm, introducing the swarm
and following activities, meanwhile using the adaptive parameters, to avoid it falling into local
extremum of population. The experimental results show the improved algorithm to improve the optimization ability of the algorithm.


---

## Body

## 1. Introduction

Quantum behaved particle swarm algorithm is first proposed by Sun et al. [1] in 2004. Quantum behaved particle swarm optimization algorithm introduces quantum computing into the particle swarm algorithm, starting from the mechanical point of view that the particle in the space has quantum behavior. The algorithm overcomes the disadvantages while preserving the advantages of particle swarm algorithm, which can effectively improve the performance of optimization algorithms.Research on the quantum particle swarm optimization mainly focuses on the following three aspects: The first one is proof theoretic research, the second one is to improve the contraction expansion factor, and the third one is combined with other algorithms. In 2005, Moore and Venayagamoorthy [2] proposed quantum particle swarm algorithm for the combinational logic circuit. In 2006, Mikki and Kishk [3] proposed a quantum mechanical particle swarm algorithm based on electromagnetism and is used to optimize the electromagnetic aspects.Quantum particle swarm optimization (QPSO) is in the field of medical image watermarking for copyright protection and authentication [4]. The trade-off between the imperceptibility and robustness is one of most serious challenges in digital watermarking system. Image watermarking can be considered as an optimization problem by utilizing human visual system characteristics and QPSO algorithm in adaptive quantization index modulation and singular value decomposition in conjunction with discrete wavelet transform and discrete cosine transform. In the literature [5], a modified and efficient version of the QPSO combined with chaotic sequences (CQPSO) is proposed and evaluated.An artificial fish swarm algorithm based on a filter methodology for trial solutions acceptance is analyzed for general constrained global optimization problems [6]. The preliminary numerical experiments with a well-known benchmark set of engineering design problems show the effectiveness of the proposed method.In the literature [7], an improved dynamic clustering algorithm was presented, which combines the quantum particle swarm algorithm with k-means algorithm by improving the encoding of quantum particles and the introduction of new distance metric rules. The algorithm has a quantum behaved particle swarm global search capability. In order to accelerate the convergence speed, the k-means algorithm is used to optimize every particle. Through the adjustment of the value of the fitness function, our algorithm can search for the optimal clustering number of clusters, so the number of clusters and centers is not subject to subjective factors. Extensive experiments verified the effectiveness of the algorithm.Based on quantum evolutionary algorithm and particle swarm optimization, a quantum particle swarm evolutionary algorithm is proposed [8]. In this algorithm, quantum angle is used to represent the qubit, a new method learning from the idea of particle swarm algorithm which is presented to determine rotation angle. The gate is taken to prevent premature convergence. In the literature [9], analytical optimization techniques suffer from slow convergence in complex solution space. Heuristics-based swarm intelligence is an efficient alternative to analytical optimization techniques. The particle swarm optimization approach is utilized for better and efficient nanodevice modeling.Artificial fish swarm algorithm (AFSA) is a kind of swarm intelligence algorithms which is usually employed in optimization problems [10]. There are many parameters to adjust in AFSA like visual and step. Evaluations of the proposed methods were performed on eight well-known benchmark functions in comparison with standard AFSA and particle swarm optimization (PSO). The overall results show that proposed algorithm can be effective surprisingly.The paper based on the quantum behaved swarm algorithm, combined with the artificial fish swarm algorithm, proposed the new improved quantum particle swarm algorithm. In order to avoid the individual into local extremum, the new algorithm uses the swarm and following behavior, meanwhile it combines with the adaptive parameter adjustment.


## 2. Quantum Particle Swarm Algorithm

### 2.1. The Principle of the Algorithm

According to the principle of quantum mechanics, quantum particle swarm algorithm is proposed by Sun et al. With the help of DELTA potential well, the particle swarm optimization algorithm is applied to the quantum space. The quantum space particle used wave function to describe(1)|Ψ|2dxdydz=Qdxdydz.
Among them, |Ψ|2 is the square of the module of wave function, representing the probability density of particles in a position to appear. Q is the probability density function and satisfies the normalization condition:
(2)∫-∞+∞|Ψ|2dxdydz=∫-∞+∞Qdxdydz=1.Assume that theD dimension of (on behalf of the dimension of the variables associated with problem) quantum space has a population, which consists of n particles. Location of the ith particle is Xi=(xi1,xi2,…,xiD), and the particle through the history of the best location is Pi=(pi1,pi2,…,piD); after all the particles of the best historical position is Pg=(pg1,pg2,…,pgD).In quantum space, positions of particles after the particles get through stochastic simulation of Monte Carlo measurement:(3)xid=pid±L2ln⁡(1u)(i=1,2,…,n)(d=1,2,…,D).
Among them, u is the random number range of [0,1]. L is obtained by the particle’s current position and historical best position is L=2·β·|pid-xid|. Thus, get the update formula of quantum particle swarm optimization:
(4)xid(t+1)=pid±β·|pid-xid(t)·ln⁡(1u)|.
Among them, t is the iteration number of algorithm. β is the contraction expansion factor and is the only parameter of quantum particle swarm algorithm.In order to avoid the premature convergence, Sun et al. improved quantum particle swarm algorithm, introducingmbest in the algorithm; that is,
(5)mbest(t)=1n∑i=1npi(t)=[1n∑i=1npi1(t),1n∑i=1npi2(t),…,1n∑i=1npiD(t)],
where pi is the best position of ith particles and n is the number of particles. “mbest” find the average best location of n particles and solve problems based on the dimension of the variable.After the introduction ofmbest, the individual update formula is
(6)L=2·β·|mbest-xid|,xid=pid±β·|mbestd-xid|·ln⁡(1u).Therefore, quantum particle swarm optimization particle updating formula can be described as(7)pid=φ·pid+(1-φ)·pgd,mbest(t)=1n∑i=1nPi(t)=[1n∑i=1npi1(t),1n∑i=1npi2(t),…,1n∑i=1npiD(t)],Xi(t+1)=Pi±β·|mbest-Xi(t)|·ln⁡(1u).
Among them, φ is the random number in [0,1]; other parameters are same as the ones mentioned above.


### 2.2. The Algorithm Flow

Quantum particle swarm algorithm flow chart in Figure1 is specifically described as follows.Figure 1
The flowchart of quantum particle swarm algorithm.Step 1.
Initialize algorithm parameters (population sizen, particle dimension d, the maximum number of iterations MAXGEN), population initialization, initialization particles history pi, and global history optimal value pg.Step 2.
Evaluate individual fitness value.Step 3.
Update the optimal population in history. The particle’s fitness is better than the particle history itself, with the current value of the replacement; otherwise, the history optimal particles remain unchanged.Step 4.
Update the history global optimal particle in a population, the best fitness value of all the particles in the population.Step 5.
Update particles by using quantum behaved particle swarm optimization algorithm formula, all the particles in space.Step 6.
If the algorithm reaches the maximum number of iterations, then output the optimal solution, and the algorithm terminates; otherwise, continue to implement the Step2.


## 2.1. The Principle of the Algorithm

According to the principle of quantum mechanics, quantum particle swarm algorithm is proposed by Sun et al. With the help of DELTA potential well, the particle swarm optimization algorithm is applied to the quantum space. The quantum space particle used wave function to describe(1)|Ψ|2dxdydz=Qdxdydz.
Among them, |Ψ|2 is the square of the module of wave function, representing the probability density of particles in a position to appear. Q is the probability density function and satisfies the normalization condition:
(2)∫-∞+∞|Ψ|2dxdydz=∫-∞+∞Qdxdydz=1.Assume that theD dimension of (on behalf of the dimension of the variables associated with problem) quantum space has a population, which consists of n particles. Location of the ith particle is Xi=(xi1,xi2,…,xiD), and the particle through the history of the best location is Pi=(pi1,pi2,…,piD); after all the particles of the best historical position is Pg=(pg1,pg2,…,pgD).In quantum space, positions of particles after the particles get through stochastic simulation of Monte Carlo measurement:(3)xid=pid±L2ln⁡(1u)(i=1,2,…,n)(d=1,2,…,D).
Among them, u is the random number range of [0,1]. L is obtained by the particle’s current position and historical best position is L=2·β·|pid-xid|. Thus, get the update formula of quantum particle swarm optimization:
(4)xid(t+1)=pid±β·|pid-xid(t)·ln⁡(1u)|.
Among them, t is the iteration number of algorithm. β is the contraction expansion factor and is the only parameter of quantum particle swarm algorithm.In order to avoid the premature convergence, Sun et al. improved quantum particle swarm algorithm, introducingmbest in the algorithm; that is,
(5)mbest(t)=1n∑i=1npi(t)=[1n∑i=1npi1(t),1n∑i=1npi2(t),…,1n∑i=1npiD(t)],
where pi is the best position of ith particles and n is the number of particles. “mbest” find the average best location of n particles and solve problems based on the dimension of the variable.After the introduction ofmbest, the individual update formula is
(6)L=2·β·|mbest-xid|,xid=pid±β·|mbestd-xid|·ln⁡(1u).Therefore, quantum particle swarm optimization particle updating formula can be described as(7)pid=φ·pid+(1-φ)·pgd,mbest(t)=1n∑i=1nPi(t)=[1n∑i=1npi1(t),1n∑i=1npi2(t),…,1n∑i=1npiD(t)],Xi(t+1)=Pi±β·|mbest-Xi(t)|·ln⁡(1u).
Among them, φ is the random number in [0,1]; other parameters are same as the ones mentioned above.


## 2.2. The Algorithm Flow

Quantum particle swarm algorithm flow chart in Figure1 is specifically described as follows.Figure 1
The flowchart of quantum particle swarm algorithm.Step 1.
Initialize algorithm parameters (population sizen, particle dimension d, the maximum number of iterations MAXGEN), population initialization, initialization particles history pi, and global history optimal value pg.Step 2.
Evaluate individual fitness value.Step 3.
Update the optimal population in history. The particle’s fitness is better than the particle history itself, with the current value of the replacement; otherwise, the history optimal particles remain unchanged.Step 4.
Update the history global optimal particle in a population, the best fitness value of all the particles in the population.Step 5.
Update particles by using quantum behaved particle swarm optimization algorithm formula, all the particles in space.Step 6.
If the algorithm reaches the maximum number of iterations, then output the optimal solution, and the algorithm terminates; otherwise, continue to implement the Step2.


## 3. An Improved Quantum Behaved Particle Swarm Algorithm

For quantum particle swarm algorithm, due to the small parameter and the solving speed of algorithm, many scholars have joined the ranks of the algorithm, but the premature convergence may also exist. In order to optimize the algorithm, put forward a quantum particle swarm optimization algorithm based on artificial fish swarm, abbreviated as QAFSP.


### 3.1. Improvement Strategies

#### 3.1.1. Swarm and Follow

In the improved QAFSP algorithm, for the individualXi updates, cluster operates to the optimal position of the history of Pi particles. Based on Pi   and searching other individuals within the perceived distance together constitute a search region. Calculate and record the center position Xp·cen and value f(Xp·cen) to the small area. If the f(Xp·cen) is better and the center around the position is not too crowded, so the individual Xi   moves to the Xp·cen direction, and the moving formula is as follows:(8)Xnewi=Xi+rand()·step·Xp·cen-Xi∥Xp·cen-Xi∥.If the mobile requirement is not met, the individualXi performing quantum particle swarm particle updating formula gets the new state of particles.The introduction of polygroup activities which can help particle has been or is about to fall into the local extremum to escape, moving toward the optimal direction, to improve the quantum particle swarm algorithm local convergence. Similarly, the rear-end activities are also conducted for the individualXi and the current particle best position Pi to be carried out. Take the minimum value problem as an example, rear-end activity is based on the Pi, searches for the minimum value of individual Xp·min among its sensing range. The all individuals within the perceived distance of Xp·min together form a small region. If the fitness value of Xp·min is better, and the small region is not too crowded, then the individual Xi moves towards the direction of Xp·min position:
(9)Xnewi=Xi+rand()·step·Xmin⁡-Xi∥Xmin⁡-Xi∥.If the mobile requirement is not met, then the particlesXi perform the updating formula of the quantum particle swarm algorithm and get the new state of particles.Introduction of rear-end activities and enabling space particle to move toward better accelerate the speed of the individuals to be close to better solutions. In addition, this can help the individual to jump out of local minimum, to prevent it falling into local extreme and to stop the search.


#### 3.1.2. Adaptive Adjustment

The shrinkage factorβ is the only parameter of quantum particle swarm algorithm; how to choose can affect the overall performance of the proposed algorithm. If the contraction factor is too large, the algorithm convergence has long search time and too slow time; if it is too small, this can make the algorithm into a local optimal solution.In order to avoid the defects of shrinkage factor fixed, use adaptive shrinkage factor to improve QAFSP algorithm. The shrinkage factor is defined as a function associated with the evolution algebra:(10)β=(1-0.5)·MAXGEN-tMAXGEN+0.5.
Among them, MAXGEN is the maximum number of iterative algorithms; t is the evolution algebra.As can be seen, the shrinkage factor in the initial stage of algorithm is greatly easy to large range for group search. Accompanied by optimization algorithm, the shrinkage factor decreases gradually, the individual searching scope reduces. And it starts to fine search among the local area.Another parameter to be automatically adjusted is the moving step in the clusters and rear end. Similar to the shrinkage factor, step size has a direct impact on the performance of the proposed algorithm. The individuals with larger step size expand those searching scope, and the individuals with smaller step size start to fine search among the local area.In the improved quantum particle swarm algorithm QAFSP, use the adaptive step size adjustment. Based on fitness value ofXp·cen in the cluster or Xp·min in rear end, the ratio of Xi and individual fitness between, automatically adjust the step size, in particular to:(11)|1-f(Xp·cen)f(Xi)|·stepor|1-f(Xp·min)f(Xi)|·step.
Therefore, when the individual Xi is closer to Xp·cen or Xp·min, step of smaller values is more suitable for fine search in a small range. On the contrary, the adaptive step of larger size is suitable for moving in large scope. Adaptive step size selection can balance the local and global search ability, improving the ability of the algorithm.


### 3.2. Quantum Behaved Particle Swarm Optimization Algorithm Based on Artificial Fish Swarm

The proposed quantum particle swarm optimization algorithm based on artificial fish swarm, the basic process shown in Figure2, can be described as follows.Figure 2
Flowchart of the quantum particle swarm algorithm based on artificial fish.Step 1.
Initialize algorithm parameters (population sizen, the number of iterations MAXGEN, perceived distance, the maximum number of temptation, the maximum step size, and crowding factor) and population initialization.Step 2.
Evaluate individual fitness value of the population. Do records particle history optimal and populations of the globally best.Step 3.
Implement quantum particle swarm optimization particle updating formula; the particleXi is updated.Step 4.
Update the optimal particle itself and update the globally best population.Step 5.
For polygroup activities, according to the history of optimalPi particles Xi, particles are perceived within the scope of the center Pi. If it meets the mobile condition, Pi move to the center position direction; if not satisfied, then perform particle update.Step 6.
For rear-end activity, according to the historical optimumPi particle Xi, get the minimum fitness value of individual particles in the Pi perception. If it meets the mobile condition, Pi move to the minimum fitness position direction of individual; otherwise, perform particle update.Step 7.
To compare Step6 to Step 7, newly produced particles, choose those better fitness values, updated Xi.Step 8.
Update the particle’s own history and the globally best optimal of population.Step 9.
If the maximum number of iterations is reached, then output the optimal solution, and the algorithm terminates; otherwise, continue to implement Step3.Compared with quantum particle swarm algorithm, the improved algorithm adopts swarming and rear-end activities and basis on the best position of particle. In addition, the swarming and rear end use adaptive step length adjusting operation and dynamically change the length of the particles moving step; in update formula of the particles, adaptive shrinkage factor is also used, according the size of iterative search to automatic adjust.


## 3.1. Improvement Strategies

### 3.1.1. Swarm and Follow

In the improved QAFSP algorithm, for the individualXi updates, cluster operates to the optimal position of the history of Pi particles. Based on Pi   and searching other individuals within the perceived distance together constitute a search region. Calculate and record the center position Xp·cen and value f(Xp·cen) to the small area. If the f(Xp·cen) is better and the center around the position is not too crowded, so the individual Xi   moves to the Xp·cen direction, and the moving formula is as follows:(8)Xnewi=Xi+rand()·step·Xp·cen-Xi∥Xp·cen-Xi∥.If the mobile requirement is not met, the individualXi performing quantum particle swarm particle updating formula gets the new state of particles.The introduction of polygroup activities which can help particle has been or is about to fall into the local extremum to escape, moving toward the optimal direction, to improve the quantum particle swarm algorithm local convergence. Similarly, the rear-end activities are also conducted for the individualXi and the current particle best position Pi to be carried out. Take the minimum value problem as an example, rear-end activity is based on the Pi, searches for the minimum value of individual Xp·min among its sensing range. The all individuals within the perceived distance of Xp·min together form a small region. If the fitness value of Xp·min is better, and the small region is not too crowded, then the individual Xi moves towards the direction of Xp·min position:
(9)Xnewi=Xi+rand()·step·Xmin⁡-Xi∥Xmin⁡-Xi∥.If the mobile requirement is not met, then the particlesXi perform the updating formula of the quantum particle swarm algorithm and get the new state of particles.Introduction of rear-end activities and enabling space particle to move toward better accelerate the speed of the individuals to be close to better solutions. In addition, this can help the individual to jump out of local minimum, to prevent it falling into local extreme and to stop the search.


### 3.1.2. Adaptive Adjustment

The shrinkage factorβ is the only parameter of quantum particle swarm algorithm; how to choose can affect the overall performance of the proposed algorithm. If the contraction factor is too large, the algorithm convergence has long search time and too slow time; if it is too small, this can make the algorithm into a local optimal solution.In order to avoid the defects of shrinkage factor fixed, use adaptive shrinkage factor to improve QAFSP algorithm. The shrinkage factor is defined as a function associated with the evolution algebra:(10)β=(1-0.5)·MAXGEN-tMAXGEN+0.5.
Among them, MAXGEN is the maximum number of iterative algorithms; t is the evolution algebra.As can be seen, the shrinkage factor in the initial stage of algorithm is greatly easy to large range for group search. Accompanied by optimization algorithm, the shrinkage factor decreases gradually, the individual searching scope reduces. And it starts to fine search among the local area.Another parameter to be automatically adjusted is the moving step in the clusters and rear end. Similar to the shrinkage factor, step size has a direct impact on the performance of the proposed algorithm. The individuals with larger step size expand those searching scope, and the individuals with smaller step size start to fine search among the local area.In the improved quantum particle swarm algorithm QAFSP, use the adaptive step size adjustment. Based on fitness value ofXp·cen in the cluster or Xp·min in rear end, the ratio of Xi and individual fitness between, automatically adjust the step size, in particular to:(11)|1-f(Xp·cen)f(Xi)|·stepor|1-f(Xp·min)f(Xi)|·step.
Therefore, when the individual Xi is closer to Xp·cen or Xp·min, step of smaller values is more suitable for fine search in a small range. On the contrary, the adaptive step of larger size is suitable for moving in large scope. Adaptive step size selection can balance the local and global search ability, improving the ability of the algorithm.


## 3.1.1. Swarm and Follow

In the improved QAFSP algorithm, for the individualXi updates, cluster operates to the optimal position of the history of Pi particles. Based on Pi   and searching other individuals within the perceived distance together constitute a search region. Calculate and record the center position Xp·cen and value f(Xp·cen) to the small area. If the f(Xp·cen) is better and the center around the position is not too crowded, so the individual Xi   moves to the Xp·cen direction, and the moving formula is as follows:(8)Xnewi=Xi+rand()·step·Xp·cen-Xi∥Xp·cen-Xi∥.If the mobile requirement is not met, the individualXi performing quantum particle swarm particle updating formula gets the new state of particles.The introduction of polygroup activities which can help particle has been or is about to fall into the local extremum to escape, moving toward the optimal direction, to improve the quantum particle swarm algorithm local convergence. Similarly, the rear-end activities are also conducted for the individualXi and the current particle best position Pi to be carried out. Take the minimum value problem as an example, rear-end activity is based on the Pi, searches for the minimum value of individual Xp·min among its sensing range. The all individuals within the perceived distance of Xp·min together form a small region. If the fitness value of Xp·min is better, and the small region is not too crowded, then the individual Xi moves towards the direction of Xp·min position:
(9)Xnewi=Xi+rand()·step·Xmin⁡-Xi∥Xmin⁡-Xi∥.If the mobile requirement is not met, then the particlesXi perform the updating formula of the quantum particle swarm algorithm and get the new state of particles.Introduction of rear-end activities and enabling space particle to move toward better accelerate the speed of the individuals to be close to better solutions. In addition, this can help the individual to jump out of local minimum, to prevent it falling into local extreme and to stop the search.


## 3.1.2. Adaptive Adjustment

The shrinkage factorβ is the only parameter of quantum particle swarm algorithm; how to choose can affect the overall performance of the proposed algorithm. If the contraction factor is too large, the algorithm convergence has long search time and too slow time; if it is too small, this can make the algorithm into a local optimal solution.In order to avoid the defects of shrinkage factor fixed, use adaptive shrinkage factor to improve QAFSP algorithm. The shrinkage factor is defined as a function associated with the evolution algebra:(10)β=(1-0.5)·MAXGEN-tMAXGEN+0.5.
Among them, MAXGEN is the maximum number of iterative algorithms; t is the evolution algebra.As can be seen, the shrinkage factor in the initial stage of algorithm is greatly easy to large range for group search. Accompanied by optimization algorithm, the shrinkage factor decreases gradually, the individual searching scope reduces. And it starts to fine search among the local area.Another parameter to be automatically adjusted is the moving step in the clusters and rear end. Similar to the shrinkage factor, step size has a direct impact on the performance of the proposed algorithm. The individuals with larger step size expand those searching scope, and the individuals with smaller step size start to fine search among the local area.In the improved quantum particle swarm algorithm QAFSP, use the adaptive step size adjustment. Based on fitness value ofXp·cen in the cluster or Xp·min in rear end, the ratio of Xi and individual fitness between, automatically adjust the step size, in particular to:(11)|1-f(Xp·cen)f(Xi)|·stepor|1-f(Xp·min)f(Xi)|·step.
Therefore, when the individual Xi is closer to Xp·cen or Xp·min, step of smaller values is more suitable for fine search in a small range. On the contrary, the adaptive step of larger size is suitable for moving in large scope. Adaptive step size selection can balance the local and global search ability, improving the ability of the algorithm.


## 3.2. Quantum Behaved Particle Swarm Optimization Algorithm Based on Artificial Fish Swarm

The proposed quantum particle swarm optimization algorithm based on artificial fish swarm, the basic process shown in Figure2, can be described as follows.Figure 2
Flowchart of the quantum particle swarm algorithm based on artificial fish.Step 1.
Initialize algorithm parameters (population sizen, the number of iterations MAXGEN, perceived distance, the maximum number of temptation, the maximum step size, and crowding factor) and population initialization.Step 2.
Evaluate individual fitness value of the population. Do records particle history optimal and populations of the globally best.Step 3.
Implement quantum particle swarm optimization particle updating formula; the particleXi is updated.Step 4.
Update the optimal particle itself and update the globally best population.Step 5.
For polygroup activities, according to the history of optimalPi particles Xi, particles are perceived within the scope of the center Pi. If it meets the mobile condition, Pi move to the center position direction; if not satisfied, then perform particle update.Step 6.
For rear-end activity, according to the historical optimumPi particle Xi, get the minimum fitness value of individual particles in the Pi perception. If it meets the mobile condition, Pi move to the minimum fitness position direction of individual; otherwise, perform particle update.Step 7.
To compare Step6 to Step 7, newly produced particles, choose those better fitness values, updated Xi.Step 8.
Update the particle’s own history and the globally best optimal of population.Step 9.
If the maximum number of iterations is reached, then output the optimal solution, and the algorithm terminates; otherwise, continue to implement Step3.Compared with quantum particle swarm algorithm, the improved algorithm adopts swarming and rear-end activities and basis on the best position of particle. In addition, the swarming and rear end use adaptive step length adjusting operation and dynamically change the length of the particles moving step; in update formula of the particles, adaptive shrinkage factor is also used, according the size of iterative search to automatic adjust.


## 4. Function Optimization and Simulation Experiment

### 4.1. Test Function

The improved algorithm is applied to a test function for function optimization. Use the following test functions:(1)(12)f1(x)=x6-15x4+27x2+250x∈[-100,100](2)(13)f2(x,y)=sin2x2+y2-0.5[1+0.001(x2+y2)]2-0.5x,y∈[-100,100](3)(14)f3(x,y)=(4-2.1x2+x43)x2+xy+(-4+4y2)y2x,y∈[-100,100](4)(15)f4(x,y)=3(1-x)2e-x2-(y+1)2-10(x5-x3-y5)e-x2-y2-13e-(x+1)2-y2mmmmmmmmmmmmmmmmx,y∈[-3,3](5)(16)f5(x)=∑i=1n(xi2-10cos⁡(2πxi)+10)xi∈[-5.12,5.12](6)(17)f6(x)=∑i=1n-1(xi2+xi+12)0.25[sin2(50(xi2+xi+12)0.1)+1]xi∈[-100,100](7)(18)f7(x)=∑i=1nxi2xi∈[-100,100](8)(19)f8(x)=-20exp⁡(-0.2130∑i=1nxi2)-exp⁡⁡(130∑i=1ncos⁡⁡(2πxi))+20+emmmmmmmmmmmxi∈[-32,32].
Minimum theoretical test functions f5~f8 are 0. The theory of f1~f4 minimum, respectively, is 7, −1, −1.0316, −6.5511.


### 4.2. The Experimental Design

The improved quantum particle swarm optimization algorithm based on artificial fish algorithm(QAFSP), quantum particle swarm algorithm (QPSO), quantum genetic algorithm (QGA), and artificial fish swarm algorithm (AFSA), of four kinds of algorithms, was applied to the eight minimum test functions. Experiments were carried out in environment of MATLAB R2008b; the computer processor is Intel(R), Core(TM)2, Quad CPU Q9400 @2.66 GHz (4 CPUs), and the RAM is 2048 MB. Each algorithm for each test function is repeated in 50 independent experiments.Algorithm of QAFSP, QPSO, and AFSA adopts real coding and QGA coding using qubits. For multidimensional functions,f5 take dimension n=5, f6 take dimension n=10, and f7 and f8 take dimension n=30. The specific parameter of each algorithm is shown in Table 1.Table 1
The parameters of the algorithm.
Population scale
Maximum number of iterations
Individual test times
Individual perception of distance
Congestion factor
The maximum step size
Code length
f
1
QAFSP
20
50
5
50
1.618
0.1
—
QPSO
20
50
—
—
—
—
—
QGA
100
100
—
—
—
—
20
AFSA
100
100
5
50
11.618
1.25
—
f
2
QAFSP
100
100
5
150
1.618
0.1
—
QPSO
100
100
—
—
—
—
—
QGA
150
100
—
—
—
—
20
AFSA
150
100
5
150
11.618
1.25
—
f
3
QAFSP
10
50
5
100
1.618
0.1
—
QPSO
10
50
—
—
—
—
—
QGA
200
100
—
—
—
—
20
AFSA
200
100
10
100
11.618
1.25
—
f
4
QAFSP
20
50
5
5
1.618
0.1
—
QPSO
20
50
—
—
—
—
—
QGA
50
50
—
—
—
—
20
AFSA
20
50
5
5
11.618
1.25
—
f
5
QAFSP
200
100
5
10
1.618
1.25
—
QPSO
200
100
—
—
—
—
—
QGA
200
100
—
—
—
—
20
AFSA
200
100
20
10
11.618
11.25
—
f
6
QAFSP
150
100
5
200
1.618
0.1
—
QPSO
200
200
—
—
—
—
—
QGA
200
100
—
—
—
—
20
AFSA
200
200
50
200
61.618
21.25
—
f
7
QAFSP
50
100
5
300
1.618
0.1
—
QPSO
200
100
—
—
—
—
—
QGA
200
100
—
—
—
—
5
AFSA
200
100
20
300
61.618
21.25
—
f
8
QAFSP
100
100
5
100
1.618
0.1
—
QPSO
200
100
—
—
—
—
—
QGA
200
100
—
—
—
—
5
AFSA
200
100
20
100
11.618
11.25
—


### 4.3. Experimental Results and Analysis

The accuracy of the function is 10−3, when the difference between optimal value from algorithm and the theoretical minimum value is less than 10−3, denoted by algorithm for success. Define the algorithm success rate, the number of times for successful and independent experiment ratio. Four kinds of algorithms on eight benchmark functions result in Table 2.Table 2
The test function optimization results.
The optimal solution
Average value
The average operation time (seconds)
The number of successful
The success rate
f
1
QAFSP
7
7
0.21
50
1
QPSO
7
7.0004
0.03
45
0.9
QGA
7
7.0009
2.07
40
0.8
AFSA
7
7.0019
3.54
37
0.74
f
2
QAFSP
−1
−0.99902
4.16
45
0.9
QPSO
−1
−0.99756
0.31
35
0.7
QGA
−1
−0.99137
5.59
19
0.38
AFSA
−1
−0.95641
9.03
0
0
f
3
QAFSP
−1.0316
−1.0316
0.10
50
1
QPSO
−1.0316
−1.0315
0.02
49
0.98
QGA
−1.0316
−0.8293
7.58
14
0.28
AFSA
−1.0316
20.1389
11.83
12
0.24
f
4
QAFSP
−6.5511
−6.5511
0.22
50
1
QPSO
−6.5511
−6.5457
0.03
49
0.98
QGA
−6.5511
−6.4807
0.95
8
0.16
AFSA
−6.5511
−6.5502
0.23
34
0.68
f
5
QAFSP
1.8838
e
-
10
1.4904
e
-
5
13.26
50
1
QPSO
0.00012216
0.13664
0.64
6
0.12
QGA
2.365
e
-
8
3.7042
18.55
4
0.08
AFSA
0.23427
5.9101
16.87
0
0
f
6
QAFSP
1.8495
e
-
7
0.00021545
9.65
49
0.98
QPSO
6.4956
e
-
5
0.00076334
1.52
42
0.84
QGA
0.079839
5.7882
37.15
0
0
AFSA
13.6422
25.9938
39.69
0
0
f
7
QAFSP
1.1224
e
-
6
9.4379
e
-
6
2.05
50
1
QPSO
0.026063
0.07969
0.75
0
0
QGA
14464.0999
27368.9906
27.81
0
0
AFSA
1364.2993
8233.3037
17.91
0
0
f
8
QAFSP
1.0984
e
-
5
3.4666
e
-
5
6.45
50
1
QPSO
0.034844
0.1822
0.90
0
0
QGA
3.1575
3.2964
27.93
0
0
AFSA
9.5439
12.1968
26.76
0
0As can be seen from the table, strong optimization ability of quantum particle swarm algorithm (QAFSP) is based on artificial fish school. Using the same even smaller population size, the number of iterations, compared with the other three algorithms, QAFSP solves the optimal solution closer to the theoretical minimum function. In separate experiments 50 times, the number of successful optimization QAFSP is more and the success rate is close to 1. Experimental results show that the improved algorithm can be relatively stable to meet the accuracy requirements of searching the global optimum. In addition, the test functions include higher dimension complex functions, although the other three algorithms to optimize the effect of low-dimensional test function better, the high-dimensional functions lose the optimization capabilities gradually, meanwhile QAFSP Shows better optimization ability to high-dimensional functions or low-dimensional functions.In Figures3, 4, 5, 6, 7, 8, 9, and 10 four algorithms on eight test function optimization iterations convergence plan were given. Where “fitness” represents the result value of test functions during the algorithm runs, “evolution algebra” is the number of iterations performed for solving test functions.Convergence curve test functionf1.
(a)
Evolutionary graph
(b)
Evolutionary partial graphConvergence curve test functionf2.
(a)
Evolutionary graph
(b)
Evolutionary partial graphConvergence curve test functionf3.
(a)
Evolutionary graph
(b)
Evolutionary partial graphFigure 6
Convergence curve test functionf4.Figure 7
Convergence curve test functionf5.Figure 8
Convergence curve test functionf6.Figure 9
Convergence curve test functionf7.Figure 10
Convergence curve test functionf8.From the convergence graph functions, you can see that quantum particle swarm algorithm based on artificial fish (QAFSP) has better convergence. Compared with the other three optimization algorithms, QAFSP is fast and stable convergence. Experimental results show that the improved quantum particle swam optimization improved quantum particle swarm premature convergence and effectively improved the performance of the algorithm.


## 4.1. Test Function

The improved algorithm is applied to a test function for function optimization. Use the following test functions:(1)(12)f1(x)=x6-15x4+27x2+250x∈[-100,100](2)(13)f2(x,y)=sin2x2+y2-0.5[1+0.001(x2+y2)]2-0.5x,y∈[-100,100](3)(14)f3(x,y)=(4-2.1x2+x43)x2+xy+(-4+4y2)y2x,y∈[-100,100](4)(15)f4(x,y)=3(1-x)2e-x2-(y+1)2-10(x5-x3-y5)e-x2-y2-13e-(x+1)2-y2mmmmmmmmmmmmmmmmx,y∈[-3,3](5)(16)f5(x)=∑i=1n(xi2-10cos⁡(2πxi)+10)xi∈[-5.12,5.12](6)(17)f6(x)=∑i=1n-1(xi2+xi+12)0.25[sin2(50(xi2+xi+12)0.1)+1]xi∈[-100,100](7)(18)f7(x)=∑i=1nxi2xi∈[-100,100](8)(19)f8(x)=-20exp⁡(-0.2130∑i=1nxi2)-exp⁡⁡(130∑i=1ncos⁡⁡(2πxi))+20+emmmmmmmmmmmxi∈[-32,32].
Minimum theoretical test functions f5~f8 are 0. The theory of f1~f4 minimum, respectively, is 7, −1, −1.0316, −6.5511.


## 4.2. The Experimental Design

The improved quantum particle swarm optimization algorithm based on artificial fish algorithm(QAFSP), quantum particle swarm algorithm (QPSO), quantum genetic algorithm (QGA), and artificial fish swarm algorithm (AFSA), of four kinds of algorithms, was applied to the eight minimum test functions. Experiments were carried out in environment of MATLAB R2008b; the computer processor is Intel(R), Core(TM)2, Quad CPU Q9400 @2.66 GHz (4 CPUs), and the RAM is 2048 MB. Each algorithm for each test function is repeated in 50 independent experiments.Algorithm of QAFSP, QPSO, and AFSA adopts real coding and QGA coding using qubits. For multidimensional functions,f5 take dimension n=5, f6 take dimension n=10, and f7 and f8 take dimension n=30. The specific parameter of each algorithm is shown in Table 1.Table 1
The parameters of the algorithm.
Population scale
Maximum number of iterations
Individual test times
Individual perception of distance
Congestion factor
The maximum step size
Code length
f
1
QAFSP
20
50
5
50
1.618
0.1
—
QPSO
20
50
—
—
—
—
—
QGA
100
100
—
—
—
—
20
AFSA
100
100
5
50
11.618
1.25
—
f
2
QAFSP
100
100
5
150
1.618
0.1
—
QPSO
100
100
—
—
—
—
—
QGA
150
100
—
—
—
—
20
AFSA
150
100
5
150
11.618
1.25
—
f
3
QAFSP
10
50
5
100
1.618
0.1
—
QPSO
10
50
—
—
—
—
—
QGA
200
100
—
—
—
—
20
AFSA
200
100
10
100
11.618
1.25
—
f
4
QAFSP
20
50
5
5
1.618
0.1
—
QPSO
20
50
—
—
—
—
—
QGA
50
50
—
—
—
—
20
AFSA
20
50
5
5
11.618
1.25
—
f
5
QAFSP
200
100
5
10
1.618
1.25
—
QPSO
200
100
—
—
—
—
—
QGA
200
100
—
—
—
—
20
AFSA
200
100
20
10
11.618
11.25
—
f
6
QAFSP
150
100
5
200
1.618
0.1
—
QPSO
200
200
—
—
—
—
—
QGA
200
100
—
—
—
—
20
AFSA
200
200
50
200
61.618
21.25
—
f
7
QAFSP
50
100
5
300
1.618
0.1
—
QPSO
200
100
—
—
—
—
—
QGA
200
100
—
—
—
—
5
AFSA
200
100
20
300
61.618
21.25
—
f
8
QAFSP
100
100
5
100
1.618
0.1
—
QPSO
200
100
—
—
—
—
—
QGA
200
100
—
—
—
—
5
AFSA
200
100
20
100
11.618
11.25
—


## 4.3. Experimental Results and Analysis

The accuracy of the function is 10−3, when the difference between optimal value from algorithm and the theoretical minimum value is less than 10−3, denoted by algorithm for success. Define the algorithm success rate, the number of times for successful and independent experiment ratio. Four kinds of algorithms on eight benchmark functions result in Table 2.Table 2
The test function optimization results.
The optimal solution
Average value
The average operation time (seconds)
The number of successful
The success rate
f
1
QAFSP
7
7
0.21
50
1
QPSO
7
7.0004
0.03
45
0.9
QGA
7
7.0009
2.07
40
0.8
AFSA
7
7.0019
3.54
37
0.74
f
2
QAFSP
−1
−0.99902
4.16
45
0.9
QPSO
−1
−0.99756
0.31
35
0.7
QGA
−1
−0.99137
5.59
19
0.38
AFSA
−1
−0.95641
9.03
0
0
f
3
QAFSP
−1.0316
−1.0316
0.10
50
1
QPSO
−1.0316
−1.0315
0.02
49
0.98
QGA
−1.0316
−0.8293
7.58
14
0.28
AFSA
−1.0316
20.1389
11.83
12
0.24
f
4
QAFSP
−6.5511
−6.5511
0.22
50
1
QPSO
−6.5511
−6.5457
0.03
49
0.98
QGA
−6.5511
−6.4807
0.95
8
0.16
AFSA
−6.5511
−6.5502
0.23
34
0.68
f
5
QAFSP
1.8838
e
-
10
1.4904
e
-
5
13.26
50
1
QPSO
0.00012216
0.13664
0.64
6
0.12
QGA
2.365
e
-
8
3.7042
18.55
4
0.08
AFSA
0.23427
5.9101
16.87
0
0
f
6
QAFSP
1.8495
e
-
7
0.00021545
9.65
49
0.98
QPSO
6.4956
e
-
5
0.00076334
1.52
42
0.84
QGA
0.079839
5.7882
37.15
0
0
AFSA
13.6422
25.9938
39.69
0
0
f
7
QAFSP
1.1224
e
-
6
9.4379
e
-
6
2.05
50
1
QPSO
0.026063
0.07969
0.75
0
0
QGA
14464.0999
27368.9906
27.81
0
0
AFSA
1364.2993
8233.3037
17.91
0
0
f
8
QAFSP
1.0984
e
-
5
3.4666
e
-
5
6.45
50
1
QPSO
0.034844
0.1822
0.90
0
0
QGA
3.1575
3.2964
27.93
0
0
AFSA
9.5439
12.1968
26.76
0
0As can be seen from the table, strong optimization ability of quantum particle swarm algorithm (QAFSP) is based on artificial fish school. Using the same even smaller population size, the number of iterations, compared with the other three algorithms, QAFSP solves the optimal solution closer to the theoretical minimum function. In separate experiments 50 times, the number of successful optimization QAFSP is more and the success rate is close to 1. Experimental results show that the improved algorithm can be relatively stable to meet the accuracy requirements of searching the global optimum. In addition, the test functions include higher dimension complex functions, although the other three algorithms to optimize the effect of low-dimensional test function better, the high-dimensional functions lose the optimization capabilities gradually, meanwhile QAFSP Shows better optimization ability to high-dimensional functions or low-dimensional functions.In Figures3, 4, 5, 6, 7, 8, 9, and 10 four algorithms on eight test function optimization iterations convergence plan were given. Where “fitness” represents the result value of test functions during the algorithm runs, “evolution algebra” is the number of iterations performed for solving test functions.Convergence curve test functionf1.
(a)
Evolutionary graph
(b)
Evolutionary partial graphConvergence curve test functionf2.
(a)
Evolutionary graph
(b)
Evolutionary partial graphConvergence curve test functionf3.
(a)
Evolutionary graph
(b)
Evolutionary partial graphFigure 6
Convergence curve test functionf4.Figure 7
Convergence curve test functionf5.Figure 8
Convergence curve test functionf6.Figure 9
Convergence curve test functionf7.Figure 10
Convergence curve test functionf8.From the convergence graph functions, you can see that quantum particle swarm algorithm based on artificial fish (QAFSP) has better convergence. Compared with the other three optimization algorithms, QAFSP is fast and stable convergence. Experimental results show that the improved quantum particle swam optimization improved quantum particle swarm premature convergence and effectively improved the performance of the algorithm.


## 5. Conclusion

On the basis of the quantum particle swarm optimization, combinations of artificial fish clusters and rear-end activities, a new improved algorithm is provided. The new algorithms use a dynamic parameter adjustment which is conducive to jump out of local optima and move to global extreme. Through the optimization of test functions, the experimental results show that the improved algorithm can improve the algorithm for solving ability and can better solve the global optimum to meet the accuracy requirements.



---

*Source: 592682-2014-08-28.xml*