A graph layout generation method and system based on staged multi-objective optimization and structure-aware graph neural network

CN123015721APending Publication Date: 2026-10-30UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611368400.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-04
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0012]本发明的目的在于解决现有图布局生成方法在多目标优化过程中采用多目标加权联合损失及图结构信息利用不足引起的目标间梯度相互干扰、训练不稳定、计算与显存开销较高以及布局质量难以有效权衡的技术问题

Benefits of technology

[0132]1.本发明通过步骤6构建周期性目标执行序列,并通过步骤7在每一训练步骤中仅激活一个布局质量目标进行损失计算、梯度反向传播及模型参数更新,避免现有联合训练方式在同一训练步骤中同时计算全部目标。实验结果表明,在相同 GVLM 模型架构下,本发明采用的 PMO 方法平均训练时间为 2.98 min/epoch、峰值显存占用为 3.64 GB、计算量为 5.56×1012 FLOPs/epoch;相比 Joint Training 的 8.26 min/epoch、14.69 GB 和19.21×1012FLOPs/epoch,分别仅为其约 36.1%、24.8% 和 28.9%,即训练时间约降低63.9%、峰值显存约降低 75.2%、FLOPs 约降低 71.1%,从而解决多目标同步计算导致训练资源消耗较高的技术问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123015721A_ABST
    Figure CN123015721A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of graph data processing, graph visualization and graph neural network, and discloses a graph layout generation method and system based on phased multi-objective optimization and structure-aware graph neural network, which is used to solve the problems of gradient interference, unstable training and difficult trade-off of layout quality caused by insufficient utilization of multi-objective weighted joint loss and graph structure information in the prior art. The method comprises: performing structure analysis on input graph data to obtain an adjacency matrix, node features and edge structure features; performing mapping and normalization on the edge structure features to obtain edge weights; performing structure-aware message aggregation and graph neural network transformation on the node features and edge weights to obtain a layout structure representation; mapping the layout structure representation to two-dimensional coordinates to obtain a predicted layout; calculating multiple independent quality optimization objectives for the predicted layout; constructing an activation target sequence according to a pre-set stage distribution relationship; selecting a single target according to the sequence to perform loss calculation and gradient update, and repeatedly training to obtain a graph layout generation model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of graph data processing, graph visualization, graph neural networks and machine learning optimization technology, and provides a graph layout generation method and system based on staged multi-objective optimization and structure-aware graph neural networks. Background Technology

[0002] Graph layout is a core technical problem in the fields of graph data processing and graph visualization. Its goal is to map the nodes and edges in graph structure data to a two-dimensional coordinate space, so that the generated layout can clearly and reasonably express the topological relationships between nodes. With the continuous growth in the scale of graph structure data such as social networks, transportation networks, communication networks, and biological networks, higher requirements are placed on graph layout methods in terms of layout quality, optimization efficiency, and scalability.

[0003] Currently, existing graph layout generation methods mainly fall into the following categories:

[0004] The first category consists of force-oriented graph layout methods, such as the Fruchterman-Reingold algorithm and the ForceAtlas2 algorithm. These methods model the connections between nodes as attractive and repulsive forces, and iteratively update node positions to bring the system to a state of mechanical equilibrium, thereby achieving automatic graph layout. These methods are widely used in graph visualization systems such as Gephi.

[0005] The second category consists of graph layout methods based on hierarchical or constraint-based approaches, such as the DOT / Sugiyama hierarchical layout algorithm in Graphviz. These methods generate structured graph layouts through steps such as node hierarchies, edge intersection minimization, and coordinate allocation, and are suitable for specific scenarios such as directed graphs, flowcharts, and dependency graphs.

[0006] The third category is layout generation methods based on multi-objective optimization. These methods employ multi-objective evolutionary optimization algorithms such as NSGA-II and MOEA / D to simultaneously optimize multiple graph layout metrics, including node overlap, number of edge intersections, edge length, layout compactness, and node spacing, and select the final layout scheme from the Pareto optimal solution set.

[0007] Furthermore, in learning-based graph layout generation methods, such as Multicriteria Scalable GraphDrawing via Stochastic Gradient Descent ((SGD)², published in IEEE Transactions on Visualization and Computer Graphics, 2022), multicriteria graph layout optimization methods can optimize multiple differentiable layout quality metrics, and have been experimentally verified in terms of layout quality, runtime, and scalability.

[0008] However, the aforementioned existing technologies still have significant shortcomings in multi-objective graph layout optimization:

[0009] On the one hand, traditional force-oriented methods, multidimensional scaling (MDS) methods, and hierarchical layout methods usually rely on manually designed layout rules, iterative optimization processes, and relatively sensitive parameter settings. Moreover, they are often designed around specific layout principles, making it difficult to simultaneously consider multiple conflicting layout quality optimization goals such as global structure preservation, node occlusion reduction, reasonable side length, and local angle readability within a unified framework.

[0010] On the other hand, most existing learning-based graph layout methods employ a weighted joint loss approach to merge multiple layout quality objectives into a single scalar loss for simultaneous optimization. This method is highly sensitive to the weight settings of each loss term; when different optimization objectives differ in numerical scale, convergence speed, or gradient direction, it can easily lead to mutual interference between objectives, training instability, and optimization results biased towards certain objectives. Furthermore, simultaneously calculating and backpropagating multiple objective functions during a single training iteration significantly increases computational load and GPU memory consumption, especially in large-scale graph data scenarios, potentially leading to technical bottlenecks such as decreased training efficiency, excessive computational resource consumption, and limited ability to balance multiple objectives.

[0011] Therefore, there is an urgent need for a graph layout generation method that can coordinate multiple layout quality optimization objectives under a unified framework, reduce inter-objective interference and resource consumption during multi-objective training, and improve the utilization of graph structure information. Summary of the Invention

[0012] The purpose of this invention is to solve the technical problems of existing graph layout generation methods, such as mutual interference between gradients between objectives, unstable training, high computational and memory overhead, and difficulty in effectively balancing layout quality, caused by the use of multi-objective weighted joint loss and insufficient utilization of graph structure information during multi-objective optimization.

[0013] To achieve the above objectives, the present invention employs the following technical means:

[0014] This invention provides a graph layout generation method based on staged multi-objective optimization and structure-aware graph neural networks, comprising the following steps:

[0015] Step 1: Perform graph structure analysis and structural feature construction on the input graph data to obtain the adjacency matrix, node features, and edge structure features containing structural distance information between nodes;

[0016] Step 2: Perform neural network mapping and normalization on the edge structure features obtained in Step 1 to obtain the edge weights used to modulate the message propagation strength between nodes.

[0017] Step 3: Perform structure-aware message aggregation and multi-layer graph neural network feature transformation on the node features obtained in Step 1 and the edge weights obtained in Step 2 to obtain the layout structure representation corresponding to each node.

[0018] Step 4: Perform two-dimensional coordinate mapping on the layout structure representation obtained in Step 3 to obtain the two-dimensional coordinates of each node and the current predicted graph layout;

[0019] Step 5: Calculate multiple layout quality indicators for the current predicted map layout obtained in Step 4 to obtain multiple independent layout quality optimization targets;

[0020] Step 6: Construct a periodic execution sequence for the multiple layout quality optimization targets obtained in Step 5 according to the preset stage allocation relationship, so as to obtain the activation target sequence corresponding to each training step;

[0021] Step 7: Select the single layout quality optimization objective corresponding to the current training step according to the activation target sequence obtained in Step 6, perform loss calculation and gradient backpropagation on the single layout quality optimization objective, and update the graph layout generation model parameters according to the obtained gradient; perform model training cyclically according to the activation target sequence to obtain the trained graph layout generation model.

[0022] In the above scheme, step 1 includes:

[0023] Step 1.1: Read the image data to be processed. The set of nodes in the analytical graph data Sum of edges Establish an adjacency matrix based on node connectivity. This yields graph structure data;

[0024] Step 1.2: Perform node attribute encoding or node feature initialization processing on the node data obtained in Step 1.1 to obtain the node feature matrix. ;

[0025] Step 1.3: Based on the graph structure data obtained in Step 1.1, calculate the nodes using the shortest path calculation algorithm. With nodes Structural distance between This yields the structural distance information between node pairs;

[0026] Step 1.4: Encode the structural distances obtained in Step 1.3 to construct the structural feature vectors of the corresponding edges:

[0027]

[0028] in, For nodes With nodes The shortest path distance between them A preset positive number is used to avoid numerical instability. This invention addresses the issue that different structural edges contribute differently to node information propagation. It employs "neural network mapping and normalization processing to obtain edge weights used to modulate the intensity of message propagation between nodes," thus solving the technical problem that existing graph neural networks struggle to distinguish the importance of edges with different structures and are easily affected by low-correlation edges.

[0029] In the above scheme, step 2 includes:

[0030] Step 2.1: Apply the edge structure features obtained in Step 1.4 The edge weight network is input, and the edge structure features are processed by a multilayer perceptron through nonlinear mapping.

[0031] Step 2.2: The mapping result obtained in Step 2.1 is numerically mapped using the Sigmoid activation function to obtain the structural modulation weights corresponding to each edge.

[0032]

[0033] in, For nodes With nodes Between the edges structural modulation weights, It is the Sigmoid activation function. It is a multilayer perceptron. The edge structure feature vector obtained in step 1.4;

[0034] Step 2.3: Perform SoftMax normalization calculation on the structural modulation weights obtained in Step 2.2 to obtain the node... To the node Normalized edge weights corresponding to information propagation:

[0035]

[0036] in, For nodes To the node Normalized edge weights during information propagation The parameters used to control the concentration of the SoftMax weight distribution. For nodes The set of neighboring nodes, For nodes With nodes Between the edges The structure modulated weights.

[0037] This invention addresses the issue that different structural relationships contribute differently to node feature updates and that deep message propagation is prone to oversmoothing. To solve this problem, it employs "structure-aware message aggregation and multi-layer graph neural network feature transformation" to address the technical challenge of existing graph neural networks in differentiatedly utilizing structural information while maintaining the effectiveness of deep node representations.

[0038] In the above scheme, step 3 includes:

[0039] Step 3.1: Based on the normalized edge weights obtained in Step 2.3, apply the weights to the target node. The hidden features of neighboring nodes are used to perform weighted message aggregation, resulting in structure-aware neighborhood aggregation information:

[0040]

[0041] in, For neighboring nodes Hidden features, The normalized edge weights obtained in step 2.3 For the target node The set of neighboring nodes;

[0042] Step 3.2: Combine the neighborhood aggregation information obtained in Step 3.1 with the target node. The hidden features of the nodes are fused together and feature transformation is performed through a fully connected layer to obtain the updated hidden node representation.

[0043] Step 3.2.1: Obtain the hidden features and neighborhood aggregation information of the target node in the current layout transformation layer. Let the current layout transformation layer be layer l, and read the hidden features corresponding to the target node v in the current layer. And read the neighborhood aggregation information of node (v) obtained in step 3.1 based on the structure-aware edge weights:

[0044]

[0045] Where N(v) represents the set of neighboring nodes of node v. This indicates nonlinear processing. The preset positive number is used to improve numerical stability; the neighborhood aggregation process is controlled by the normalized edge weights obtained in step 2, so that different neighboring nodes participate in the feature update of the target node according to their structural correlation.

[0046] Step 3.2.2: Fuse the target node's own hidden features with the neighborhood aggregation information. The target node's own hidden features obtained in Step 3.2.1 are then fused. Aggregate information with neighboring areas Perform feature fusion to obtain fused features:

[0047]

[0048] By preserving the node's own characteristics and adding structure-aware neighborhood information, the updated node representation contains both the existing structure representation of the current node and the neighborhood structure information selectively propagated based on the degree of correlation of edge structures.

[0049] Step 3.2.3: Perform fully connected feature transformation on the fused features. The fused features obtained in step 3.2.2... Input a fully connected layer, perform a feature space transformation, and obtain the hidden representation of intermediate nodes generated by the current layout transformation layer. ,Right now:

[0050]

[0051] in, This represents the fully connected feature transformation function.

[0052] Through the above processing, the target node's own information and the neighborhood information filtered according to the structural edge weights are mapped to a unified hidden feature space, providing node representation for subsequent multi-layer layout structure feature extraction.

[0053] Step 3.3: Perform normalization, nonlinear activation, and residual connection processing on the node hidden representation obtained in Step 3.2 to obtain the output of the current layout transformation layer;

[0054] Step 3.3.1: Perform normalization processing on the hidden node representations. Perform normalization processing on the hidden representations of intermediate nodes obtained in Step 3.2.3:

[0055]

[0056] in, This represents a normalization operation, used to adjust the numerical distribution across different nodes or feature dimensions, reducing the impact of numerical scale changes on model training stability during continuous multi-layer feature transformations.

[0057] Step 3.3.2: Perform nonlinear activation on the normalized node hidden representation. Input the node representation obtained in Step 3.3.1 into the nonlinear activation function to obtain:

[0058]

[0059] Nonlinear activation is used to improve the feature representation ability of multilayer layout transformation networks for complex graph structural relationships.

[0060] Step 3.3.3: Establish residual connections between adjacent layout transform blocks. To reduce over-smoothing of node representations and gradient decay in deep networks caused by the continuous execution of graph message propagation by multiple layout transform blocks, the hidden node representations at the input of the current layout transform block are passed to the output of the current layout transform block through residual paths, so that the low-level node structure information can form the output node representation together with the structural features extracted by the current layout transform block. In an implementation where the input feature dimension and the output feature dimension are the same, the residual processing can be expressed as:

[0061]

[0062] Obtain the output node representation corresponding to the l-th layout transformation block. .

[0063] By setting residual connections, the structural features of the nodes in the previous layer can be directly passed to the deeper layout transformation layer, reducing the excessive smoothing of node features and gradient decay caused by the propagation of continuous multi-layer graph messages. It also allows the local structural information extracted from the lower layer and the larger-scale structural information formed by the higher layer to participate in the construction of the subsequent graph layout representation.

[0064] Step 3.4: Input the node representation obtained in Step 3.3 into the next layout transformation layer, and repeat the message aggregation and feature transformation processing. After a preset number of layout transformation layers, the final layout structure representation corresponding to each node is obtained.

[0065] Step 3.4.1: Use the output of the current layout transform block as the node input of the next layout transform block. Use the node representation obtained in Step 3.3... This serves as the hidden feature input for the nodes in the (l+1)th layout transformation layer.

[0066] Meanwhile, in the next layout transformation layer, the structure-aware edge weights obtained in step 2 are used to modulate the information contribution of each neighboring node.

[0067] Step 3.4.2: Repeat the structure-aware message aggregation in the next layout transformation layer. For the (l+1)th layout transformation layer, re-execute the structure-aware message aggregation in step 3.1 according to the normalized edge weights of each neighboring node corresponding to the target node v:

[0068]

[0069] in, The message aggregation weights are obtained by using an edge weight network and SoftMax normalization based on the structural distance features between nodes. It is the ReLU activation function. These are numerically stable parameters. By performing the above structure-aware aggregation layer by layer, nodes can gradually acquire graph topology information over a wider range, while reducing interference from low-relevance structural connections during deep message propagation.

[0070] Step 3.4.3: Repeat the node feature fusion and fully connected feature transformation. The structure-aware neighborhood aggregation information obtained in Step 3.4.2 will be used... Hidden representation of the target node itself By fusing, we obtain:

[0071]

[0072] The fused node features are then input into the fully connected layer in the current layout transformation block for feature space mapping, resulting in:

[0073] =

[0074] in, This represents the learnable fully connected feature transformation function corresponding to the LayoutGNN layer in the (l+1)th layout transformation block. In one embodiment, the fully connected feature transformation can be expressed as:

[0075]

[0076] in, This is the trainable weight matrix corresponding to the current layout transformation block. This is a trainable bias vector. Through the fully connected feature transformation described above, the fused features formed by the node's own features and the structure-aware neighborhood information are mapped to the current hidden feature space.

[0077] Step 3.4.4: Output the final layout structure representation. After processing a preset number of K layout transformation blocks, hide the node representation obtained from the last layout transformation block:

[0078]

[0079] The final layout structure representation corresponding to each node is determined, and the final layout structure representation is input into the two-dimensional coordinate prediction module in step 4 to generate the two-dimensional layout coordinates corresponding to each node. In one specific embodiment, the layout transformation network includes 11 sequentially connected layout transformation blocks; this number is a specific implementation parameter and can be adjusted according to the scale of the graph data to be processed, the number of nodes, and the computing device resources, and does not constitute a limitation on the number of layout transformation layers.

[0080] This invention is based on the idea that graph layout generation requires further mapping of multi-layer structural features into low-dimensional spatial positions in order to obtain the layout coordinates of each node. To this end, it adopts "predicting the current graph layout" to solve the problem that existing graph neural networks cannot directly form two-dimensional node positions that can be used for graph visualization after obtaining the node structure representation.

[0081] In the above scheme, step 4 includes:

[0082] Step 4.1: Input the node layout structure obtained in the parent step 3 into the coordinate prediction network;

[0083] Step 4.2: Use a fully connected layer to map the node layout structure representation to a two-dimensional coordinate space to obtain the two-dimensional coordinates corresponding to node (i);

[0084] Step 4.3: Combine the two-dimensional coordinates of all nodes obtained in Step 4.2 to obtain the current prediction map layout.

[0085] In the above scheme, step 5, the multiple layout quality optimization objectives include the global graph structure preservation objective. Node occlusion target Side length consistency target and local readability goals ;

[0086] The calculation method for the global graph structure to preserve the target is as follows:

[0087]

[0088] in, and They are nodes and nodes Two-dimensional coordinates, For nodes With nodes The shortest path distance between them in the graph;

[0089] The method for calculating the target occlusion by the node is as follows:

[0090]

[0091] in, Preset parameters to control the degree of attenuation, For nodes With nodes The Euclidean distance between them A set of nodes;

[0092] The calculation method for the edge length consistency target is as follows:

[0093]

[0094] in, For the edge The Euclidean length in the current two-dimensional layout, The mean of all side lengths. Let be the total number of edges. Let it be the set of edges;

[0095] The calculation method for the local angular readability target is as follows:

[0096]

[0097] in, For nodes First The included angle between two adjacent sides, For nodes The degree, It is a set of nodes.

[0098] This invention is based on the idea that multi-objective optimization tasks need to be executed in stages according to a preset ratio. To this end, it adopts the method of "constructing a periodic execution sequence according to a preset stage allocation relationship to obtain the activation target sequence corresponding to each training step", which solves the technical problems of gradient interference, training control difficulties and large computational overhead caused by simultaneous optimization of multiple objectives.

[0099] In the above scheme, step 6 includes:

[0100] Step 6.1: Read the preset number of stages corresponding to each layout quality optimization target and form a stage number vector. ,in For the first The number of preset stages for each layout quality optimization objective. The total number of layout quality optimization targets;

[0101] Step 6.2: Calculate the greatest common divisor (GCD) of the number of stages obtained in Step 6.1. And according to the greatest common divisor By compressing the number of stages for each objective, we obtain the [number of stages]. Number of stages for each objective in an execution cycle Period length ;

[0102] Step 6.3: Based on the number of each target stage obtained in Step 6.2 Construct a periodic target execution sequence ;

[0103] Step 6.4: According to the current training step number Execution sequence length and preset starting offset The execution sequence from the periodic target is calculated by modulo operation. Get the currently active target:

[0104]

[0105] in, The goal is to optimize the activation layout quality for the current training step. Execute a sequence for a periodic target. Number the current training step. The preset starting offset, The total number of stages contained in an execution cycle.

[0106] This invention addresses the issue that simultaneous training of multiple targets can easily lead to gradient interference and increased computational overhead. To resolve this, the invention employs a method of "cyclically executing model training according to the activated target sequence to obtain a trained graph layout generation model," thus solving the technical problems of gradient conflict, training instability, and high resource consumption in multi-target joint training.

[0107] In the above scheme, step 7 includes:

[0108] Step 7.1: Based on the current activation target determined in step 6.4, call the loss calculation program corresponding to the activation target;

[0109] Step 7.2: Perform forward propagation on the current batch of graph data using a graph neural network to obtain a two-dimensional predicted layout, and only calculate the loss value corresponding to the current activated target. The loss calculation and backpropagation are not performed on the non-activated layout quality optimization target in the current training step.

[0110] Step 7.3: Using the automatic differentiation procedure of the deep learning computing framework, establish the corresponding computation graph based on the current activation target and calculate the gradient of the model parameters;

[0111] Step 7.3.1: Determine the objective for gradient calculation in the current training step. Obtain the loss value corresponding to the current activation layout quality optimization objective obtained in Step 7.2. Where t represents the current training step, This represents the current target index determined by the periodically activated target sequence. The loss value is determined as the only one involved in gradient backpropagation in the current training step; for the remaining non-activated layout quality optimization objectives in the target set... ,in In the current training step, not related to It performs a weighted combination and does not participate in the calculation of the gradient of the current model parameters.

[0112] Therefore, the current training step does not construct a joint loss consisting of multiple layout quality objectives, but only retains the computational dependency between the current activation objective and the parameters of the two-dimensional predicted layout and the graph layout generation model.

[0113] Step 7.3.2: Perform automatic differentiation and gradient backpropagation based on the current activation target. The loss value for the current activation target determined in Step 7.3.1 is used. As the starting point for backpropagation, using a deep learning computation framework that supports automatic differentiation, gradient backpropagation is performed along the forward computation path of the current 2D predicted layout to calculate the gradient of the current activation target relative to the graph layout generation model parameters:

[0114]

[0115] in, This represents the gradient of the model parameters obtained in the t-th training step. This represents the parameters for generating the graph layout model. This represents the two-dimensional predicted layout output by the graph layout generation model for the input graph G.

[0116] The inactive layout quality optimization objective in the current training step does not perform the corresponding gradient backpropagation, and therefore does not generate the gradient of the inactive objective with respect to the model parameters.

[0117] Step 7.3.3: Output the current single-objective gradient as the basis for updating model parameters. Use the model parameter gradient obtained in step 7.3.2... The gradient serves as the basis for parameter updates in the current training step and is passed to subsequent model parameter update steps. The gradient reflects only the optimization direction of the current activation layout quality optimization objective on the model parameters, rather than a weighted sum of gradients from multiple layout quality optimization objectives. After completing the current training step, in the next training step, a new activation objective is determined according to the periodic activation objective sequence obtained in step 6. The single-objective loss calculation and gradient backpropagation process described above are repeated for the new activation objective, thus allowing different layout quality optimization objectives to participate in model parameter optimization sequentially according to a preset stage allocation relationship.

[0118] Step 7.4: Based on the model parameter gradients obtained in Step 7.3, update the graph layout using the optimizer to generate model parameters. , in, This represents the model parameters before the update in the t-th training step. This represents the updated model parameters after completing the current training step. Indicates the learning rate;

[0119] Step 7.5: After completing the current training step, update the training step number and determine the activation target of the next training step according to the periodic target execution sequence generated in step 6, so that multiple layout quality optimization targets participate in the model parameter update in different training steps in turn.

[0120] Step 7.6: Repeat steps 2 to 7 until the preset training termination condition is met to obtain the trained graph layout generation model; input the graph data to be laid out into the trained graph layout generation model, and after structure-aware message aggregation and two-dimensional coordinate prediction, output the two-dimensional layout result of the target graph.

[0121] The present invention also provides a graph layout generation system based on staged multi-objective optimization and structure-aware graph neural networks, comprising:

[0122] The graph data input and preprocessing module is used to acquire the graph data to be processed and convert the graph data into an adjacency matrix, a node feature matrix, and node connection relationships.

[0123] The edge structure feature construction module is used to generate edge structure features containing structural distance information between nodes based on the graph structure relationship between nodes.

[0124] The edge weight calculation module is used to perform nonlinear mapping on the edge structure features through the edge weight network to obtain the structure modulation weight of the corresponding edge.

[0125] The graph layout feature transformation module is used to perform multi-layer structure-aware message passing and feature transformation on node features using a graph neural network and based on the structure modulation weights, so as to obtain the layout structure representation of each node.

[0126] The two-dimensional coordinate prediction module is used to map the layout structure representation to a two-dimensional coordinate space to obtain the two-dimensional coordinates of each node.

[0127] The multi-objective evaluation module is used to calculate multiple independent layout quality optimization objectives based on the predicted two-dimensional coordinates of the nodes.

[0128] The phased multi-objective optimization module is used to construct a periodic objective execution sequence according to a preset phase allocation relationship, and activate only one layout quality optimization objective in each training step to perform loss calculation, gradient backpropagation, and model parameter update.

[0129] The present invention also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement the graph layout generation method based on staged multi-objective optimization and structure-aware graph neural network.

[0130] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the graph layout generation method based on staged multi-objective optimization and structure-aware graph neural network.

[0131] Because the present invention employs the above-mentioned technical means, it has the following beneficial effects:

[0132] 1. This invention constructs a periodic target execution sequence in step 6, and activates only one layout quality target for loss calculation, gradient backpropagation, and model parameter update in each training step in step 7, avoiding the need for existing joint training methods to calculate all targets simultaneously in the same training step. Experimental results show that, under the same GVLM model architecture, the PMO method used in this invention has an average training time of 2.98 min / epoch, a peak memory usage of 3.64 GB, and a computational cost of 5.56 × 10⁻⁶. 12 FLOPs / epoch; compared to Joint Training's 8.26 min / epoch, 14.69 GB, and 19.21 × 10⁻⁶ FLOPs / epoch; 12 The FLOPs / epochs are only about 36.1%, 24.8% and 28.9% of the original, respectively, which means that the training time is reduced by about 63.9%, the peak memory usage is reduced by about 75.2% and the FLOPs are reduced by about 71.1%, thus solving the technical problem of high training resource consumption caused by multi-objective synchronous computing.

[0133] 2. This invention maintains Stress, Node Occlusion, Edge Length Variance, and Angular Resolution as independent optimization objectives in step 5, and executes them in stages along the training time dimension through steps 6 and 7, thereby avoiding the formation of joint gradients for multiple objectives in the same step. Experimental results show that, under the same GVLM architecture, PMO achieves results of 2136.86, 1431.89, 168.537, and 596.50 on the Stress, Occ, EdgeVar, and Angle metrics, respectively. While significantly reducing training resource consumption, it maintains overall competitive layout quality with multi-objective training methods such as Joint Training, DWA, and GradNorm, demonstrating that this invention can improve the quality-efficiency tradeoff in multi-objective training.

[0134] 3. This invention constructs structural distance features between nodes in step 1, learns edge modulation weights in step 2, and then performs structure-aware message aggregation using the edge weights in the parent step 3, enabling different structural connections to participate in node representation updates according to their relevance. In ablation experiments, with PMO used in all cases, after introducing the edge weight network, Stress decreased from 2152.49 to 2136.02, Occ decreased from 1445.63 to 1430.02, and Angle decreased from 609.884 to 598.400, indicating that this structure-aware edge weight mechanism can improve layout quality indicators such as global structure preservation, node spatial separation, and local angle readability.

[0135] 4. This invention employs a single-objective, phased execution approach, allowing newly added layout quality objectives to primarily expand the objective set and phase scheduling sequence, without requiring the simultaneous calculation of all objectives in each parameter update. In experiments, when the number of optimization objectives increased from 1 to 5, the average training time remained within the range of approximately 2.66–2.85 min / epoch, without showing a significant monotonic increase with the number of objectives. This indicates that the method has low single-step runtime sensitivity when adding layout optimization objectives, making it suitable for expansion to more complex multi-objective graph layout tasks.

[0136] 5. This invention combines a differentiated message aggregation mechanism based on edge structure weights with a phased single-objective training mechanism based on periodic execution sequences. The former enhances the graph neural network's ability to utilize effective structural connections, while the latter reduces gradient interference and resource overhead caused by multi-objective synchronous backpropagation. Together, they enable the model to obtain a node layout representation with structure awareness and to continuously optimize multiple layout quality objectives at a lower training cost. In ablation experiments, the complete GVLM-PMO achieved the best Stress (2136.02), Occ (1430.02), and Angle (598.400) metrics among the four comparative variants. Furthermore, PMO significantly reduces training time, memory usage, and FLOPs compared to Joint Training. This achieves a technical effect that cannot be obtained simultaneously by using edge weight mechanisms or traditional joint optimization methods alone, balancing structural expressiveness and training resource efficiency. Attached Figure Description

[0137] Figure 1 This is a structural diagram of the system / device module of the present invention;

[0138] Figure 2 This is the main flowchart of the method of the present invention;

[0139] Figure 3 This is the data flow diagram for the core algorithm. Detailed Implementation

[0140] The embodiments of the present invention will be described in detail below. Although the present invention will be described and illustrated in conjunction with some specific embodiments, it should be noted that the present invention is not limited to these embodiments. On the contrary, any modifications or equivalent substitutions made to the present invention should be covered within the scope of the claims of the present invention.

[0141] Furthermore, to better illustrate the present invention, numerous specific details are set forth in the following detailed embodiments. Those skilled in the art will understand that the present invention can be practiced without these specific details.

[0142] I. General Description of the Implementation Examples

[0143] This embodiment provides a method and system for training and generating graph layout models based on phased multi-objective optimization and structure-aware graph neural networks. The graph layout model is implemented using Python, PyTorch, and PyTorch Geometric, and the graph neural network training and tensor computation are performed using a GPU. The model uses 11 LayoutGNN layout transformation blocks, the optimizer is AdamW, and the initial learning rate is set to 1×10⁻⁶. -4The learning rate decay factor is 0.99, the batch size is set to 16, and the number of training epochs is set to 200. These parameters are specific embodiments and can be adjusted according to the scale of the graph data and the performance of the computing device, and do not constitute a limitation on the scope of protection of this invention.

[0144] II. System Composition and Hardware Environment

[0145] like Figure 1 As shown, the graph layout generation system provided in this embodiment includes a graph data input and preprocessing module, an edge structure feature construction module, an edge weight calculation module, a graph layout feature transformation module, a two-dimensional coordinate prediction module, a multi-objective evaluation module, and a phased multi-objective optimization module.

[0146] This embodiment can be executed collaboratively by the central processing unit (CPU), system memory, graphics processing unit (GPU), and GPU memory. First, the CPU reads the raw graph data from the storage medium, parses the node set, edge set, and node connection relationships, and converts the graph data into tensor data such as adjacency relationships, node features, and edge structure features. This tensor data is organized according to training batches and then transferred to the GPU memory by the deep learning computing framework. The GPU performs parallel computations on the tensors stored in the memory, including matrix operations on the edge weight network, Sigmoid and SoftMax operations, graph neighborhood message aggregation, node feature transformation, two-dimensional coordinate prediction, and loss calculation for the quality objective of the currently active layout.

[0147] For GPUs that support CUDA, PyTorch can load model parameters, node features, edge features, and intermediate computation tensors into GPU memory via the CUDA computation interface, and call the underlying GPU for parallel computation to complete matrix multiplication, graph message aggregation, loss calculation, and gradient calculation. This invention does not limit the specific CUDA Kernel or GPU model.

[0148] During the training phase, the CPU or training control program determines the current activation target based on the current training step number and the pre-generated periodic target execution sequence, and calls the corresponding loss function to the deep learning computing framework. The deep learning computing framework further calls the GPU parallel computing interface to complete the forward computation and backpropagation corresponding to the target. In a phased multi-objective optimization training step, only the computation graph, intermediate tensors, and gradient data corresponding to the current activation target need to participate in loss calculation and backpropagation in GPU memory; other non-activation targets do not establish corresponding backpropagation paths. After completing the gradient calculation and model parameter update of the current step, the relevant intermediate computation data is released by the deep learning framework or reused in GPU memory before proceeding to the next training step.

[0149] III. Detailed Description of Method and Flow

[0150] The overall data processing flow of the graph layout generation method provided in this embodiment is as follows: original graph data → adjacency matrix / node feature / edge feature generation → edge structure feature construction → edge weight calculation → multi-layer LayoutGNN layout feature transformation → two-dimensional node coordinate prediction → current stage layout quality target calculation → gradient backpropagation → model parameter update → output final two-dimensional graph layout.

[0151] Step 1: Perform graph structure analysis and structural feature construction on the input graph data to obtain the adjacency matrix, node features, and edge structure features containing structural distance information between nodes;

[0152] Step 1.1: The computer reads the image data to be processed. The set of nodes in the analytical graph data Sum of edges Establish an adjacency matrix based on node connectivity. This yields graph structure data. Each node corresponds to a graph node in the layout to be generated, and each edge represents the connection relationship between nodes. For graphs that require enhanced global structural information propagation, long-distance structural relationships or virtual edges between nodes can be further constructed, and the shortest path distance between node pairs can be calculated to provide structural information for subsequent edge feature construction.

[0153] Step 1.2: Perform node attribute encoding or node feature initialization processing on the node data obtained in Step 1.1 to obtain the node feature matrix. .

[0154] Step 1.3: Based on the graph structure data obtained in Step 1.1, calculate the nodes using the shortest path calculation algorithm. With nodes Structural distance between This yields the structural distance information between node pairs.

[0155] Step 1.4: Encode the structural distances obtained in Step 1.3 to construct the structural feature vectors of the corresponding edges:

[0156]

[0157] in, For nodes With nodes The shortest path distance between them This is a preset positive number used to avoid division by zero and numerical anomalies. By simultaneously introducing shortest path distance and inverse distance features, the edge features simultaneously describe the global topological distance and distance strength between nodes.

[0158] Step 2: Perform neural network mapping and normalization on the edge structure features obtained in Step 1 to obtain the edge weights used to modulate the message propagation strength between nodes;

[0159] Step 2.1: Apply the edge structure features obtained in Step 1.4 The input edge weight network is used to perform nonlinear mapping processing on the edge structure features through a multilayer perceptron. The edge weight network preferably employs a two-layer multilayer perceptron (MLP).

[0160] Step 2.2: The mapping result obtained in Step 2.1 is numerically mapped using the Sigmoid activation function to obtain the structural modulation weights corresponding to each edge.

[0161]

[0162] in, For nodes With nodes Between the edges structural modulation weights, It is the Sigmoid activation function. It is a multilayer perceptron. This represents the edge structure feature vector. The edge weights are used to characterize the structural importance of the corresponding edge in the graph layout information propagation process. For real or virtual structural edges with high structural relevance, the real or virtual structural edges are given a higher contribution in the message aggregation process; for long-distance structural edges with low relevance or containing noise, the information propagation weight of the long-distance structural edges is reduced.

[0163] Step 2.3: Perform SoftMax normalization calculation on the structural modulation weights obtained in Step 2.2 to obtain the node... To the node Normalized edge weights corresponding to information propagation:

[0164]

[0165] in, For nodes To the node Normalized edge weights during information propagation The parameters used to control the concentration of the SoftMax weight distribution. For nodes The set of neighboring nodes, For nodes With nodes Between the edges The structure modulated weights.

[0166] Step 3: Perform structure-aware message aggregation and multi-layer graph neural network feature transformation on the node features obtained in Step 1 and the edge weights obtained in Step 2 to obtain the layout structure representation of each node.

[0167] Step 3.1: Based on the normalized edge weights obtained in Step 2.3, apply the weights to the target node. The hidden features of neighboring nodes are used to perform weighted message aggregation, resulting in structure-aware neighborhood aggregation information:

[0168]

[0169] in, For neighboring nodes Hidden features, To normalize edge weights, For the target node The set of neighboring nodes.

[0170] Step 3.2: Combine the neighborhood aggregation information obtained in Step 3.1 with the target node. The hidden features of the nodes are fused together and feature transformation is performed through a fully connected layer to obtain the updated hidden node representation.

[0171] Step 3.3: Perform normalization, nonlinear activation, and residual connection processing on the node hidden representations obtained in Step 3.2 to obtain the output of the current layout transformation layer. The nonlinear activation preferably uses the LeakyReLU activation function.

[0172] Step 3.3.1: Perform normalization processing on the hidden node representations. Perform normalization processing on the hidden representations of intermediate nodes obtained in Step 3.2.3:

[0173]

[0174] in, This represents a normalization operation, used to adjust the numerical distribution across different nodes or feature dimensions, reducing the impact of numerical scale changes on model training stability during continuous multi-layer feature transformations.

[0175] Step 3.3.2: Perform nonlinear activation on the normalized node hidden representation. Input the node representation obtained in Step 3.3.1 into the nonlinear activation function to obtain:

[0176]

[0177] Nonlinear activation is used to improve the feature representation ability of multilayer layout transformation networks for complex graph structural relationships.

[0178] Step 3.3.3: Establish residual connections between adjacent layout transform blocks. To reduce over-smoothing of node representations and gradient decay in deep networks caused by the continuous execution of graph message propagation by multiple layout transform blocks, the hidden node representations at the input of the current layout transform block are passed to the output of the current layout transform block through residual paths, so that the low-level node structure information can form the output node representation together with the structural features extracted by the current layout transform block. In an implementation where the input feature dimension and the output feature dimension are the same, the residual processing can be expressed as:

[0179]

[0180] Obtain the output node representation corresponding to the l-th layout transformation block. .

[0181] By setting residual connections, the structural features of the nodes in the previous layer can be directly passed to the deeper layout transformation layer, reducing the excessive smoothing of node features and gradient decay caused by the propagation of continuous multi-layer graph messages. It also allows the local structural information extracted from the lower layer and the larger-scale structural information formed by the higher layer to participate in the construction of the subsequent graph layout representation.

[0182] Step 3.4: Input the node representation obtained in Step 3.3 into the next layout transformation layer, and repeat the message aggregation and feature transformation processing. After a preset number of layout transformation layers, the final layout structure representation corresponding to each node is obtained. In this embodiment, the layout transformation network includes 11 layout transformation blocks, each of which includes at least a LayoutGNN graph neural network layer, a normalization layer, a nonlinear activation layer, and residual connections. Through the layer-by-layer processing of multiple layout transformation blocks, the node representation simultaneously encodes local neighborhood structure information and a larger range of graph topology structure information.

[0183] Step 3.4.1: Use the output of the current layout transform block as the node input of the next layout transform block. Use the node representation obtained in Step 3.3... This serves as the hidden feature input for the nodes in the (l+1)th layout transformation layer.

[0184] Meanwhile, in the next layout transformation layer, the structure-aware edge weights obtained in step 2 are used to modulate the information contribution of each neighboring node.

[0185] Step 3.4.2: Repeat the structure-aware message aggregation in the next layout transformation layer. For the (l+1)th layout transformation layer, re-execute the structure-aware message aggregation in step 3.1 according to the normalized edge weights of each neighboring node corresponding to the target node v:

[0186]

[0187] in, The message aggregation weights are obtained by using an edge weight network and SoftMax normalization based on the structural distance features between nodes. It is the ReLU activation function. These are numerically stable parameters. By performing the above structure-aware aggregation layer by layer, nodes can gradually acquire graph topology information over a wider range, while reducing interference from low-relevance structural connections during deep message propagation.

[0188] Step 3.4.3: Repeat the node feature fusion and fully connected feature transformation. The structure-aware neighborhood aggregation information obtained in Step 3.4.2 will be used... Hidden representation of the target node itself By fusing, we obtain:

[0189]

[0190] The fused node features are then input into the fully connected layer in the current layout transformation block for feature space mapping, resulting in:

[0191] =

[0192] in, This represents the learnable fully connected feature transformation function corresponding to the LayoutGNN layer in the (l+1)th layout transformation block. In one embodiment, the fully connected feature transformation can be expressed as:

[0193]

[0194] in, This is the trainable weight matrix corresponding to the current layout transformation block. This is a trainable bias vector. Through the fully connected feature transformation described above, the fused features formed by the node's own features and the structure-aware neighborhood information are mapped to the current hidden feature space.

[0195] Step 3.4.4: Output the final layout structure representation. After processing a preset number of K layout transformation blocks, hide the node representation obtained from the last layout transformation block:

[0196]

[0197] The final layout structure representation corresponding to each node is determined, and the final layout structure representation is input into the two-dimensional coordinate prediction module in step 4 to generate the two-dimensional layout coordinates corresponding to each node. In one specific embodiment, the layout transformation network includes 11 sequentially connected layout transformation blocks; this number is a specific implementation parameter and can be adjusted according to the scale of the graph data to be processed, the number of nodes, and the computing device resources, and does not constitute a limitation on the number of layout transformation layers.

[0198] Step 4: Perform two-dimensional coordinate mapping on the layout structure representation obtained in Step 3 to obtain the two-dimensional coordinates of each node and the current predicted graph layout;

[0199] Step 4.1: Input the node layout structure obtained in step 3 into the coordinate prediction network.

[0200] Step 4.2: Use a fully connected layer to map the node layout structure representation to a two-dimensional coordinate space to obtain the node... Corresponding two-dimensional coordinates:

[0201]

[0202]

[0203] in, Represents a node The coordinate position in the 2D graph layout Generate a model for parametric graph layout. To input graph data, This represents the total number of nodes.

[0204] Step 4.3: Combine the two-dimensional coordinates of all nodes obtained in Step 4.2 to obtain the current prediction map layout.

[0205] Step 5: Calculate multiple layout quality indicators for the current predicted map layout obtained in Step 4 to obtain multiple independent layout quality optimization targets;

[0206] Step 5.1: Calculate the global structure preservation loss based on the two-dimensional node coordinates obtained in step 4 and the shortest path distance between nodes.

[0207]

[0208] in, and They are nodes and nodes Two-dimensional coordinates, For nodes With nodes The shortest path distance between the graphs. The global structure preservation loss reflects the degree to which the graph topology distances are preserved.

[0209] Step 5.2: Calculate the Euclidean distance between different nodes based on the two-dimensional node coordinates obtained in the parent step 4, and penalize node pairs that are too close in space to obtain the node occlusion loss:

[0210]

[0211] in, Preset parameters to control the degree of attenuation, For nodes With nodes The Euclidean distance between them.

[0212] Step 5.3: Calculate the Euclidean length of each connecting edge in the current 2D layout, and calculate the edge length variance loss based on the deviation between each edge length and the average edge length.

[0213]

[0214] in, For the edge The Euclidean length in the current two-dimensional layout, The mean of all side lengths. Let be the total number of edges.

[0215] Step 5.4: Calculate the deviation between the actual included angle and the corresponding ideal uniform included angle between adjacent sides of each node to obtain the local angle loss:

[0216]

[0217] in, For nodes First The included angle between two adjacent sides, For nodes The degree.

[0218] Step 5.5: Combine the multiple independent losses obtained in steps 5.1 to 5.4 into a set of layout quality optimization objectives. Different objectives evaluate the graph layout quality from aspects such as global structure, node spatial separation, edge length distribution, and node local angular structure. Optionally, an aspect ratio objective can also be introduced.

[0219] Step 6: Construct a periodic execution sequence for the multiple layout quality optimization targets obtained in Step 5 according to the preset stage allocation relationship, so as to obtain the activation target sequence corresponding to each training step;

[0220] Step 6.1: The computer reads the preset number of stages corresponding to each layout quality optimization target and forms a stage number vector. ,in For the first The number of preset stages for each layout quality optimization objective. The total number of layout quality optimization targets.

[0221] Step 6.2: Calculate the greatest common divisor of the number of stages obtained in Step 6.1 using the processor. And according to the greatest common divisor By compressing the number of stages for each objective, we obtain the [number of stages]. Number of stages for each objective in an execution cycle Period length .

[0222] Step 6.3: Based on the number of each target stage obtained in Step 6.2 Construct a periodic target execution sequence in memory. ,in (k = 1, 2, …, K) represents the k-th layout quality optimization objective, where K represents the total number of layout quality optimization objectives. This indicates the number of stages the k-th objective occupies in an execution cycle.

[0223] Step 6.4: According to the current training step number Execution sequence length and preset starting offset The current active target is obtained from the execution sequence by modulo operation:

[0224]

[0225] in, The goal is to optimize the activation layout quality for the current training step. Execute a sequence for a periodic target. Number the current training step. The preset starting offset, The total number of stages contained in an execution cycle.

[0226] Unlike weighting multiple objective functions simultaneously to form a joint loss, this embodiment splits multiple optimization objectives along the training time dimension, allowing different objectives to participate in model parameter updates sequentially according to a preset period. This reduces gradient interference between multiple objectives in the same step, while also reducing the memory and computational overhead caused by simultaneous multi-objective loss calculation and backpropagation.

[0227] Step 7: Select the single layout quality optimization objective corresponding to the current training step according to the activation target sequence obtained in Step 6, perform loss calculation and gradient backpropagation on the single layout quality optimization objective, and update the graph layout generation model parameters according to the obtained gradient; perform model training cyclically according to the activation target sequence to obtain the trained graph layout generation model.

[0228] Step 7.1: The processor calls the loss calculation program corresponding to the current activation target based on the current activation target determined in step 6.4.

[0229] Step 7.2: Perform forward propagation on the current batch of graph data using a graph neural network to obtain a two-dimensional predicted layout, and calculate the loss value corresponding to the currently activated target only. Other non-activated targets in the current training step do not perform corresponding loss calculations and backpropagation.

[0230] Step 7.3: Using the automatic differentiation procedure of the deep learning computing framework, construct the corresponding computational graph based on the current activation target and calculate the gradient of the model parameters. .

[0231] Step 7.4: Based on the gradient obtained in Step 7.3, update the graph layout using the optimizer to generate model parameters. , in, This represents the model parameters before the update in the t-th training step. This represents the updated model parameters after completing the current training step. This represents the learning rate. In this embodiment, the optimizer uses AdamW, and the initial learning rate is 1×10⁻⁶. -4 The learning rate decay coefficient is 0.99.

[0232] Step 7.5: After completing the current training step, update the training step number and determine the activation target of the next training step according to the periodic target execution sequence generated in the parent step 6, so that multiple layout quality optimization targets participate in the model parameter update in different training steps in sequence.

[0233] Step 7.6: Repeat steps 2 through 7 until the preset training termination condition is met, resulting in a trained graph layout generation model. In this embodiment, the number of training epochs is set to 200, and the batch size is set to 16.

[0234] IV. Specific Procedures for Training

[0235] The specific training process in this embodiment is as follows:

[0236] Input graph data → Construct node and edge structure features → Calculate edge modulation weights → Execute LayoutGNN structure-aware message aggregation → Generate two-dimensional node coordinates → Determine the current optimization objective based on the PMO execution sequence → Calculate single-objective loss → Execute backpropagation and update model parameters → Iterate and train until the preset training termination condition is reached.

[0237] During training, four layout quality optimization objectives are set: Stress, Node Occlusion, Edge Length Variance, and Angular Resolution. The phased multi-objective optimization mechanism (PMO) generates a periodic objective execution sequence based on a preset phase allocation relationship. In each training step, only one layout quality objective is selected to calculate the loss and perform gradient backpropagation and model parameter updates. The remaining inactive objectives do not participate in the loss calculation and backpropagation of the current training step.

[0238] V. Specific Flow of Reasoning Process

[0239] During the inference phase, loss function calculation, target phase switching, and gradient backpropagation are no longer performed. The computer converts the graph data to be laid out into an adjacency matrix, node features, and edge structure features. These are then processed by the edge weight network and LayoutGNN for forward computation. Finally, the coordinate prediction network directly outputs the two-dimensional coordinates of the nodes, forming the graph layout result.

[0240] Specifically, the data to be laid out is input into the trained graph layout generation model, which only performs graph structure feature calculation, edge weight calculation, structure-aware message propagation, and two-dimensional coordinate prediction, without performing loss calculation and gradient backpropagation, and finally outputs the two-dimensional node layout corresponding to the target graph.

[0241] For operations involving the reciprocal of distance during the calculation process, add the following to the denominator: This is to avoid division by zero or numerical anomalies. When the input graph is large enough to cause insufficient GPU memory, the memory required for a single training session can be reduced by decreasing the batch size.

[0242] The software environment in this embodiment uses Python, PyTorch, and PyTorch Geometric. The forward propagation, automatic differentiation, and parameter updates of the graph neural network are executed on the GPU by the deep learning framework. The aforementioned software framework and hardware model can be replaced by software or computing devices with equivalent tensor computation and graph neural network processing capabilities.

[0243] The edge weight calculation module is not limited to using a two-layer MLP; other neural network structures that can output continuously modulated weights based on edge structure features can be used instead. The LayoutGNN in the graph layout feature transformation module can also be replaced by other graph neural network structures that support graph message passing, as long as the basic technical logic of "generating weights based on edge structure information and modulating neighborhood message aggregation accordingly" is maintained.

[0244] In addition to using a preset periodic sequence, the phased target execution sequence can further dynamically determine the current activation target or phase length based on graph structure characteristics, current training state, or convergence status of each target, while still maintaining the phased optimization logic of "only activating part or a single layout quality target for loss calculation and parameter update in a single training step".

[0245] This embodiment is not only applicable to general undirected... Figure 2 The layout generation can be extended to visualization layout tasks of graph structure data such as social networks, transportation networks, communication networks, and biological networks. While maintaining the structure-aware message aggregation and phased multi-objective optimization mechanism, it can also be used for layout generation of graph data of different scales or different topologies.

Claims

1. A graph layout generation method based on staged multi-objective optimization and structure-aware graph neural networks, characterized in that, Includes the following steps: Step 1: Perform graph structure analysis and structural feature construction on the input graph data to obtain the adjacency matrix, node features, and edge structure features containing structural distance information between nodes; Step 2: Perform neural network mapping and normalization on the edge structure features obtained in Step 1 to obtain the edge weights used to modulate the message propagation strength between nodes. Step 3: Perform structure-aware message aggregation and multi-layer graph neural network feature transformation on the node features obtained in Step 1 and the edge weights obtained in Step 2 to obtain the layout structure representation corresponding to each node. Step 4: Perform two-dimensional coordinate mapping on the layout structure representation obtained in Step 3 to obtain the two-dimensional coordinates of each node and the current predicted graph layout; Step 5: Calculate multiple layout quality indicators for the current predicted map layout obtained in Step 4 to obtain multiple independent layout quality optimization targets; Step 6: Construct a periodic execution sequence for the multiple layout quality optimization targets obtained in Step 5 according to the preset stage allocation relationship, so as to obtain the activation target sequence corresponding to each training step; Step 7: Select the single layout quality optimization objective corresponding to the current training step according to the activation target sequence obtained in Step 6, perform loss calculation and gradient backpropagation on the single layout quality optimization objective, and update the graph layout generation model parameters according to the obtained gradient; perform model training cyclically according to the activation target sequence to obtain the trained graph layout generation model.

2. The method according to claim 1, characterized in that, Step 1 includes: Step 1.1: Read the image data to be processed. The set of nodes in the analytical graph data Sum of edges Establish an adjacency matrix based on node connectivity. This yields graph structure data; Step 1.2: Perform node attribute encoding or node feature initialization processing on the node data obtained in Step 1.1 to obtain the node feature matrix. ; Step 1.3: Based on the graph structure data obtained in Step 1.1, calculate the nodes using the shortest path calculation algorithm. With nodes Structural distance between This yields the structural distance information between node pairs; Step 1.4: Encode the structural distances obtained in Step 1.3 to construct the structural feature vectors of the corresponding edges: in, For nodes With nodes The shortest path distance between them This is a preset positive number used to avoid numerical instability.

3. The method according to claim 2, characterized in that, Step 2 includes: Step 2.1: Apply the edge structure features obtained in Step 1.4 The edge weight network is input, and the edge structure features are processed by a multilayer perceptron through nonlinear mapping. Step 2.2: The mapping result obtained in Step 2.1 is numerically mapped using the Sigmoid activation function to obtain the structural modulation weights corresponding to each edge. in, For nodes With nodes Between the edges structural modulation weights, It is the Sigmoid activation function. It is a multilayer perceptron. The edge structure feature vector obtained in step 1.4; Step 2.3: Perform SoftMax normalization calculation on the structural modulation weights obtained in Step 2.2 to obtain the node... To the node Normalized edge weights corresponding to information propagation: in, For nodes To the node Normalized edge weights during information propagation The parameters used to control the concentration of the SoftMax weight distribution. For nodes The set of neighboring nodes, For nodes With nodes Between the edges The structure modulated weights.

4. The method according to claim 3, characterized in that, Step 3 includes: Step 3.1: Based on the normalized edge weights obtained in Step 2.3, apply the weights to the target node. The hidden features of neighboring nodes are used to perform weighted message aggregation, resulting in structure-aware neighborhood aggregation information: in, For neighboring nodes Hidden features, The normalized edge weights obtained in step 2.3 For the target node The set of neighboring nodes; Step 3.2: Combine the neighborhood aggregation information obtained in Step 3.1 with the target node. The hidden features of the nodes are fused together and feature transformation is performed through a fully connected layer to obtain the updated hidden node representation. Step 3.3: Perform normalization, nonlinear activation, and residual connection processing on the node hidden representation obtained in Step 3.2 to obtain the output of the current layout transformation layer; Step 3.4: Input the node representation obtained in Step 3.3 into the next layout transformation layer, and repeat the message aggregation and feature transformation processing. After a preset number of layout transformation layers, the final layout structure representation corresponding to each node is obtained.

5. The method according to claim 1, characterized in that, In step 5, the multiple layout quality optimization objectives include the global graph structure preservation objective. Node occlusion target Side length consistency target and local readability goals ; The calculation method for the global graph structure to preserve the target is as follows: in, and They are nodes and nodes Two-dimensional coordinates, For nodes With nodes The shortest path distance between them in the graph; The method for calculating the target occlusion by the node is as follows: in, Preset parameters to control the degree of attenuation, For nodes With nodes The Euclidean distance between them A set of nodes; The calculation method for the edge length consistency target is as follows: in, For the edge The Euclidean length in the current two-dimensional layout, The mean of all side lengths. Let be the total number of edges. Let it be the set of edges; The calculation method for the local angular readability target is as follows: in, For nodes First The included angle between two adjacent sides, For nodes The degree, It is a set of nodes.

6. The method according to claim 1, characterized in that, Step 6 includes: Step 6.1: Read the preset number of stages corresponding to each layout quality optimization target and form a stage number vector. ,in For the first The number of preset stages for each layout quality optimization objective. The total number of layout quality optimization targets; Step 6.2: Calculate the greatest common divisor (GCD) of the number of stages obtained in Step 6.

1. And according to the greatest common divisor By compressing the number of stages for each objective, we obtain the [number of stages]. Number of stages for each objective in an execution cycle Period length ; Step 6.3: Based on the number of each target stage obtained in Step 6.2 Construct a periodic target execution sequence ; Step 6.4: According to the current training step number Execution sequence length and preset starting offset The execution sequence from the periodic target is calculated by modulo operation. Get the currently active target: in, The goal is to optimize the activation layout quality for the current training step. Execute a sequence for a periodic target. Number the current training step. The preset starting offset, The total number of stages contained in an execution cycle.

7. The method according to claim 6, characterized in that, Step 7 includes: Step 7.1: Based on the current activation target determined in step 6.4, call the loss calculation program corresponding to the activation target; Step 7.2: Perform forward propagation on the current batch of graph data using a graph neural network to obtain a two-dimensional predicted layout, and only calculate the loss value corresponding to the current activated target. The loss calculation and backpropagation are not performed on the non-activated layout quality optimization target in the current training step. Step 7.3: Using the automatic differentiation procedure of the deep learning computing framework, establish the corresponding computation graph based on the current activation target and calculate the gradient of the model parameters; Step 7.4: Based on the model parameter gradients obtained in Step 7.3, update the graph layout using the optimizer to generate model parameters. , in, This represents the model parameters before the update in the t-th training step. This represents the updated model parameters after completing the current training step. Indicates the learning rate; Step 7.5: After completing the current training step, update the training step number and determine the activation target of the next training step according to the periodic target execution sequence generated in step 6, so that multiple layout quality optimization targets participate in the model parameter update in different training steps in turn. Step 7.6: Repeat steps 2 to 7 until the preset training termination condition is met to obtain the trained graph layout generation model; input the graph data to be laid out into the trained graph layout generation model, and after structure-aware message aggregation and two-dimensional coordinate prediction, output the two-dimensional layout result of the target graph.

8. A graph layout generation system based on staged multi-objective optimization and structure-aware graph neural networks, characterized in that, include: The graph data input and preprocessing module is used to acquire the graph data to be processed and convert the graph data into an adjacency matrix, a node feature matrix, and node connection relationships. The edge structure feature construction module is used to generate edge structure features containing structural distance information between nodes based on the graph structure relationship between nodes. The edge weight calculation module is used to perform nonlinear mapping on the edge structure features through the edge weight network to obtain the structure modulation weight of the corresponding edge. The graph layout feature transformation module is used to perform multi-layer structure-aware message passing and feature transformation on node features using a graph neural network and based on the structure modulation weights, so as to obtain the layout structure representation of each node. The two-dimensional coordinate prediction module is used to map the layout structure representation to a two-dimensional coordinate space to obtain the two-dimensional coordinates of each node. The multi-objective evaluation module is used to calculate multiple independent layout quality optimization objectives based on the predicted two-dimensional coordinates of the nodes. The phased multi-objective optimization module is used to construct a periodic objective execution sequence according to a preset phase allocation relationship, and activate only one layout quality optimization objective in each training step to perform loss calculation, gradient backpropagation, and model parameter update.

9. An electronic device comprising a processor and a memory, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the graph layout generation method based on staged multi-objective optimization and structure-aware graph neural network as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the graph layout generation method based on staged multi-objective optimization and structure-aware graph neural network as described in any one of claims 1 to 7.