## 4 DT Workshop Planning Modeling Based on GNN
### Graph Neural Network Structure
#### 4.2.3 Graph Attention Network
\[\mathbf{\Lambda}^{\prime}{}_{m_{k}}=\sigma\Big{(}\alpha_{kk}\mathbf{W}_{\mathcal{M}} \mathbf{\Lambda}_{m_{k}}+\sum_{o_{ij}\in\mathcal{A}_{t}(m_{k})}\alpha_{ijk}\mathbf{W} _{\mathcal{O}}\mathbf{v}_{ijk}\Big{)} \tag{27}\]  
_(3) Multi-head Attention Mechanism._ The multi-head attention mechanism provides an effective enhancement of the feature representation as well as the model self-learning capability of operation and machine attention networks. In this paper, this method is invoked in GAT, which is part of the procedure to realize the superior generalization ability of GNNs for different scale scheduling problems, and its computational principle is shown in Figure 7.  
Specifically, by passing operation or machine features to the query, key and value, \(K\) attention heads are set up to individually form attention blocks with different parameters, which are able to compute the attention coefficients in parallel. The output is fed back to the aggregation operator for splicing, as shown in Equation (28). The averaging operator with \(\sigma\) activation is executed after the last layer of network computation completes to obtain efficient feature expression results. The method ensures that localization is preserved without affecting the global features. \[\mathbf{\Lambda}^{\prime}{}_{o_{ij}}=\parallel_{k=1}^{K}\sigma\Big{(}\sum_{o_{ij} \in\mathcal{O}}\mathbf{\alpha}_{o_{ij}}\mathbf{W}\mathbf{\Lambda}_{o_{ij}}\Big{)} \tag{28}\]  
_(4) Pooling._ The mentioned GAT exports a set of features \(\mathbf{\Lambda}^{(l)}_{o_{ij}}\) and \(\mathbf{\Lambda}^{(l)}_{m_{k}}\) at each single layer. When \(l=1\), the operation and machine feature are determined by the original feature values. In addition, the \"operation-machine\" combination is consistently input  
Figure 7: Multi-head attention mechanism. to the original features during calculating in each layer. After stacking the \(L\) layers, the ultimate outputs \(\mathbf{\mathscr{R}}_{o_{ij}}^{(L)}\) and \(\mathbf{\mathscr{R}}_{m_{k}}^{(L)}\) are used in the subsequent decision network. The whole scheduling features are spliced based on the mean pool of operation and machine features as in Equation (29). \[\mathbf{\mathscr{R}}_{Total}^{(L)}=[\frac{\sum_{o_{ij}\in\mathscr{O}}\mathbf{\mathscr{R}} _{o_{ij}}^{(L)}}{|\mathscr{O}|}\parallel\frac{\sum_{m_{k}\in\mathscr{L}}\mathbf{ \mathscr{R}}_{m_{k}}^{(L)}}{|\mathscr{M}|}] \tag{29}\]  
_(5) Decision Making: Actor-Critic Algorithm._ Following the acquisition of the graph representation, policy network development is the culminating step in the fulfillment of the decision support. The main purpose of the policy network is to emit a feasible action \(a(t)\) and obtain the reward value \(r_{t}\) of that action to form an optimal sequence of actions. The actor-critic algorithm is compatible with variable-size attention models and is a superior method for achieving scheduling decisions. While the actor network and the critic network each correspond to a Multi-Layer Perceptron (MLP), the former task is interacting with the scheduling environment to generate a priority index \(\mu(a_{t}|\,s_{t})\) in the first step, and in the second step, to randomize the policies \(\pi_{\theta}(a_{t}|\,s_{t})\) based on the expectation distribution solved by the Softmax function, described in Equations (30) and (31). For the action \(a_{t}=\big{(}o_{ij},m_{k}\big{)}\) operation features, machine features, global features, and \"operation-machine\" combination feature information have been fused. \[\mu(a_{t}|\,s_{t})=\text{MLP}_{\theta}\Big{[}\mathbf{\mathscr{R}}_{o_{ij}}^{(L)} \parallel\mathbf{\mathscr{R}}_{m_{k}}^{(L)}\parallel\mathbf{\mathscr{R}}_{Total}^{(L) }\parallel\mathbf{\mathscr{R}}_{(o_{ij},m_{k})}\Big{]} \tag{30}\]  
\[\pi_{\theta}(a_{t}|\,s_{t})=\frac{\exp(\mu(a_{t}|\,s_{t}))}{\sum_{b_{t}\in \mathscr{A}(t)}\exp(\mu(b_{t}|\,s_{t}))} \tag{31}\]  
The latter network objective aims to collect the value function \(\
u_{\phi}(s_{t})\) during the actor network's interaction with the environment to recognize the action's merits and demerits.