# Adaptive Mutation Dynamic Search Fireworks Algorithm
## 3 Adaptive Mutation Dynamic Search Fireworks Algorithm  
The mutation operation is an important step in the swarm intelligence algorithm. Different mutation schemes have different search characteristics. [PERSON] pointed out that the Gaussian mutation has a strong local development ability [14]. [PERSON] illustrated that the Levy mutation not only improves the global optimization ability of the algorithm, but also helps the algorithm jump out of the local optimal solution and keeps the diversity of the population [15]. Thus, combining the Gaussian mutation with the Levy mutation is an effective way to improve the exploitation and exploration of dynFWA.  
For the core firework, for each iteration, two mutation schemes are alternatives to be conducted based on a probability \(p\). The new mutation strategy is defined as:  
\[X^{\prime}_{CF}=\left\{\begin{array}{ll}X_{CF}+X_{CF}\otimes Gaussian()\,&if\ E<p\\ X_{CF}+X_{CF}\otimes Levy(),&Otherwise\end{array}\right. \tag{7}\]  
where \(p\) is a probability parameter, \(X_{CF}\) is the core firework in the current population, and the symbol \(\otimes\) represents the dot product. _Gaussian_() is a random number generated by the normal distribution with mean parameter \(mu=0\) and standard deviation parameter \(sigma=1\), and _Levy_() is a random number generated by the Levy distribution, and it can be calculated with the parameter \(\beta=1.5\)[16]. The value of \(E\) varies dynamically with the evolution of the population, with reference to the annealing function of the simulated annealing algorithm, and the value of \(E\) is expected to change exponentially, and it is calculated as follows:  
\[E=e^{-(2t/T_{max})^{2}} \tag{8}\]  
where \(t\) is the current function evaluations, and \(T_{max}\) is the maximum number of function evaluations.  
To sum up, another type of sparks, the mutation sparks, are generated based on an adaptive mutation process (Algorithm 2). This algorithm is performed \(N_{m}\) times, each time with the core firework \(X_{CF}\) (\(N_{m}\) is a constant to control the number of mutation sparks).  
```
Set the value of mutation probability \(p\)  Find out the core firework \(X_{CF}\) in current population  Calculate the value of \(E\) by Equation (8)  Set \(z=rand\) (\(1\), \(d\))  For \(k=1\):\(d\) do  If \(k\in z\) then  Production spark \(X_{CF}\)' by Equation (7)  If \(X_{CF}\)' out of bounds \(X_{CF}\)' = \(X_{min}+rand\)* (\(X_{max}-X_{min}\))  End if  End if  End for
```  
**Algorithm 2** Generating Mutation Sparks  
Where \(d\) is the number of dimensions, \(X_{\text{min}}\) is the lower bound, and \(X_{\text{max}}\) is the upper bound.  
As Figure 1 shows, the Levy mutation has a stronger perturbation effect than the Gaussian mutation. In the Levy mutation, the occasional larger values can effectively help jump out of the local optimum and keep the diversity of the population. On the contrary, the Gaussian mutation has better stability, which improves the local search ability.  
Figure 1: The value produced by the Levy mutation and Gaussian mutation.  
The flowchart of the adaptive mutation dynamic search fireworks algorithm (AMdynFWA) is shown in Figure 2.  
Algorithm 3 demonstrates the complete version of the AMdynFWA.  
```
Randomly choosing \(m\) fireworks Assess their fitness Repeat Obtain \(A_{i}\) (except for \(A_{CF}\)) Obtain \(A_{CF}\) by Equation (6) Obtain \(S_{i}\) Produce explosion sparks Produce mutation sparks Assess all sparks' fitness Retain the best spark as a firework Select other \(m-1\) fireworks randomly Until termination condition is satisfied Return the best fitness and a firework location
```  
**Algorithm 3** Pseudo-Code of AMdynFWA