# DTL-GNN: Digital Twin Lightweight Method Based on Graph Neural Network
## 3 Virtual Model Lightweight Approach
### Method Main Process
Iterative adaptation of parameters in the function based on the accuracy of predictions;
* Step 7: Iterate to a stable state and output the final classification of parts in the model;
* Step 8: Assign simplification methods and parameters based on the classification results. According to the steps outlined above, the DTL-GNN algorithm is divided into two stages: graph neural network analysis and classification and simplification. During the analysis phase of graph neural networks, node attributes are consolidated through a neighborhood sampling strategy. This approach is designed to effectively integrate both local and global information by leveraging embedding vectors that capture both the attribute and structural features of the system. During the classification and simplification stage, the algorithm combines these embedding representations using adaptive functions. It then iteratively optimizes the model based on classification accuracy, ensuring that the simplification methods and parameters assigned to each part are tailored according to the classification results. Algorithm 1 was developed based on the need for dynamic adaptability in model simplification. By integrating adaptive embedding and iterative optimization, the algorithm can adjust to the specific characteristics of different components, thereby enhancing both the accuracy and efficiency of the simplification process. The algorithm flow is illustrated in Figure 3.  
The specific execution steps of the algorithm are as follows: First, the graph structure of the virtual model (including the adjacency matrix and node features) is input, and the practical node set is determined through neighborhood sampling and importance filtering. Subsequently, attribute and structural embeddings are generated based on the complex network's geometric and topological information. Next, an adaptive function is employed to adjust the weights and optimize the overall embedding dynamically. Finally, corresponding simplification methods and parameters are assigned to each part type by classifying and predicting the part categories. The detailed algorithm is provided in Algorithm 1. ``` Input: Graph \(G\), target score, adjacent matrix \(A(G)\), centrality_threshold, \(k\), \(S_{n}\) Output: simplify
1 FOR node IN\(V(G)\)DO
2 sampled_neighbours = sample (node_neighbours, \(k\), \(S_{n}\))
3 FOR neighbour_nodeIN node.neighbour DO
4 IF neighbour_node.betweenness_centrality < centrality_thresholdTHEN
5 ADD neighbour_nodeTO\(V\)_S_node
6 ENDFOR
7 IFLENGTH(\(V\)_S_node) > \(S_{n}\)THEN
8 sampled_nodes = ImportanceSampling (\(V\)_S_node, \(S_{n}\))
9 ADD sampled_nodesTO\(V\)_S
10 ELSE
11 ADD\(V\)_S_nodeTO\(V\)_S
12 ENDIF
13 ENDFOR
14 attribute_embedding = \(G_{attribute}\) (\(V\)_S, \(S_{1}\), \(S_{2}\), \(k\), \(A(G)\))
15 structure_embedding = \(G_{struc}\) (\(A(G)\), \(V\)_S)
16//\(G_{attribute}\) and \(G_{struc}\) are graph attribute and graph structure models. (Section 3.3)
17 iteration\(\gets 0\)
18\(q\), \(r\), \(l\) = Initialize_qrl ()
19 WHILE accuracy score < target score AND iteration < max_iterationsDO
20\(W\) = Adaptation Function (\(q\), \(r\), \(l\))
21//Iterative weight adjustment based on local sampling of \(q\), \(r\), \(l\) (Section 3.4)

Figure 3: DTL-GNN algorithm flow chart. The time complexity of the DTL-GNN algorithm is analyzed as follows: The outer loop traverses all nodes V(G) in the graph and samples the neighbors of each node. The time complexity of this step is O(k | V | S_n), where | V| represents the total number of nodes in the graph. The time complexities of the attribute embedding and structure embedding models are O(| V_S|) and O(\(\ell\)), respectively, where | V_S| is the number of sampled nodes and \(\ell\) is the length of the most extended sequence. The iterative optimization part, which includes the adaptive function and regression update, has a time complexity of O(max_iterations | V_S|), where max_iterations is the maximum number of iterations.