# IoT-Driven Intelligent Scheduling Solution for Industrial Sewing Based on Real-RCPSP Model
## 5 The Real-RCPSP Problem Applying in Automated Production Planning
### Planning Production Operations Using the Real-RCPSP Problem
* Number of generations, Ng: 20,000. * Number of test conducts: 15. * Actual environment: Microsoft Visual Studio 2022, C#. ### Experimental Results

The experimental results with the GA algorithm are presented in Table 5, and the experimental results with the PSO algorithm are presented in Table 6.

In each table, the \"Avg\" column represents the average value of 15 experiments with the same dataset, the \"Best\" column shows the maximum value from the total number of experiments, and the \"Std\" column indicates the standard deviation across the experiments. The \"Deviation\" column represents the difference between TNG-PT and the Best value of the experimental algorithm. In contrast, the \"%\" column shows the percentage by which the experimental results with the respective algorithm are better compared to TNG-PT. The experimental results demonstrate the resource allocation for executing the tasks of a project, in this case, the assignment of personnel to the production stages of a garment contract. Therefore, the solution found can be used to plan production within the company. The experiments show that applying the GA and PSO algorithms, combined with the Real-RCPSP problem, produces better results than traditional (experience-based) or semi-automated planning (using simple tools, e.g., Excel). Specifically, compared to the GA algorithm, production progress can improve by 3.33% to 26.16%, and with the PSO algorithm, by 4.48% to 28.36%. These results will significantly enhance the company's production efficiency, helping the company save costs, increase profits, improve competitiveness, and increase opportunities to attract customers. Figure 6 compares the effectiveness of the GA and PSO algorithms with actual production times corresponding to each dataset. Both algorithms have shown effectiveness, specifically in reducing the execution time of garment contracts. Among them, the PSO algorithm proves to be more efficient than the GA algorithm, as follows:

* For the Best values, PSO outperforms GA by 2.98%, with one dataset where GA achieved better results (TNG2). * For the Avg values, PSO outperforms GA by 5.54%, with one dataset where GA achieved better results (TNG4), as illustrated in Figure 7.
* For the STD values, the total standard deviation of the PSO algorithm across all datasets is 59.2, while the total standard deviation of the GA algorithm is 102. This shows that the PSO algorithm demonstrates higher stability in experiments than the GA algorithm, as illustrated in Figure 8. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Datasets**} & \multirow{2}{*}{**TNG PT**} & \multicolumn{3}{c}{**PSO**} & \multirow{2}{*}{**Deviation**} & \multirow{2}{*}{**\%**} \\ \cline{3-3} \cline{5-6}  & & **Avg** & & & & \\ \hline TNG1 & 409 & 300 & 293 & 4.8 & 116 & 28.36\% \\ TNG2 & 325 & 256 & 253 & 2.5 & 72 & 22.15\% \\ TNG3 & 296 & 261 & 250 & 9.3 & 46 & 15.54\% \\ TNG4 & 392 & 302 & 289 & 12.3 & 103 & 26.28\% \\ TNG5 & 1174 & 965 & 962 & 1.5 & 212 & 18.06\% \\ TNG6 & 1052 & 962 & 953 & 7.5 & 99 & 9.41\% \\ TNG7 & 871 & 843 & 832 & 9.5 & 39 & 4.48\% \\ TNG8 & 996 & 855 & 843 & 11.8 & 153 & 15.36\% \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Experiment results of PSO algorithm. Figure 6: Comparison of the Best values between PSO, GA, and TNG PT. The results demonstrate the feasibility of automatically calculating workflow coordination and stage assignments within the industrial sewing line. The characteristics of industrial sewing data align well with the Real-RCPSP (Real-Resource Constrained Project Scheduling Problem) model due to the closely matched data and process attributes. By deploying an automatic production planning model, garment businesses can optimize resource utilization for executing garment contracts, thereby reducing contract execution time and significantly enhancing profitability. The automated production planning method, leveraging the Real-RCPSP model and approximation algorithms, represents an intelligent solution to previous production challenges.