## 4 DT Workshop Planning Modeling Based on GNN
### Traditional Mathematical Model  
Traditional planning methods perform mathematical modeling based on business requirements, integrating optimization objectives and constraints that are solved using, for example, heuristic algorithms. Considering that GNN models are trained to adapt the network parameters to the strategy of the target, the purpose of traditional mathematical modeling is to provide a planning reference benchmark to the neural network. The operational task of the Ocean Engineering manufacturing workshop is mainly the assembly and welding of blocks. The operational processes are material pre-treatment, cutting, coiling, plate assembly, welding, and others, which correspond to multiple networked pieces of equipment with different functions but capable of participating in multiple processes. Considering that the workshop has the characteristics of process flexibility and equipment flexibility, as well as the requirements for efficiency and energy cost, the planning of assembly and welding operations should be defined as an optimization problem for the flexible job shop.  
Specifically, shop floor operations can be summarized as a process plan of size \(N\times M\), where \(N\) is the number of workpieces and \(M\) is the number of machines. There are multiple process routes for each part being machined, and the critical path needs to be solved to meet the makespan optimal objective, that is, to minimize the maximum completion time. The mathematical model containing the objective function is shown in Equation (9).  
\[F=\min\{c_{max}\} \tag{9}\]  
where \(c_{max}\) represents the makespan. It is the time difference between the start and completion of all processes, with each process's completion time being non-negative, illustrated in Equations (10) and (11).  
\[c_{max}=\max_{1\leqslant i\leqslant N}\{c_{i,j=P_{ii},k}\}\;k\in[1,M] \tag{10}\]  
\[c_{i,0}=0,\;c_{i,j}>0\;\forall i,j \tag{11}\]  
the constraints include:  
\[\sum_{l}X_{il}=1\;\forall i\in[1,N] \tag{12}\]  
\[\sum_{k=1}^{M}Z_{ijlk}=1\;\forall i\in[1,N],\forall j\in[1,P_{i}],\forall l\in [1,G_{i}] \tag{13}\]  
\[(X_{il}\times Z_{i(j^{\prime})lk})s_{i(j^{\prime})lk}\geqslant(X_{il}\times Z_ {ijlk})(s_{ijlk}+t_{ijlk}) \tag{14}\]  
\[(X_{il}\times Z_{i(j+1)(l^{\prime})})s_{i(j+1)l(l^{\prime})}\geqslant(X_{il} \times Z_{ijlk})(s_{ijlk}+t_{ijlk}) \tag{15}\]  
where Equation (12) represents the multi-flexible process routes of a workpiece that is uniquely selectable, Equation (13) restricts a process to allow only one selectable device to be selected, Equation (14) indicates a machine constraint that only one process is performed at a time and Equation (15) acts as a process constraint, expressing that multiple process operations cannot be completed on the same workpiece at the same time. The definitions and descriptions of the symbols are listed in Table 1.  
Prior to solving the model, the following assumptions are required to ensure that:  
1. One machine operates only one process of one workpiece at the same time;
2. All the equipment is available at the starting moment;
3. The locations of the segments in the workshop are close to each other without considering the transfer time between different processes;
4. The equipment is available at all times, regardless of breakdowns;
5. The process has no other influence to interrupt the processing.