## 4 IDPSO Algorithm Analysis and Design
### Population Initialization  
The quality of the initial population has a great influence on the quality of the solution and the convergence speed of the optimization algorithm. Solving the FJSP requires selecting the best machine for the operation sequence and each operation, and the operation sequence affects the selection of machines.  
Figure 3: Machine code.  
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Job Type**} & \multirow{2}{*}{**Job**} & \multirow{2}{*}{**Operation Number**} & \multirow{2}{*}{**OS**} & \multicolumn{6}{c}{**Machine and Processing Time/min**} \\ \cline{6-10}  & & & & **Work Center 1** & & **Work Center 2** & & **Work Center 3** \\ \cline{5-10}  & & & & & \(WC_{11}\) & \(WC_{21}\) & \(WC_{22}\) & \(WC_{31}\) & \(WC_{32}\) \\ \hline \multirow{2}{*}{Type 1} & \multirow{2}{*}{Job 1} & 1 & 111 & 2 & 3 & 3 & - & - \\  & & 2 & 112 & 3 & - & - & 2 & 2 \\ \hline \multirow{4}{*}{Type 2} & \multirow{2}{*}{Job 1} & 1 & 211 & - & 1 & 1 & 3 & 3 \\  & & 2 & 212 & 2 & - & - & 2 & 2 \\  & & 3 & 213 & 3 & 3 & 3 & - & - \\ \cline{2-10}  & & 1 & 221 & - & 1 & 1 & 3 & 3 \\  & & 2 & 222 & 2 & - & - & 2 & 2 \\  & & 3 & 223 & 3 & 3 & 3 & - & - \\ \hline \multirow{2}{*}{Type 3} & \multirow{2}{*}{Job 1} & 1 & 211 & - & 1 & 1 & 3 & 3 \\  & & 2 & 222 & 2 & - & - & 2 & 2 \\  & & 3 & 223 & 3 & 3 & 3 & - & - \\ \hline \multirow{2}{*}{Type 2} & \multirow{2}{*}{Job 1} & 1 & 311 & - & 2 & 2 & 3 & 3 \\  & & 2 & 312 & 1 & 2 & 2 & - & - \\ \hline \hline \end{tabular} Note: “-” indicates that the operation cannot be processed on the machine of the work center.  
\begin{tabular}{c|c|c|c|c|c|c|c|c|c|c|} \hline \hline \multirow{2}{*}{Operation arrangement} & \multirow{2}{*}{O111} & \multirow{2}{*}{O211} & \multirow{2}{*}{O221} & \multirow{2}{*}{O112} & \multirow{2}{*}{O311} & \multirow{2}{*}{O212} & \multirow{2}{*}{O222} & \multirow{2}{*}{O312} & \multirow{2}{*}{O213} & \multirow{2}{*}{O223} \\ \cline{2-2} \cline{6-10}  & & & & & & & & & & \\ \hline \hline \multirow{2}{*}{Operation sequence} & \multirow{2}{*}{11} & 21 & 22 & 11 & 31 & 21 & 22 & 31 & 21 & 22 \\ \hline \end{tabular}
\end{table}
Table 3: A flexible job shop scheduling problem.  
Figure 2: Operation code.  
In the initialization process, we use different initialization methods based on two-level coding to generate the initial population and maintain particle diversity. In order to achieve a better scheduling effect, we use the random initialization method in the process selection part. Because the processing time of the job on the machine directly affects the completion time of the operation, we can use a mixed-initialization method to select the machine. At the same time, the SPT (shortest processing time) rule is to preferentially select the machine with the shortest processing time, which can reduce the time it takes to complete an order. Compared with other rules, SPT rules can directly reduce customer waiting times, thereby improving workshop productivity and customer satisfaction. The specific operation steps are as follows: for the processing of 60% particles, we randomly select a machine in the machine selection set; for the processing of 40% particles, we choose the machine with the shortest processing time. This approach balances randomness with the need to consider the SPT to achieve better scheduling results.