# Analysis and Improvement of Fireworks Algorithm
## 3 Analysis and Improvement of Fireworks Algorithm  
### Opposition-Based Learning Population Initialization  
Opposition-based learning (OBL) is first proposed by [PERSON] [13]. OBL simultaneously considers a solution and its opposite solution; the fitter one is then chosen as a candidate solution in order to accelerate convergence and improve solution accuracy. It has been used to enhance various optimization algorithms, such as the differential evolution [14], the particle swarm optimization [15], the firefly algorithm [16], the adaptive fireworks algorithm [17] and the quantum firework algorithm [18]. Inspired by these, OBL was add to FWA to initialize population. **Definition 1**. : Assume \(X=(x_{1},x_{2},...,x_{d})\) is a solution with d dimensions, where \(x_{1},x_{2},...,x_{d}\in R\) and \(x_{i}\in[L_{i},U_{i}]\), \(i\)=1,2,...,\(d\). The opposite solution \(OX=(\alpha x_{1},\alpha x_{2},...,\alpha x_{d})\) is defined as follows:  
\[\alpha x_{i}=L_{i}+U_{i}-x_{i} \tag{6}\]  
In fact, according to probability theory, 50% of the time an opposite solution is better. Therefore, based on a solution and an opposite solution, OBL has the potential to accelerate convergence and improve solution accuracy. In the population initialization, both a random solution and an opposite solution OP are considered to obtain fitter starting candidate solutions. Algorithm 4 is performed for opposition-based population initialization as follows. ```
Initialize fireworks \(P\) with a size of \(N\) randomly  Calculate an opposite fireworks OP based on Equation (6)  Assess \(2\times N\) fireworks' fitness  Choose the fittest individuals from P and OP as initial fireworks

### Analysis and Improvement of Explosion Amplitude

The main purpose of Equation (1) is that the explosion amplitude of the fireworks is inversely proportional to the fitness value of the function. It enhances the local search ability of the fireworks. However, if we apply the optimal fireworks into Equation (1), the result as follows. \[A_{i}=A\times\frac{\varepsilon}{\sum\limits_{i=1}^{N}{(f(X_{i})-y_{\min})+ \varepsilon}} \tag{7}\]

Since the numerator is the smallest constant expressed in the computer, the result of the Equation (7) is equal to 0. It is obviously inconsistent with the original design intent of the fireworks algorithm. The fireworks algorithm requires the optimal firework generated the largest number of sparks, i.e., sparks do not create much searches but increase the amount of calculation in vain. To solve this problem, [10] gives the linear decreasing (Equation (8)) and non-linear decreasing (Equation (9)) explosion amplitude strategies as follows. \[A_{i}=A_{init}-(A_{init}-A_{final})\times\frac{t}{T} \tag{8}\]

\[A_{i}=A_{init}-\frac{A_{init}-A_{final}}{T}\times\sqrt{(2T-t)t} \tag{9}\]

where \(T\) is the maximum number of iterations, \(t\) is the number of iterations, \(A_{init}\) and \(A_{final}\) are the initial and final value of the explosion amplitude respectively. Although the two strategies effectively avoid the optimal firework explosion amplitude approaching to 0, it relies on the maximum number of iterations heavily which needs to be set manually. Based on this, we propose a new method to calculate the explosion amplitude for the optimal firework. According to the aspects of population evolution rate and population aggregation degree, this method dynamically changes the explosion amplitude. **Definition 2**. : Assume the \(t\) generation global optimal value is denoted as \(Y_{min}\)_(t)_, the global optimal value of the \(t-1\) generation is \(Y_{min}\)_(t - 1)_. The population evolution rate _a_(_t_) is defined as follows. \[0<a(t)=\frac{Y_{\min}(t)+\varepsilon}{Y_{\min}(t-1)+\varepsilon}\leq 1 \tag{10}\]

Fireworks algorithm retains the optimal fireworks for each iteration, the current global optimal value is always better than or equal to the global optimal value of the last iteration. From Equation (10), the value of _a_(_t_) changes greatly means that the evolution speed is fast.