# Hybrid Flow Shop Scheduling Problems Using Improved Fireworks Algorithm for Permutation
## 3 Fireworks Algorithm
### The Improved Fireworks Algorithm
Evaluate the fitness value of the fireworks. \(t=0\); while(\(t<\) iterations) Generate explosion fireworks  Calculate \(A_{\min}\) by Formula (7). for each firework \(x_{i}\) (i = 1, 2,..., N) do  Calculate the fitness value of the fireworks. \(t=0\); if\(A_{i}<A_{\min}\) \(A_{i}=A_{\min}\) \(A_{i}=A_{\min}\)  end for  Calculate \(S_{i}\) by Formulae (2) and (3). for j = 1: \(S_{i}\) \(q\) = round(\(d\)xrand(0,1)) (\(d\) is the dimension of sparks). Calculate the displacement \(h=A_{i}\times rand(-1,1)\) for\(p=1\):\(q\)  Randomly select \(k\)th dimension of \(x_{i}\) (Not repeating). \(x_{ik}=x_{ik}+h\) if\(x_{ik}\) is out of bounds then  Map sparks to a new location by Formula (5) endif  endfor  endfor
```  
**Algorithm 5**The pseudo-code of IFWA. The pseudo-code of IFWA is described as follows (Algorithm 1):  
```
Initialize parameters and the location of the fireworks. Evaluate the fitness value of the fireworks. \(t=0\); while(\(t<\) iterations) Generate explosion fireworks  Calculate \(A_{\min}\) by Formula (7). for each firework \(x_{i}\) (i = 1, 2,..., N) do  Calculate the fitness value of the fireworks. \(t=0\); if\(A_{i}<A_{\min}\) \(A_{i}=A_{\min}\) \(A_{i}=A_{\min}\)  end for  Calculate \(S_{i}\) by Formulae (2) and (3). for j = 1: \(S_{i}\) \(q\) = round(\(d\)xrand(0,1)) (\(d\) is the dimension of sparks). Calculate the displacement \(h=A_{i}\times rand(-1,1)\) for\(p=1\):\(q\)  Randomly select \(k\)th dimension of \(x_{i}\) (Not repeating). \(x_{ik}=x_{ik}+h\) if\(x_{ik}\) is out of bounds then  Map sparks to a new location by Formula (5) endif  endfor  endfor
```  
**Algorithm 6**The pseudo-code of IFWA. The pseudo-code of IFWA is described as follows (Algorithm 7):  
```  Initialize parameters and the location of the fireworks. Evaluate the fitness value of the fireworks. \(t=0\); while(\(t<\) iterations) Generate explosion fireworks  Calculate \(A_{\min}\) by Formula (7). for each firework \(x_{i}\) (i = 1, 2,..., N) do  Calculate the fitness value of the fireworks. \(t=0\); if\(A_{i}<A_{\min}\) \(A_{i}=A_{\min}\) \(A_{i}=A_{\min}\)  end for  Calculate \(S_{i}\)

## 4 Problem Description

This section discusses the PFSP and HFSP. The corresponding mathematical models, objective functions, and decoding method are given in detail. ### Permutation Flow Shop Scheduling Problems

The PFSP can generally be described as \(m\) jobs to be processed on \(n\) machines, where all jobs must be processed through \(n\) stages in the same sequence [48]. The makespan is the completion time of the last job \(m\) on the last machine \(n\). The layout of PFSP is shown in Figure 3. The assumptions of the PFSP are as follows:

1. Each machine can process only one job at a time;
2. Each job is processed on one machine at a time;
3. The processing sequence of all jobs on different machines is same, which is unknown;
4. The processing sequence of each job on all machines is same, which is known;
5. The processing times of each job on each machine are given;
6. Pre-emption is not allowed. In Figure 3, each stage consists of only one machine. \(j_{1},j_{2},\ldots,j_{m}\) is the processing order of the jobs and \(j_{1}\) is the first job to be processed. All of jobs are completed when the \(j_{m}\) is completed on stage \(n\). The completion time of job \(j_{i}\) on machine k is noted by \(c(j_{i},k)\). The objective of the scheduling is to obtain minimal \(c(j_{m},n)\). The problem is described as:

\[c(j_{1},1)=T_{j_{1},1} \tag{9}\]

\[c(j_{1},k)=c(j_{1},k-1)+T_{j_{1},k},k=2,\cdots,n \tag{10}\]

\[c(j_{i},1)=c(j_{i-1},1)+T_{j_{1},1},i=2,\cdots,m \tag{11}\]

\[c(j_{i},k)=\max\{c(j_{i-1},k),c(j_{i},k-1)\}+T_{j_{i},k},i=2,\cdots,m;k=2, \cdots,n \tag{12}\]

where \(T_{j_{i},k}\) is the processing time of job \(j_{i}\) on machine \(k\). The objective function is described as follows:

\[F=\min(j_{m},n) \tag{13}\]

PFSP is a non-numerical optimization problem in discrete space. This study is necessary to encode the sparks in continuous space to solve the problem.