# DTL-GNN: Digital Twin Lightweight Method Based on Graph Neural Network
## 3 Virtual Model Lightweight Approach
### Method Main Process
Overall, since k, Sn, and max_iterations are constants, and | V| is often larger than both | V_S| and \(\ell\), the overall complexity of the algorithm is primarily determined by O(k | V | S_n). Therefore, the time complexity of the DTL-GNN algorithm is linear concerning | V|. ### Constructing Graph Neural Network

DTL-GNN simulates this continuous internal mechanism in segments using a graph neural network to classify virtual models in the digital twin. The graph in DTL-GNN is an unweighted, undirected graph generated based on virtual models that contain attribute information. Therefore, only the graph's node attributes and structural relationships must be considered. Consequently, the analysis exclusively concentrates on the graph's node attributes and structural relationships. To this end, the graph neural network phase is segmented into two distinct modules: the first module develops a graph attribute model for analyzing node attributes, whereas the second module develops a graph structure model for examining the relationships between nodes. Both modules are designed to process their respective information independently and generate vector representations that encapsulate the essential characteristics of the graph's attributes and structure. The graph attribute model integrates neighbor information into the embedding vector of k-hop neighboring nodes by sampling and aggregating them. In the real world, the degree of graph nodes often follows a power-law distribution, with some nodes having very high degrees. We conducted importance sampling on node neighbors based on GraphSAGE [39] to address these super nodes, as shown in Figure 4a and Equation (6). \[\left\{ \begin{array}{l}f(x)=\sum\limits_{i=0}^{n}\frac{1}{n}\ \delta(x-i)\\ P(x)=\frac{1}{n}\\ q(x)=\frac{1}{2+2e^{-(0.3x-5)}}\end{array} \right. \tag{6}\]

\[E[f]=\frac{1}{n}\sum\limits_{i=1}^{n}\frac{p(x_{i})}{q(x_{i})}f(x_{i}) \tag{7}\]

\(f(x)\) is the probability density function, where \(x\) denotes the degree of neighboring nodes to be sampled. Since the probability distribution corresponding to the degree is discrete, the Dirac function \(\delta(x)\) represents it. \(P(x)\) is the probability distribution of the sample and \(n\) is the number of degree categories in the neighboring nodes corresponding to the main node. The sampling function, denoted as \(q(x)\), is introduced to readjust the sampling probability of nodes based on their degree. Finally, the expectation of \(f(x)\) is shown in Equation (7), where \(\frac{P(x_{i})}{q(x_{i})}\) is the sampling probability of the node corresponding to the current degree. In addition, to avoid aggregating heterogeneous features [40], the betweenness centrality of nodes \(B_{n}\) is introduced to determine the confidence level of each node. In the k-hop neighbor sampling process, based on the comparison of betweenness centrality difference \(\Delta B_{ij}\) and threshold, the feature data of complex parts is mixed to ensure relative purity, as shown in Figure 4b. In the figure, the red nodes circled represent those meeting the confidence requirements. Node A aggregates information only from nodes B, C, and D. The sampled nodes are aggregated with the main node by means, and supervised learning is performed using cross-entropy as the damage function to generate embedding. Mechatronic models typically contain components with complex structural characteristics. Therefore, graph structure models aim to generate embedding vectors that accurately reflect the structural information of nodes. Struc2 vec is used to generate embedding vectors based on local structures. Subsequent work is then carried out based on these graph attributes and graph structure embedding vectors, as illustrated in Figure 5.

In practical applications, digital twin systems can be applied to different scenarios according to requirements [41].