Inter-node weight calculation method of weighted undirected network

By combining the GAT model and the multi-step random walk algorithm, the problems of computational paradigm fragmentation and poor adaptability of sparse dynamic networks in weighted undirected networks are solved, and high-fidelity inter-node weight calculation is achieved to meet the needs of real-time applications.

CN121743541APending Publication Date: 2026-03-27SUN YAT SEN UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-12
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing technologies suffer from problems such as fragmented computational paradigms, low fidelity of original edge weight information, and poor adaptability to sparse and dynamic networks when computing weighted undirected networks, making it difficult to accurately calculate the potential closeness between nodes.

Method used

The GAT model is used to initially generate predicted edges, and the weights of the predicted edges are corrected on the clean original graph through a multi-step random walk algorithm. Combined with the topological structure of the original graph, the interference of predicted edges on the topological structure calculation is avoided, thereby improving information fidelity and robustness.

Benefits of technology

It achieves high-fidelity computation in sparse and dynamic networks, meets the needs of real-time or near-real-time applications, quickly adapts to network changes, and improves the accuracy and efficiency of computation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121743541A_ABST
    Figure CN121743541A_ABST
Patent Text Reader

Abstract

The invention relates to an inter-node weight calculation method for a weighted undirected network, and the method comprises the steps: obtaining original weighted undirected network graph data, and carrying out the preprocessing of the original weighted undirected network graph data, and obtaining a first new graph; the first new graph is input into a pre-trained GAT model, a second new graph is obtained, and edges in the second new graph comprise original edges among mutually connected nodes in the first new graph and predicted edges among unconnected nodes; separating the second new image into a first sub-image only containing an original edge and a second sub-image only containing a predicted edge; based on the first sub-graph, correcting the weight of the prediction edge in the second sub-graph through a multi-step random walk algorithm to obtain a corrected second sub-graph; and integrating the first sub-graph and the corrected second sub-graph to obtain final weighted undirected network graph data. Compared with the prior art, the method can guarantee the authenticity and reliability of weight calculation, improves the fidelity of information, quickly adapts to network changes, and meets the real-time or quasi-real-time application requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer graph data processing technology, and in particular to a method, system, electronic device and storage medium for calculating the weights between nodes in a weighted undirected network. Background Technology

[0002] Weighted undirected graphs are a powerful data modeling tool in numerous applications, including social network analysis, intelligent recommendation systems, and knowledge graph completion. Nodes in the graph represent entities (such as users, products, and concepts), and undirected edges between nodes represent the relationships between entities. Their weights quantify the strength of these relationships (such as interaction frequency, similarity, and association strength, collectively referred to as "intimacy" below). Accurately calculating the potential intimacy between nodes that are not directly connected in the graph not only helps reveal local connection patterns in the network but also reflects its global structural characteristics. This technology has significant theoretical implications and broad application value for tasks such as improving the accuracy of friend recommendations, identifying key community nodes, optimizing product and content recommendations, and completing missing relationships in knowledge graphs.

[0003] Existing technologies mainly fall into three categories, but all have significant limitations: 1) Graph theory-based heuristic methods: These methods rely on the local topology of the network, such as the number of common neighbors and the Adamic-Adar index. They heavily depend on existing explicit connections in the graph, making it difficult to assess the closeness of disconnected node pairs when the network is sparse or critical paths are missing, and also making it difficult to capture long-range dependencies determined by the global structure. 2) Random walk-based graph embedding methods: These methods obtain low-dimensional vector representations of nodes through random walks and sequence learning, approximating closeness using vector similarity. This process compresses complex graph structure information, resulting in low fidelity of edge weight information; moreover, random walks are limited to existing edges, limiting their ability to uncover potential connections, and may also "smooth" original strong connections. 3) Graph neural network-based methods: Represented by graph convolutional networks and attention networks, these methods learn node representations by aggregating neighbor information through message passing. Its fundamental flaws are: First, the attention weights learned by the model serve the downstream task and are not universal true intimacy. Furthermore, it fails to distinguish and retain the high-confidence direct intimacy in the original image during the aggregation process, resulting in the dilution of the original accurate information. Second, this type of method is essentially a node representation learning model, which lacks a unified computational framework that organically integrates the strength of direct relationships and the strength of potential relationships.

[0004] The shortcomings of existing technologies can be summarized as follows: First, the computational paradigms are fragmented, either overemphasizing existing paths while ignoring potential connections, or sacrificing the fidelity of original weight information when learning potential connections, lacking an effective fusion solution. Second, the fidelity of original edge weight information is low, and the model optimization process easily smooths out weights with clear physical meaning, making it difficult to accurately reflect strong local connections. Third, they have poor adaptability to sparse and dynamic networks: in sparse networks, path methods fail, and GNN methods face the cold start problem due to insufficient information; in dynamic networks, most models require global retraining, resulting in high computational costs and response delays, making it difficult to meet real-time requirements.

[0005] Therefore, there is an urgent need for a new technology that can compute the proximity between nodes with high fidelity and high efficiency to overcome the above-mentioned shortcomings. Summary of the Invention

[0006] Based on this, it is necessary to address the aforementioned technical problems of fragmented computational paradigms, low fidelity of original edge weight information, and poor adaptability to sparse and dynamic networks by providing a method, system, electronic device, and storage medium for calculating inter-node weights in weighted undirected networks that can guarantee the authenticity and reliability of weight calculation, improve information fidelity, and quickly adapt to network changes, thus meeting the application requirements of real-time or near-real-time applications.

[0007] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: In a first aspect, the present invention provides a method for calculating the inter-node weights of a weighted undirected network, comprising: Obtain the original weighted undirected network graph data and perform preprocessing to obtain the first new graph; The first new graph is input into the pre-trained GAT model to obtain the second new graph. The edges in the second new graph include the original edges between each connected node in the first new graph, as well as the predicted edges between unconnected nodes. The second new graph is separated into a first subgraph containing only the original edges and a second subgraph containing only the predicted edges; based on the first subgraph, the weights of the predicted edges in the second subgraph are corrected using a multi-step random walk algorithm to obtain the corrected second subgraph; The first subgraph is integrated with the modified second subgraph to obtain the final weighted undirected network graph data.

[0008] Secondly, the present invention also provides a system for calculating the inter-node weights of a weighted undirected network, utilizing the inter-node weight calculation method for a weighted undirected network as described above, comprising: The data preprocessing module is used to acquire the original weighted undirected network graph data and preprocess it to obtain the first new graph; The edge prediction generation module is used to input the first new graph into the pre-trained GAT model to obtain a second new graph. The edges in the second new graph include the original edges between each interconnected node in the first new graph, as well as the predicted edges between unconnected nodes. The edge weight correction module is used to separate the second new graph into a first subgraph containing only the original edges and a second subgraph containing only the predicted edges; based on the first subgraph, the weights of the predicted edges in the second subgraph are corrected by a multi-step random walk algorithm to obtain the corrected second subgraph. The data integration module is used to integrate the first subgraph with the modified second subgraph to obtain the final weighted undirected network graph data.

[0009] Thirdly, the present invention also provides an electronic device, comprising: Memory is used to store executable instructions or computer programs. When a processor executes computer-executable instructions or computer programs stored in the memory, it implements a method for calculating the inter-node weights of a weighted undirected network as described above.

[0010] Fourthly, the present invention also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement a method for calculating the inter-node weights of a weighted undirected network as described above.

[0011] Compared with the prior art, the beneficial effects of the technical solution of the present invention are: This invention initially generates predicted edges using a GAT model, and then corrects the weights of the predicted edges based on the original graph topology through multi-step random walks. The random walk process is specifically performed on the pure original graph, completely avoiding interference from the predicted edges in the topology calculation, thereby ensuring the authenticity and reliability of the probability distribution and improving information fidelity. The multi-step random walk algorithm improves the robustness of this method in sparse and dynamic graphs, eliminating the need for global retraining like traditional GNNs. This incremental update mechanism allows the system to quickly adapt to network changes and meet the needs of real-time or near-real-time applications. Attached Figure Description

[0012] Figure 1 This is a flowchart illustrating a method for calculating the weights between nodes in a weighted undirected network, as described in some embodiments of this application. Figure 2 The diagram shows the process details of a weighted undirected network node weight calculation method in some embodiments of this application. Figure 3This is a flowchart illustrating a weight calculation system for nodes in a weighted undirected network, as described in some embodiments of this application. Detailed Implementation

[0013] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the description of embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of units is not necessarily limited to those units, but may include other units not explicitly listed or inherent to those processes, methods, products, or apparatuses. The term "determine" broadly covers a wide variety of actions, including acquiring, calculating, processing, deriving, investigating, searching (e.g., searching in a table, database, or other data structure), probing, and similar actions; it may also include receiving (e.g., receiving information), accessing (e.g., accessing data in memory), and similar actions; it may also include generating, creating, establishing, and similar actions; and parsing, selecting, choosing, and similar actions, etc. Definitions of other terms will be given in the following description.

[0014] It should be noted that when one element is considered to be "connected" to another element, it can be directly connected to the other element or connected to the other element through an intermediary element. Furthermore, in the following embodiments, "connection" should be understood as "electrical connection," "communication connection," etc., if there is transmission of electrical signals or data between the connected objects.

[0015] It should be emphasized that the acquisition, transmission, storage, use, and processing of data in the technical solutions of this application all comply with the relevant provisions of national laws and regulations.

[0016] In the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, they do not mean that the applicant has used or necessarily used the solution.

[0017] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the scope of this patent. To better illustrate this embodiment, some parts in the accompanying drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions; It will be understood by those skilled in the art that certain well-known structures and their descriptions may be omitted in the accompanying drawings.

[0018] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.

[0019] Example 1 This embodiment provides a method for calculating the weights between nodes in a weighted undirected network. (See attached document.) Figure 1 ,include: Obtain the original weighted undirected network graph data and perform preprocessing to obtain the first new graph; The first new graph is input into the pre-trained GAT model to obtain the second new graph. The edges in the second new graph include the original edges between each connected node in the first new graph, as well as the predicted edges between unconnected nodes. The second new graph is separated into a first subgraph containing only the original edges and a second subgraph containing only the predicted edges; based on the first subgraph, the weights of the predicted edges in the second subgraph are corrected using a multi-step random walk algorithm to obtain the corrected second subgraph; The first subgraph is integrated with the modified second subgraph to obtain the final weighted undirected network graph data.

[0020] Compared to existing technologies, this method initially generates predicted edges using a GAT model, and then corrects the weights of the predicted edges through multi-step random walks based on the original graph topology. The random walk process is specifically performed on the pure original graph, completely avoiding interference from the predicted edges in the topology calculation, thus ensuring the authenticity and reliability of the probability distribution and improving information fidelity. The multi-step random walk algorithm improves the robustness of this method in sparse and dynamic graphs, eliminating the need for global retraining like traditional GNNs. This incremental update mechanism allows the system to quickly adapt to network changes and meet the needs of real-time or near-real-time applications.

[0021] In some preferred embodiments, the original weighted undirected network graph data is obtained and preprocessed, see [reference]. Figure 2 Specifically, it includes: Extract the maximum connected subgraph from the original weighted undirected network graph data; Remap all node IDs of the maximum connected subgraph based on the number of nodes N in the maximum connected subgraph; Based on the mapping relationship between the number of nodes N in the maximum connected subgraph and all node IDs, the edge list in the original weighted undirected network graph data is rewritten to obtain the first new graph with all node IDs standardized. The mapping relationship is to map all node IDs of the largest connected subgraph to a set of consecutive integer indices from 0 to N-1.

[0022] In this embodiment, extracting the maximum connected subgraph is to ensure that there is at least one path between any two nodes in the graph, which is the basis for the effectiveness of subsequent algorithms.

[0023] In some preferred embodiments, a digital feature vector for each node is constructed using the local topology of each node in the first new graph, specifically including: For the Nodes By calculating its three scalar features and concatenating them, we obtain the first... Nodes The numerical feature vector of is represented as:

[0024]

[0025]

[0026] in, For nodes The digital feature vector; For nodes The degree of a node, representing its relation to the node. The number of directly connected edges; For nodes The weighted degree, representing the degree of the node. The sum of the weights of all directly connected edges; For nodes The set of indices of all neighboring nodes; For nodes Its neighboring nodes The weight of directly connected edges; This is the local clustering coefficient, used to measure the number of nodes. The degree of interconnectivity between neighboring nodes; For nodes The number of triangles formed by vertices; It is the set of all nodes.

[0027] In some preferred embodiments, the first new graph is input into a pre-trained GAT model, and the feature representations of nodes are updated layer by layer through message passing and attention mechanisms, thereby aggregating information from multi-hop neighborhoods. (See also...) Figure 2 Specifically, it includes: The GAT model contains an L-layer graph attention network; The first GAT model Layers, nodes Digital feature vectors Updated to The process is as follows: compute nodes Its neighboring nodes Attention coefficient between This coefficient represents the node Features for nodes The degree of importance is expressed as follows:

[0028] in, For the first The learnable linear transformation matrix of the layer, For a learnable single-layer feedforward neural network, This is represented as a vector concatenation operation; Use the SoftMax function to process nodes. The attention coefficients between the node and all its neighbors are normalized to obtain the attention score. It is represented as:

[0029] in, Represented as used for traversing nodes Index variables of all neighboring nodes; Based on attention score ,node Digital feature vectors With the Learnable linear transformation matrix of the layer Through nonlinear activation function , obtain node Digital vector features at the next layer It is represented as:

[0030] In this embodiment, the nonlinear activation function Specifically, the ReLU activation function; For the intermediate layers of the model, a multi-head attention mechanism is employed to enhance the model's stability and expressive power, and parallel computation is used. An independent attention representation And concatenate them as the digital feature vector of this layer for output; For the last layer of the model, parallel computation Each attention is represented independently, and their averages are calculated to obtain the node. The final digital feature vector; The above process is repeated L times to obtain the final feature representation matrix of all nodes. ; Among them, the final feature representation matrix Let be a column vector, and its first... The scalar of a row is a node. The final digital feature vector.

[0031] In some preferred embodiments, based on the final feature representation matrix Calculate the weights of the predicted edges between unconnected nodes, specifically including: For any pair of nodes that are not directly connected Based on its corresponding final digital feature vector, the weight of its predicted edge is calculated, which is expressed as:

[0032] in, For nodes and nodes Predict the weights of the edges; and These are nodes and nodes The final digital feature vector, It is an activation function used to map the output value to the interval [0, 1] so that it conforms to the definition of the weight.

[0033] In some preferred embodiments, the transition probability distribution between nodes in the first subgraph is calculated using a multi-step random walk algorithm, see reference. Figure 2 Specifically, it includes: For each starting node in the first subgraph G=(V,E,W) For any ∈V, perform N independent random walks, each walk consisting of L steps; Where G=(V,E,W) represents the first subgraph containing only the original edges; V is the set of nodes in the first subgraph; E is the set of edges in the first subgraph; and W is the set of edge weights in the first subgraph. In each step of a single walk, starting from the current node Transfer to neighboring nodes The probability of transition is proportional to the weight of the connecting edge, and its transition probability is expressed as:

[0034] in, The weight of the edge between nodes u and v; Represents a node The set of indices of all neighboring nodes; Represented as used for traversing nodes The index variables of all neighboring nodes; the denominator is the normalization of the weights of all outgoing edges to ensure that the sum of the transition probabilities is 1. After L steps of walking, record the termination node of each walk; For each target node The frequency of its use as a destination is statistically analyzed and expressed as follows:

[0035] in, This represents reaching the target node from the starting node s through L random walks. Approximate probability; The number of experiments; These are the particles used for random movement in the random walk method; Perform the above process on each node in the first subgraph as the starting node, and finally obtain a probability distribution matrix P of |V|×|V|.

[0036] In this embodiment, through a large number of repeated experiments ( The value is usually between 1000 and 5000, and the frequency value converges to the true transition probability.

[0037] In some preferred embodiments, the weights of the predicted edges in the second subgraph are corrected based on the probability distribution matrix P and the initial predicted edge weights output by the GAT model, specifically including: For each prediction edge that needs correction The weights are adjusted accordingly, as shown below:

[0038] in, The weights of the predicted edges after correction; and They are respectively represented as slave nodes To the node and nodes To the node The transition probability; It is the fusion coefficient, used to adjust the relative importance of the two information sources.

[0039] First, using the average of two-way probabilities is to reflect the symmetry of undirected graphs and avoid bias caused by directionality. Second, the fusion coefficient... A flexible adjustment mechanism is provided: when When the value is close to 1, the correction result mainly relies on the prediction of the GAT model, which is suitable for scenarios with high model confidence; when... When the value is close to 0, the correction result is mainly based on topological information, which is suitable for scenarios where model prediction is uncertain or strong structural consistency is required.

[0040] In the specific implementation process, the DBLP Collaboration Network (Academic Collaboration Network) was tested using this method, including: authors who publish articles in a certain journal or conference constitute a community, nodes represent authors, and edges represent connections between authors, wherein the connections are determined by the relevance of the papers published by the authors and the number of papers on related topics; when a target author is input, the predicted edge weights between the target author and other authors who are not directly connected are calculated according to this method, and the most likely future collaborators are recommended to the researcher; This method was tested on the Amazon network (an e-commerce network), where nodes represent products and edges connect commonly purchased products. When a product is input, this method calculates the predicted edge weights between that product and other products. It not only captures shared purchases of "similar goods" (such as phone cases from different brands) but also reveals strong associations between "complementary goods" (such as phones and screen protectors, coffee makers and coffee beans). These associations across clearly defined categories are difficult to discover using simple common neighbor methods. Predicting the closeness between products using this method can be used to recommend such products to users, increasing purchase rates.

[0041] Example 2 This embodiment further provides a system for calculating the inter-node weights of a weighted undirected network based on Embodiment 1. It utilizes the inter-node weight calculation method for a weighted undirected network described above. (See reference...) Figure 3 ,include: The data preprocessing module is used to acquire the original weighted undirected network graph data and preprocess it to obtain the first new graph; The edge prediction generation module is used to input the first new graph into the pre-trained GAT model to obtain a second new graph. The edges in the second new graph include the original edges between each interconnected node in the first new graph, as well as the predicted edges between unconnected nodes. The edge weight correction module is used to separate the second new graph into a first subgraph containing only the original edges and a second subgraph containing only the predicted edges; based on the first subgraph, the weights of the predicted edges in the second subgraph are corrected by a multi-step random walk algorithm to obtain the corrected second subgraph. The data integration module is used to integrate the first subgraph with the modified second subgraph to obtain the final weighted undirected network graph data.

[0042] The system's edge prediction generation module first generates preliminary predicted edges using the GAT model; then, the edge weight correction module uses a multi-step random walk algorithm to calibrate these predicted edges based on the original graph's topology. This collaborative mechanism allows the system to both uncover potential connections and maintain a high degree of consistency with the original graph structure. The multi-step random walk process is performed specifically on the clean original graph, completely avoiding interference from predicted edges in the topology calculation, thus ensuring the authenticity and reliability of the probability distribution.

[0043] In the random walk phase, the edge weight correction module of this system calculates transition probabilities entirely based on the original edge weights, ensuring the accurate transmission of topological information. In the weight correction phase, a linear weighted fusion formula is used to explicitly preserve the contribution ratio of the GAT-predicted edge weights and topological probabilities. This design ensures that the final result incorporates the predictive wisdom of the machine learning model while maintaining the accuracy of the original weight values, making it particularly suitable for applications with extremely high precision requirements, such as financial risk control and biological network analysis.

[0044] The multi-step nature of random walks allows the system to infer broader node relationships from a limited set of connections. Even when there are no direct paths between some nodes, meaningful transition probabilities can still be calculated through the bridging effect of intermediate nodes. When local changes occur in the network, the system only needs to recalculate the random walk for the nodes in the affected area and then make stronger corrections to the original predictions, without requiring global retraining as in traditional GNNs. This incremental update mechanism enables the system to quickly adapt to network changes and meet the needs of real-time or near-real-time applications.

[0045] It is understood that the system in this embodiment corresponds to the method in Embodiment 1 above, and the options in Embodiment 1 above are also applicable to this embodiment, so they will not be described again here.

[0046] Example 3 This embodiment provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set. The at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor, causing the processor to perform some or all of the steps of the method provided in Embodiment 1 of this application.

[0047] It is understood that the storage medium can be transient or non-transient. Exemplarily, the storage medium includes, but is not limited to, various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0048] By way of example, the processor may be a central processing unit (CPU), a microprocessor unit (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.

[0049] By way of example, the read-only memory includes, but is not limited to, MASK ROM, PROM, EPROM, EEPROM, Flash, etc.

[0050] By way of example, the random access memory includes, but is not limited to, DRAM, SRAM, SDRAM, DDR SDRAM, etc.

[0051] In some examples, a computer program product is provided, which can be implemented by hardware, software, or a combination thereof. As a non-limiting example, the computer program product can be embodied in the storage medium, or it can be embodied in a software product, such as an SDK (Software Development Kit).

[0052] As a non-limiting example, a computer program product is provided, comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer program or computer-executable instructions from the computer-readable storage medium, and executes the computer-executable instructions, causing the electronic device to perform some or all of the steps of the method described in the embodiments of this application.

[0053] In some examples, a computer program is provided, including computer-readable code, wherein, when the computer-readable code is run in a computer device, a processor in the computer device performs some or all of the steps for implementing the method.

[0054] This embodiment also proposes an electronic device, including a memory and a processor. The memory stores at least one instruction, at least one program, code set, or instruction set. When the processor executes the at least one instruction, at least one program, code set, or instruction set, it implements some or all of the steps of the method described in Embodiment 1.

[0055] In some examples, a hardware entity of the electronic device is provided, including: a processor, a memory, and a communication interface; wherein the processor typically controls the overall operation of the electronic device; the communication interface is used to enable the electronic device to communicate with other terminals or servers via a network; the memory is configured to store instructions and applications executable by the processor, and may also cache data to be processed or already processed (including but not limited to image data, audio data, voice communication data, and video communication data) to be processed by the processor and various modules in the electronic device, and may be implemented using flash memory (FLASH), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or random access memory (RAM).

[0056] A processor may include one or more processing elements. Therefore, a processor may include one or more integrated circuits (ICs) configured to perform the functions of the processor. Furthermore, each integrated circuit may include circuitry (e.g., a first circuit, a second circuit, and other circuitry) configured to perform the functions of the processor.

[0057] Furthermore, data can be transferred between the processor, communication interface, and memory via a bus, which can include any number of interconnected buses and bridges, connecting various circuits of one or more processors and memories together.

[0058] It is understood that the options in Embodiment 1 above also apply to this embodiment, so they will not be described again here.

[0059] The same or similar labels correspond to the same or similar parts; The terms used to describe positional relationships in the accompanying drawings are for illustrative purposes only and should not be construed as limiting this application. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.

[0060] In different specific implementations, the methods or systems described in this application can be implemented in software, hardware, or a combination thereof. Furthermore, the order of the method steps can be changed, and various elements can be added, reordered, combined, omitted, or modified.

[0061] Obviously, the above embodiments of this application are merely examples for clearly illustrating this application, and are not intended to limit the implementation of this application, nor are they intended to limit this application. For those skilled in the art, other variations or modifications can be made based on the above description. The separate structural / functional modules or units can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part. The structure and function of the separate components can be implemented as a combined structure or component. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of the claims of this application.

Claims

1. A method for calculating the weights between nodes in a weighted undirected network, characterized in that, include: Obtain the original weighted undirected network graph data and perform preprocessing to obtain the first new graph; The first new graph is input into the pre-trained GAT model to obtain the second new graph. The edges in the second new graph include the original edges between each connected node in the first new graph, as well as the predicted edges between unconnected nodes. The second new graph is separated into a first subgraph containing only the original edges and a second subgraph containing only the predicted edges; based on the first subgraph, the weights of the predicted edges in the second subgraph are corrected using a multi-step random walk algorithm to obtain the corrected second subgraph; The first subgraph is integrated with the modified second subgraph to obtain the final weighted undirected network graph data.

2. The method for calculating the inter-node weights in a weighted undirected network according to claim 1, characterized in that, Obtain the raw weighted undirected network graph data and perform preprocessing, specifically including: Extract the maximum connected subgraph from the original weighted undirected network graph data; Remap all node IDs of the maximum connected subgraph based on the number of nodes N in the maximum connected subgraph; Based on the mapping relationship between the number of nodes N in the maximum connected subgraph and all node IDs, the edge list in the original weighted undirected network graph data is rewritten to obtain the first new graph with all node IDs standardized. The mapping relationship is to map all node IDs of the largest connected subgraph to a set of consecutive integer indices from 0 to N-1.

3. The method for calculating the inter-node weights in a weighted undirected network according to claim 2, characterized in that, Using the local topology of each node in the first new graph, a digital feature vector for each node is constructed, specifically including: For the Nodes By calculating its three scalar features and concatenating them, we obtain the first... Nodes The numerical feature vector of is represented as: in, For nodes The digital feature vector; For nodes The degree of the node; For nodes The weighted degree; For nodes The set of indices of all neighboring nodes; For nodes Its neighboring nodes The weight of directly connected edges; This is the local clustering coefficient; For nodes The number of triangles formed by vertices; It is the set of all nodes.

4. The method for calculating the inter-node weights in a weighted undirected network according to claim 3, characterized in that, The first new image is input into the pre-trained GAT model, and the feature representations of the nodes are updated layer by layer through message passing and attention mechanisms, specifically including: The GAT model contains an L-layer graph attention network; The first GAT model Layers, nodes Digital feature vectors Updated to The process is as follows: compute nodes Its neighboring nodes Attention coefficient between It is represented as: in, For the first The learnable linear transformation matrix of the layer, For a learnable single-layer feedforward neural network, This is represented as a vector concatenation operation; Use the SoftMax function to process nodes. The attention coefficients between the node and all its neighbors are normalized to obtain the attention score. It is represented as: in, Represented as used for traversing nodes Index variables of all neighboring nodes; Based on attention score ,node Digital feature vectors With the Learnable linear transformation matrix of the layer Through nonlinear activation function , obtain node Digital vector features at the next layer It is represented as: For the intermediate layers of the model, parallel computing An independent attention representation And concatenate them as the digital feature vector of this layer for output; For the last layer of the model, parallel computation Each attention is represented independently, and their averages are calculated to obtain the node. The final digital feature vector; The above process is repeated L times to obtain the final feature representation matrix of all nodes. ; Among them, the final feature representation matrix Let be a column vector, and its first... The scalar of a row is a node. The final digital feature vector.

5. The method for calculating the inter-node weights in a weighted undirected network according to claim 4, characterized in that, Based on the final feature representation matrix Calculate the weights of the predicted edges between unconnected nodes, specifically including: For any pair of nodes that are not directly connected Based on its corresponding final digital feature vector, the weight of its predicted edge is calculated, which is expressed as: in, For nodes and nodes Predict the weights of the edges; and These are nodes and nodes The final digital feature vector, It is an activation function.

6. The method for calculating the inter-node weights in a weighted undirected network according to claim 5, characterized in that, The transition probability distribution between nodes in the first subgraph is calculated using a multi-step random walk algorithm, specifically including: For each starting node in the first subgraph G=(V,E,W) For any ∈V, perform N independent random walks, each walk consisting of L steps; Where G=(V,E,W) represents the first subgraph containing only the original edges; V is the set of nodes in the first subgraph; E is the set of edges in the first subgraph; and W is the set of edge weights in the first subgraph. In each step of a single walk, starting from the current node Transfer to neighboring nodes The probability of transition is proportional to the weight of the connecting edge, and its transition probability is expressed as: in, The weight of the edge between nodes u and v; Represents a node The set of indices of all neighboring nodes; Represented as used for traversing nodes Index variables of all neighboring nodes; After L steps of walking, record the termination node of each walk; For each target node The frequency of its use as a destination is statistically analyzed and expressed as follows: in, This represents reaching the target node from the starting node s through L random walks. Approximate probability; The number of experiments; These are the particles used for random movement in the random walk method; Perform the above process on each node in the first subgraph as the starting node, and finally obtain a probability distribution matrix P of |V|×|V|.

7. The method for calculating the inter-node weights in a weighted undirected network according to claim 6, characterized in that, Based on the probability distribution matrix P and the initial predicted edge weights output by the GAT model, the weights of the predicted edges in the second subgraph are corrected, specifically including: For each prediction edge that needs correction The weights are adjusted accordingly, as shown below: in, The weights of the predicted edges after correction; and They are respectively represented as slave nodes To the node and nodes To the node The transition probability; It is the fusion coefficient.

8. A system for calculating the inter-node weights of a weighted undirected network, utilizing the method for calculating the inter-node weights of a weighted undirected network as described in any one of claims 1-7, characterized in that, include: The data preprocessing module is used to acquire the original weighted undirected network graph data and preprocess it to obtain the first new graph; The edge prediction generation module is used to input the first new graph into the pre-trained GAT model to obtain a second new graph. The edges in the second new graph include the original edges between each interconnected node in the first new graph, as well as the predicted edges between unconnected nodes. The edge weight correction module is used to separate the second new graph into a first subgraph containing only the original edges and a second subgraph containing only the predicted edges; based on the first subgraph, the weights of the predicted edges in the second subgraph are corrected by a multi-step random walk algorithm to obtain the corrected second subgraph. The data integration module is used to integrate the first subgraph with the modified second subgraph to obtain the final weighted undirected network graph data.

9. An electronic device, characterized in that, include: Memory is used to store executable instructions or computer programs. A processor, configured to execute computer-executable instructions or computer programs stored in the memory, implements the method of any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the method as described in any one of claims 1-7.