# Analysis and Improvement of Fireworks Algorithm
## 3 Analysis and Improvement of Fireworks Algorithm
### Opposition-Based Learning Population Initialization
When _a_(_t_) is equal to 1 after several iterations, it indicates that the algorithm stagnates or finds the optimal value. **Definition 3**. : Assume the t generation global optimal value is denoted as \(Y_{min}\)_(t)_, the average fitness value of all fireworks in the t generation is denoted as \(Y_{avg}\)_(t)_. The population aggregation degree _b_(_t_) is defined as follows. \[0<b(t)=\frac{Y_{\min}(t)+\varepsilon}{Y_{avg}(t)+\varepsilon}\leq 1 \tag{11}\]

From Equation (11), _b_(_t_) is larger, indicating the distribution of fireworks in the population more concentrated. According to Definitions 2 and 3 can be clearly reflected optimization process in FWA. If we adjust explosion amplitude of the optimal firework with the population evolution rate and population aggregation degree, it means combining the explosion amplitude and optimization process. When _a(t)_ is small, the evolution speed is fast, and the algorithm can search in a large space. That is, the optimal firework can be optimized in a large scope; when _a(t)_ is too large, the search is performed in a small scope to find the optimal solution faster. When _b(t)_ is small, the fireworks are scattered and are less likely to fall into local optima, which is more likely to happen when _b(t)_ assumes greater values. At this time, it is necessary to increase the explosion amplitude to increase the search space and improve the global searching ability of FWA. To sum up, the explosion amplitude should decrease as the population evolution rate increases, and increase with population aggregation degree increases. This paper describes this phenomenon in a simplified way. \[\left\{ \begin{array}{ll}A_{i}=A_{i}\times up,&a(t)\
eq 1\,or\,b(t)=1\\ A_{i}=A_{i}\times low&otherwise\end{array} \right. \tag{12}\]

where \(A_{i}\) is the explosion amplitude, and the initial value is set as the size of the objective function search space. _up_ is the enlargement factor, _low_ is the reduction factor. Of course, larger _up_ and smaller _low_ cannot help to search exactly. Thus, _up_ and _low_ should be set a fit value. This improvement is discussed in the following section:

1. When the _a(t)_ is not equal to 1, it means the algorithm finds a better solution than the last generation, and the explosion amplitude should be enlarged. We emphasize that increasing the explosion amplitude may speed up the rate of convergence: assume that the current optimal firework is far from the global optimum. Increasing the explosion amplitude is a direct and efficient way to help the algorithm move faster towards global optimization. However, it should also be noted that the probability of finding a better firework will decrease as the search space increases (obviously, this depends on the optimization function to a large extent). 2. When the _b(t)_ is equal 1, it means the algorithm may fall into local optima, and the fireworks are concentrated, increasing the explosion amplitude to make the fireworks are scattered, which help the algorithm jump out the local optima effectively. 3. When the _a(t)_ is equal 1 and the _b(t)_ is not equal 1, it means the algorithm does not find out a better solution than the last generation and the fireworks are scattered. In this case, the optimal firework explosion amplitude will be reduced to narrow the search to a smaller area, thereby enhancing local development capability of the optimal firework. In general, the probability of finding a better firework increases as the explosion amplitude decreases. In this paper, the explosion amplitude of the optimal firework is calculated by Equation (12). In contrast, the explosion amplitude of non-optimal fireworks is calculated still by Equation (1). Algorithm 5 is performed for updating explosion amplitude as follows.