*4.3. Optimization Performance Testing on the SAA–HNN Algorithm*

In order to verify the effect of optimization performance of the HNN algorithm, which adds the idea of the simulated annealing algorithm in comparison to the optimization effect of the improved HNN algorithm and the typical algorithms of the swarm intelligence algorithm, four groups of small-scale FFSP standard example data and six groups of large-scale FFSP instance data were used to test and analyze the SAA–HNN algorithm and its comparison algorithms. The comparison algorithms included ICA, CGA, and HNN.

Four groups of small-scale FFSP standard example data and four groups of large-scale FFSP instance data were used to, respectively, test and analyze. Moreover, the SAA–HNN algorithm was compared to ICA, CGA, and HNN to verify the effect of optimization performance of HNN algorithm, which adds the idea of the simulated annealing algorithm.

The four groups of small-scale FFSP test data were from the standard examples [29,30] proposed by Neron and Taillard based on the standard FFSP, while six groups of large-scale FFSP test data adopted the actual production data. Each algorithm was run 30 times under each group of data, and the average makespan *Cmax* was applied as the main evaluation index to obtain the result. In addition, the maximum evolution of the four algorithms was 500 generations. The test results are shown in Table 2.

In Table 2, the 'j15c5c1' standard example is taken as an example. 'j15' indicates that the total number of processed workpieces is 15. 'c5' indicates that the total number of processing stages is 5, and since there is only one machine per stage, the total number of machines is also 5. 'c1' represents the difficulty of the standard example. The easy-to-solve examples include six j10c10c\* classes, i.e., the total examples of 'a' class and 'b' class. The hard-to-solve examples include the other 'c' classes, i.e., the total examples of 'd' class and 'e' class. *LB* is the lower bound of the makespan of the standard example whose value has been given in the literature [31,32], and *ARE* represents the average relative error of the solution obtained by this algorithm as compared to the lower bound of the makespan. The smaller the *ARE*, the better the optimization effect of the algorithm. *Time* means the average optimization time of the standard example; the smaller the *Time*, the better the optimization speed of the algorithm.

According to the test results in Table 2, based on four groups of small-scale standard example data, in terms of optimization effect, *ARE* between the ICA algorithm and the CGA algorithm is 7.4% and 6.1%, respectively, under j15c5c1 standard example data. Therefore, its optimization effect is improved. The *ARE* of the HNN algorithm under j15c5c1 standard example data is 14.5%, which increases to 7.1% and 8.4% in comparison to ICA and CGA, respectively. So the optimization effect is relatively poor. The *ARE* of the SAA–HNN algorithm is 6.1% under j15c5c1 standard example data and is smaller than those of the other three algorithms, so the optimizing effect of the SAA–HNN algorithm is relatively better. The other small-scale standard example data also show the same status. In terms of optimization time, ICA is similar to CGA in average optimization time, which is 6–7 s time range. However, the average optimization time of HNN algorithm is 3–4 s time range and is shortened to about 50% as much as ICA and CGA with obvious improvement in the optimization speed. Although average optimization time of the SAA–HNN algorithm increases about 0.5 s as much as the HNN algorithm, it retains high optimization speed. In terms of four groups of large-scale data, on the basis of optimization effect, the SAA–HNN algorithm increases about 4% as compared to the other three algorithms. However, in terms of optimization time, the optimization speed of the SAA–HNN algorithm accelerates about 70% as much as ICA and CGA.

Based on the above tests using four groups of small-scale data and six groups of large-scale data for four algorithms, the SAA–HNN algorithm has faster optimization speed than the comparison algorithms, with significantly improved evaluation index under small-scale data. Also, under large-scale data, the SAA–HNN algorithm still maintains a high speed of optimization, and the evaluation index is relatively better. Therefore, the SAA–HNN algorithm is suitable for solving large-scale and complicated scheduling optimization problems, and hence, has a broad applicability.

During the test, four algorithms were considered based on 30 simulation experiments with large-scale data. The makespan *Cmax* obtained at each time point exhibited obvious fluctuation. Since the HNN algorithm can easily fall into local extremum, its *Cmax* may appear as a large outlier. In order to compare and evaluate the optimization effect of the four algorithms on large-scale data, j80c8a2 data were considered as the example, and the *Cmax* values obtained by running four algorithms for 30 times are drawn into a box plot (Figure 3).

**Figure 3.** Box-plot of four algorithms for large-scale data j80c8a2.

A box-plot is a statistical graph for describing the discrete degree of a group of data. The stability of the optimization effect can be reflected by the box-plot. The interquartile range *IQR* was used to measure the discrete degree of the data in the box-plot.

As can be seen from Figure 3, the HNN algorithm generates three large outliers of 2033, 2047, and 2056, respectively, in the 30 running times of the algorithm, indicating that the HNN algorithm easily falls into the local extremum. The median of box-plot produced by the SAA–HNN algorithm is 1815, and other medians of box-plot produced by other algorithms are 1854, 1828, and 1956, respectively. Therefore, the box-plot of the SAA–HNN algorithm is in the lowest position, which indicates that the overall quality of the solution generated by the SAA–HNN algorithm is better than the other three algorithms. Besides, the *IQR* of the box-plot generated by the SAA–HNN algorithm is 23, and the *IQR* of the box-plot generated by the other three algorithms are 25, 46, and 38, respectively, indicating that the SAA–HNN algorithm produces the smallest discrete degree, and the stability of the scheduling results under large-scale data was optimal among the four algorithms.

Based on the above analysis, the SAA–HNN algorithm is better than the ICA, CGA, and HNN algorithms, and it also maintains fast optimization of the HNN algorithm in terms of optimization speed while solving the scheduling problem of small-scale and large-scale data. This indicates that the idea of the simulated annealing algorithm overcomes the HNN algorithm for falling into local extremum, and the SAA–HNN algorithm has a strong ability of continuous evolution.

#### **5. FFSP–PB Instance Test**

Taking a bus manufacturer in actual large-scale equipment manufacturing enterprises as an example, simulation data similar to the production operation of the body shop and paint shop for the bus manufacturer were constructed. The body shop of the bus manufacturer was a rigid flow shop with multiple production lines that could be simplified into one production stage. The paint shop could be simplified into three stages. Therefore, the simulation data included four stages: *Stage*1, *Stage*2, *Stage*3, *Stage*<sup>4</sup> . The parallel workstation of these four stages was *Mj* = {3, 3, 3, 3}. A limited buffer occurred between each stage, and the maximum capacity of each limited buffer was {*LBu*2, *LBu*3, *LBu*4} = {2, 2, 2}. In addition, a public buffer was set on the production line, and the standard processing time for transferring the workpiece *TBt* was 5. The maximum buffer capacity in the public buffer was 3.

The simulation test first analyzed the impact of the relevant local scheduling rules for FFSP–PB on the scheduling results, and discussed the role of the public buffer and local scheduling rules for the public buffer in alleviating the production blockage and improving the scheduling results. Finally, the SAA–HNN algorithm and other global optimization algorithms were combined with the local scheduling rules, respectively, to solve the FFSP–PB problem under different data scales, which verified the optimization performance of the SAA–HNN algorithm with respect to the complex scheduling problems. Thus, the efficiency of the combination of the SAA–HNN algorithm and local scheduling rules for solving the FFSP–PB problem was assessed.

#### *5.1. Evaluation Index of Scheduling Results*

In order to better analyze and study the scheduling results during the scheduling process, we employed the makespan *Cmax* as the optimization goal, establishing other evaluation indexes related to the actual production, including the total workstation idle time *TWIT*, the total plant factor *TPF*, and total workpiece blockage time *TWBT*. Except for *TPF*, the smaller the value, the better the other evaluation indexes:

#### (1) Makespan

$$\mathbb{C}\_{\max} = \max \{ T c\_{i,m} \}, \ i \in \{ 1, \ldots, n \} \tag{29}$$

In Equation (29), makespan *Cmax* indicates the maximum value of all workpieces that completed processing at the last stage.

(2) Total workstation idle time

$$T\mathcal{W}IT = \sum\_{j=1}^{m} \sum\_{l=1}^{M\_j} \left( \left( \max\{To\_{i,j} \cdot At\_{i,j,l} \} - \min\{S\_{i,j} \cdot At\_{i,j,l} \} \right) - \sum\_{i=1}^{n} \left( Tb\_{i,j} \cdot At\_{i,j,l} \right) \right) \tag{30}$$

In Equation (30), *TWT* represents the sum of the idle time for the workstation between the start time of the first processed workpiece and the completion time of the last processed workpiece.

(3) Total plant factor

$$TPF = \frac{\sum\_{j=1}^{m} \sum\_{i=1}^{n} \left( Tb\_{i,j} \right)}{\sum\_{j=1}^{m} \sum\_{i=1}^{n} \sum\_{l=1}^{M\_j} \left( \max \{ To\_{i,j} \cdot At\_{i,j,l} \} - \min \{S\_{i,j} \cdot At\_{i,j,l} \} \right)} \tag{31}$$

In Equation (31), *TPF* represents the total plant factor of all workstations, which is the ratio of the effective processing time of all workstations to the occupied period of all workstations. This period starts from the first workpiece processed on the workstation at each stage to the last workpiece that leaves the workstation after completion [33].

(4) Total workpiece blockage time

$$TWBT = \sum\_{i=1}^{n} \sum\_{j=2}^{m} \left( To\_{i,j-1} - C\_{i,j-1} \right) \tag{32}$$

In Equation (32), *TWBT* indicates the sum of blockage time of all workpieces stuck on the workstations since the limited buffer is full and the electric flat carriage is in transit during the production.

#### *5.2. Instance Test of FFSP–PB Local Scheduling Rules*

#### 5.2.1. Simulation Scheme

In order to verify the efficiency of the public buffer in reducing the production blockage during the process of buffer dynamic capacity-increase in flexible flow shop and analyze the role of the relevant local scheduling rules for the public buffer, three groups of simulation schemes were designed to solve the flexible flow shop scheduling problem with the limited buffer. Scheme 1: There is no public buffer and no reentrant rules of electric flat carriage or workpiece transfer rules in the public buffer. Scheme 2: There is a public buffer and no reentrant rules of electric flat carriage or workpiece transfer rules in the public buffer. Scheme 3: There is a public buffer, reentrant rules of electric flat carriage, and workpiece transfer rules in the public buffer.

#### 5.2.2. Simulation Results and Analysis

To obtain a better evaluation of the scheduling results, 30 different online sequences were randomly generated, and the values of the evaluation index were obtained through simulation tests. Moreover, the average values of each evaluation index for each scheme based on 30 different online sequences were calculated (Table 3), and Equation (33) was established. *IR*(*A*/*B*) indicates the improvement range of *A* with respect to the designated evaluation index of *B*, and the meanings of *A* and *B* would be modified according to the actual situation.

$$IR(A/B) = \left| \left[ (A - B) / B \right] \right| \times 100\% \tag{33}$$


**Table 3.** Comparison of evaluation indexes for the three scheme scheduling results.

As is shown in Table 3, the main evaluation index makespan *Cmax* and the total workpiece blockage time *TWBT* of Scheme 2 with the public buffer decreases to 14.1 and 7.9, respectively, as compared to that of Scheme 1 without the public buffer, and the improvement is 7.72% and 30.04%, respectively. If production line has a public buffer but does not establish corresponding local scheduling rules, it might lead to new production blockage. Thus, the reentrant rules of electric flat carriage and workpiece transfer rules in the public buffer are established. The main evaluation index makespan *Cmax* and total workpiece blockage time *TWBT* of the reentrant rules of electric flat carriage in Table 3 and workpiece transfer rules in the public buffer of Scheme 3 decreases to 9.2 and 12.5, respectively, as compared to that of Scheme 2 with the public buffer but without the corresponding local scheduling rules, and the improvement is 5.46% and 67.93%, respectively. Meanwhile, the other evaluation indexes are also improved. The above analysis indicates that the public buffer adds in the flexible flow shop and relevant local scheduling rules can be established in order to relieve the production blockage effectively.

#### 5.2.3. Gantt Chart Analysis of the Scheduling Result

Figure 4 shows the Gantt chart of the scheduling result of Scheme 3. The abscissa is the time axis, while the ordinate indicates the workstation of each stage, the limited buffer, and the public buffer. The violet part in the figure represents the time for the workpiece that is temporarily stored in the limited buffer; the red part indicates that the electric flat carriage transfers the workpiece from the workstation to the public buffer; the blue part indicates the time for the electric flat carriage that transfers the workpiece back to the limited buffer when transporting the workpiece from the workstation to the public buffer; the yellow part denotes that the workpiece is stored temporarily in the public buffer; the green part denotes that the electric flat carriage transports the workpiece from the public buffer to the limited buffer; the orange part in the figure represents the blockage time of the workpiece in the stage. Figure 4 demonstrates that restricted by Equation (6), the workpiece in each stage is processed only once at one workstation, and hence, the processing route of the workpiece *Wp*<sup>5</sup> is *WS*1,2,*Rp*5, *PBu*,*Rl*5, *Bl*2,1, *WS*2,1, *Bl*3,2, *WS*3,1,*Rp*5,*Rb*5, *Bl*4,1, *WS*4,1 , i.e., the processing route is represented by the connecting lines between the blocks in the figure.

**Figure 4.** Gantt chart of scheme 3 scheduling result.

At time *t* = 40, the workpiece *Wp*<sup>5</sup> completed the manufacturing task at workstation *WS*1,2 of stage *Stage*1. Simultaneously, restricted by Equation (11), the limited buffer *LBu*<sup>2</sup> reached the upper limit of its capacity *WAl*2(40) = *Wp*3, *Wp*<sup>8</sup> ; thus, the workpiece *Wp*<sup>5</sup> started to be transferred to the public buffer. At time *t* = 45, the workpiece *Wp*<sup>5</sup> entered the public buffer. At time *t* = 50, the workpiece *Wp*<sup>10</sup> completed the manufacturing task at workstation *WS*2,2 of stage *Stage*2, and then left the workstation. The workpiece *Wp*<sup>2</sup> entered the workstation *WS*2,2 of stage *Stage*2, the space *Bl*2,1 in the limited buffer *LBu*<sup>2</sup> was available, and the workpiece *Wp*<sup>5</sup> in the public buffer that should enter the limited buffer *LBu*<sup>2</sup> existed. Therefore, the workpiece transfer rules in the public buffer took effect. Since the electric flat carriage was at the position of the public buffer *Pan*\_*Car*(50) = 2, the standard processing time for transferring the workpiece *Tbt*= 5 was compared to the estimated minimum completion time min (*Tci*,1 − *t*) (*Tsi*,1 <sup>−</sup> *<sup>t</sup>*) <sup>≤</sup> 0,(*Tci*,1 <sup>−</sup> *<sup>t</sup>*) <sup>&</sup>gt; 0, *<sup>i</sup>* <sup>∈</sup> {1,9, 11} = 6 for all workpieces at stage *Stage*1. Since the standard processing time for transferring the workpiece was less than the estimated minimum completion time for all workpieces of stage *Stage*1, the electric flat carriage transfered the workpiece *Wp*<sup>5</sup> from the public buffer to the space *Bl*2,1 in the limited buffer *LBu*2. At time *t* = 55, the workpiece *Wp*<sup>5</sup> entered the space *Bl*2,1 of the limited buffer *LBu*2.

At time *t* = 144, the workpiece *Wp*<sup>5</sup> completed the manufacturing task at workstation *WS*3,1 of stage *Stage*3. In addition, restricted by Equation (11), the limited buffer *LBu*<sup>4</sup> reached the upper limit of its capacity *WAl*4(144) = *Wp*1, *Wp*<sup>3</sup> , following which, the workpiece *Wp*<sup>5</sup> started to be transferred to the public buffer. At time *t* = 146, the workpiece *Wp*<sup>6</sup> completed the manufacturing task at workstation *WS*4,1 of stage *Stage*<sup>4</sup> and left the workstation. When the workpiece *Wp*<sup>3</sup> entered the workstation *WS*4,1 of stage *Stage*4, the space *Bl*4,1 in the limited buffer *LBu*<sup>4</sup> was available and the workpiece *Wp*<sup>5</sup> was still in transportation *Pan*\_*Car*(146) = 3, so the reentrant rules of the electric flat carriage took effect. Also, the already-spent transit time *Ttw*5,3(146) = 2 for transporting the workpiece *Wp*<sup>5</sup> from the workstation of stage *Stage*<sup>3</sup> to the public buffer was compared to the estimated minimum completion time min (*Tci*,4 − *t*) (*Tsi*,4 <sup>−</sup> *<sup>t</sup>*) <sup>≤</sup> 0,(*Tci*,4 <sup>−</sup> *<sup>t</sup>*) <sup>&</sup>gt; 0, *<sup>i</sup>* <sup>∈</sup> {9} = 8 for all workpieces at stage *Stage*3. Since the already-spent transit time of the workpiece *Wp*<sup>5</sup> was less than the estimated minimum completion time for all workpieces of stage *Stage*3, the electric flat carriage returned the workpiece *Wp*<sup>5</sup> to space *Bl*4,1 in the limited buffer *LBu*4. Thus, at time *t* = 148, the workpiece *Wp*<sup>5</sup> entered the space *Bl*4,1 of the limited buffer *LBu*4. Based on the above analysis, restricted by Equation (17), the already-spent transit time *Ttw*5,3(146) for transporting the workpiece *Wp*<sup>5</sup> from the workstation of stage *Stage*<sup>3</sup> to the public buffer should be less than the standard processing time for transferring workpiece.

From the above specific analysis of the Gantt chart about scheduling results, the reentrant rules of the electric flat carriage designed for the public buffer state that, when the workpiece is transferred to the public buffer, it should enter the available space in the limited buffer, following which, the workpiece reenters and is stored in the limited buffer to reduce its storage time in the public buffer and the total transfer time. Based on the workpiece transfer rules in public buffer, and in the event of available space in the limited buffer and that the workpiece transfers from the public buffer to the limited buffer and the previous stage of the limited buffer does not have the the completed workpiece, the workpiece in the public buffer is transferred to the available space in the limited buffer. This avoids competition for the available space in the limited buffer, which in turn, effectively reduces the new production blockage caused by the increase in the public buffer.
