*4.2. Coding Scheme*

This subsection gives the encoding and decoding scheme of FHFGSP. The objective of FHFGSP is the minimum MS and TEC. To achieve these two optimization objectives, it is necessary to determine the sequence of jobs in each stage, the machine allocation for each stage of the job, and the speed at which each stage of the job is processed on the machine. Due to the characteristics of FHFGSP, each job needs to go through the same processing stages, so we only need to determine the sequence of jobs into the first stage, and the sequence of jobs in other stages can be determined automatically. However, since the processing speed of each job in each stage is independent of the preceding and following stages and the preceding and following jobs, the processing speed of each job in each stage is independent of the preceding and following jobs. Therefore, the speed of each job in each stage should be determined separately.

Therefore, the solution is coded in two parts. The first part is the sequence of jobs into the first stage. The second part is the velocity selection matrix. In this paper, the two parts of the solution are represented as follows:

$$\begin{aligned} \mathbf{\pi}\_{\mathfrak{n}} &= \{\pi\_{1}, \dots, \pi\_{i}, \dots, \pi\_{\mathfrak{n}}\} \\ \mathbf{\bf{v}}\_{\mathfrak{m}\times\mathfrak{n}} &= \left[ \begin{array}{c} \upsilon\_{1,1'} \cdot \cdots \upsilon\_{1,i'} \cdot \cdots \upsilon\_{1,\mathfrak{n}} \\ \vdots & \vdots \ \vdots \\ \upsilon\_{j,1'} \cdot \cdots \upsilon\_{j,i'} \cdot \cdots \upsilon\_{j,\mathfrak{n}} \\ \vdots & \vdots \ \vdots \\ \upsilon\_{\mathfrak{m}\_{\mathfrak{r}}\mathfrak{l}\vee} \cdot \cdots \upsilon\_{\mathfrak{m}\_{\mathfrak{l}}\mathfrak{l}\vee} \cdots \upsilon\_{\mathfrak{m}\_{\mathfrak{l}}\mathfrak{l}\mathfrak{l}} \end{array} \right] \tag{18}$$

where π*n* denotes the *n*-dimensional job sequence vector, *πi* is the sequence number of the *i*-th job entering the machine, **V***m*×*n* represents the speed matrix of the jobs, and *vi,j* is the machine processing speed level of the *i*-th job at stage *j*.

The second part represents the solution to the three-stage scheduling problem for three jobs as <π3, **V**3×3>. As shown below, the solution to the three-stage scheduling problem for three jobs is denoted as <π3, **V**3×3>. π3 indicates that the order in which jobs enter the first stage of scheduling is job1, job3, and job2. **V**3×<sup>3</sup> indicates that in the three stages, job1 is processed at levels 1, 2, and 3, while job2 is processed at levels 2, 1, and 1, and job3 is processed at levels 2, 1, and 3, respectively.

$$
\pi\_3 = \{1, 3, 2\}
\
\mathbf{V}\_{3 \times 3} = \begin{pmatrix} 1 & 2 & 2 \\ 2 & 1 & 1 \\ 3 & 1 & 3 \end{pmatrix} \tag{19}
$$

After the coding scheme is determined, it needs to be decoded into an actual scheduling scheme to make sense. The detailed decoding scheme is as follows. In the first stage, machines are available at the moment 0. According to the order of jobs in π*n*, the jobs are placed on the machine that can be executed earliest and the jobs are processed according to the corresponding speed in the speed matrix, after which the available time of the machine is updated before processing the next job. The following steps are performed for each job in turn in the other stages:

Step 1: Process the job according to its completion time in the previous stage, according to the first-come, first-served principle, i.e., the one that was completed earlier in the previous stage and arrives at this stage first is processed first.

Step 2: Based on the speed in the speed matrix, select the parallel machine that can process the job as early as possible.

Step 3: Update the available time of the machines. Assuming that machine *k* is available at the moment 0, it takes 3 times to process job *i* and 1 time to set up, then the available time of the machine is0+3+1=4 times.

#### *4.3. Initialization and Energy Saving Procedures*

After determining the encoding, it is necessary to initialize the populations and external populations. In this paper, the population is initialized in a random way, and for each individual, the job sequence and velocity matrix are generated randomly.

After the population initialization is completed, the dominance relationship between individuals needs to be calculated and the non-dominated solutions are populated with external population.

Although the two optimization objectives of the FHFGSP conflict with each other, it is possible to use a suitable strategy to improve the other objective while controlling one optimization objective constant. To obtain high-quality solutions, individuals use an energy-saving procedure after initialization with the aim of further improving the quality of the population. The basic idea of the energy-saving procedure is to achieve a reduction of PE in TEC by reducing the processing speed of the job while controlling a constant MS.

To achieve constant MS, the energy-saving procedure uses the idea of backtracking. Starting from the last job in the last stage, the processing speed of the job is minimized without affecting the completion time of other jobs. The detailed steps are shown in Algorithm 2, where the symbols that appear are given in Table 1.

**Algorithm 2** Energy saving procedure

