# Hybrid Flow Shop Scheduling Problems Using Improved Fireworks Algorithm for Permutation
## 3 Fireworks Algorithm
### The Introduction of Traditional FWA  
A flow diagram of the traditional FWA is shown in Figure 1. The specific steps are shown below:  
1. \(N\) solutions are chosen as the initial fireworks, which are generated randomly in the feasible domain. 2. Evaluate the fitness value of the fireworks. Explosive fireworks and Gaussian fireworks are obtained from the initial fireworks by the explosion and Gaussian operations. 3. Test the termination condition. \(N\) sparks would be selected in the all sparks as the initial fireworks in the next iteration if the termination condition is not satisfied. In FWA, each spark is a feasible solution and the process of explosion is regarded as the process of searching for the optimal solution around the neighborhood [46]. The fireworks with worse fitness value have better global search ability, and the fireworks with better fitness value have better local search ability [47]. The explosion operator, the mutation operator, and the selection strategy directly determine the efficiency of this algorithm and whether it can find the global optimum. Figure 1: Flowchart of the traditional fireworks algorithm (FWA). (1) Explosion operator  
The amplitude of fireworks explosion depends on the fitness value. The better fireworks are much closer to the best solution than the worse fireworks. The better fireworks should generate more explosion sparks in a smaller range. The explosion amplitude is computed in Equation (1):  
\[A_{i}=A\times\frac{f(x_{i})-y_{\min}+\varepsilon}{\sum\limits_{i=1}^{N}(f(x_{i}) -y_{\min})+\varepsilon} \tag{1}\]  
\(A\) represents the maximum range of the fireworks explosion, \(x_{i}\) denotes the \(i\)th initial firework, \(f(x_{i})\) represents the fitness value of \(x_{i}\), \(y_{\min}=\min(f(x_{i}))\)\((i=1,2,\cdots,N)\), and \(\varepsilon\) is the smallest constant to avoid zero-division error. The number of the explosion sparks also depends on its fitness value. A better value will generate more sparks, while the worse fireworks with worse fitness generate fewer sparks. The number of the explosion sparks of different fireworks is presented as follows:  
\[S_{i}=M\times\frac{y_{\max}-f(x_{i})+\varepsilon}{\sum\limits_{i=1}^{N}(y_{ \max}-f(x_{i}))+\varepsilon} \tag{2}\]  
where \(M\) is a constant value to restrict the quantity of the explosion sparks, \(y_{\max}=\max(f(x_{i}))\)\((i=1,2,\cdots,N)\). When too many sparks are generated in a small amplitude, the sparks inevitably overlap. Similarly, when the number of fireworks generated is too small, it is not conducive to global search, and the quantity of the explosion sparks is bounded to avoid the situations in Equation (3):  
\[S_{i}=\left\{ \begin{array}{l}\text{round}(a\times M),S_{i}<aM\\ \text{round}(b\times M),S_{i}>bM,a<b<1\\ \text{round}(S_{i}),\text{otherwise}\end{array} \right. \tag{3}\]  
where \(a\) and \(b\) are two constants which confine the range of the amount of sparks, and \"round\" indicates the rounding function. (2) Mutation operator  
The Gaussian operator is used to increase the diversity of the sparks. The process of generating Gaussian sparks is as follows: the specified initial sparks are selected randomly. Moreover, the \(k\) dimension of the selected spark is used in the mutation operation, as shown in Equation (4):  
\[\hat{x}_{ik}=x_{ik}\times e \tag{4}\]  
where \(e\sim N(1,1)\), \(\hat{x}_{ik}\) is the \(k\)-dimension of the Gaussian spark, \(x_{ik}\) is the \(k\)-dimension of the explosion spark \(x_{i}\). In the process of explosion and mutation, it is inevitable that some of the sparks will transcend the range of the feasible region. When a spark exceeds the boundary at dimension \(k\), the \(k\)-dimension of the spark is mapped to a new position by Equation (5):  
\[x_{ik}=x_{LB,k}+|\hat{x}_{ik}|\%(x_{UB,k}-x_{LB,k}) \tag{5}\]  
where \(x_{UB,k}\) and \(x_{LB,k}\) are the upper and lower boundaries in the \(k\)th dimension, and \(\%\) is the surplus function.