Node representation learning and community division method based on multi-order neighbor information fusion

The node representation learning method through multi-order neighbor information fusion, combined with spectral clustering, solves the problem of information loss and ignoring neighborhood information in node representation learning, achieves efficient and accurate community division, and improves the performance and performance of graph neural networks. Scalability.

CN118568534APending Publication Date: 2024-08-30HUBEI UNIV OF CHINESE MEDICINE
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410731613.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

The existing technology is prone to excessive smoothing during the node representation learning process, resulting in information loss or blurring, and ignores neighborhood node information in high-dimensional sparse feature networks, resulting in poor community division results.

Method used

Adopting a node representation learning method based on multi-order neighbor information fusion, by constructing an undirected graph, node representation learning model, similarity matrix and Laplacian matrix, combined with the spectral clustering method, multi-order neighbor information is integrated to generate a high-quality node representation. , and perform community division through cluster analysis.

Benefits of technology

It improves the accuracy and efficiency of community division, makes full use of node characteristics and network structure information, reduces computational complexity, and improves the computational efficiency and generalization ability of graph neural networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568534A
    Figure CN118568534A
Patent Text Reader

Abstract

The invention proposes a node representation learning and community division method based on multi-order neighbor information fusion, and the method comprises the following steps: constructing an undirected graph which comprises a node set and an edge set, and constructing a node feature matrix according to the connection relation between nodes in the node set; a node representation learning model is constructed, the node representation learning model comprises a neighbor sampling function and a mean aggregation function, the neighbor sampling function is used for sampling multi-order neighbor nodes, and the mean aggregation function is used for aggregating neighbor node information of the multi-order neighbor nodes and iteratively updating node embedding vectors; a final node embedding vector is obtained, and the initial input of the final node embedding vector is a node feature matrix; constructing similar matrixes according to the final node embedding vector, and screening the similar matrixes based on a preset constraint condition to obtain a final similar matrix; constructing a degree matrix based on the final similar matrix and the mapping conversion relationship, constructing an initial Laplacian matrix through the final similar matrix and the degree matrix, and performing normalization processing on the initial Laplacian matrix to obtain a Laplacian matrix; calculating a feature value set of the Laplacian matrix, constructing a feature vector corresponding to each feature value in the feature value set, and constructing a community classification feature matrix through the feature vectors; and performing clustering analysis on the community classification feature matrix to obtain a community division result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data mining and classification, and in particular to a node representation learning and community division method based on multi-order neighbor information fusion. Background Art

[0002] As one of the graph clustering problems, community structure mines the potential information between graphs by identifying tightly connected node clusters. Node clusters within the same community are tightly connected by edges, while nodes between communities are sparsely connected by edges. Currently, researchers have developed a variety of algorithms to explore community structures, such as Infomap, Louvain algorithm, and algorithms based on graph representation. Among them, algorithms based on graph representation can divide community structures by discovering more information hidden in nodes and edges.

[0003] However, the existing technology still has some shortcomings. In the process of learning node representation, the propagation of information may cause the generated node representation to fall into over-smoothing, resulting in information loss or blurring. At the same time, for network structures with high-dimensional sparse features, the existing algorithms have the problem of ignoring the information of neighboring nodes, resulting in poor performance of the learning representation results.

[0004] The Chinese patent with the announcement number 106570082B discloses a friend relationship mining method that combines network topology features and user behavior features, and divides the undirected graph into communities by using a community detection algorithm based on weighted modularity. However, this method does not pay attention to the neighborhood node information and cannot solve the problem of information loss in node representation learning. Summary of the invention

[0005] In view of this, the present invention proposes a node representation learning and community division method based on multi-order neighbor information fusion. The node information is deeply mined through a multi-order neighbor sampling strategy, and then richer neighbor information is aggregated to generate a low-dimensional node representation. Finally, the similarity measurement performance between any two node representations is improved, and the clustering method is further used to divide the communities in the complex network.

[0006] The technical solution of the present invention is implemented as follows: The present invention provides a node representation learning and community division method based on multi-order neighbor information fusion, comprising the following steps:

[0007] S1, constructing an undirected graph, the undirected graph comprising a node set and an edge set, and constructing a node feature matrix according to the connection relationship between the nodes in the node set;

[0008] S2, constructing a node representation learning model, wherein the node representation learning model includes a neighbor sampling function and a mean aggregation function, wherein the neighbor sampling function is used to sample multi-order neighbor nodes, and the mean aggregation function is used to aggregate neighbor node information of multi-order neighbor nodes, and iteratively update the node embedding vector to obtain the final node embedding vector, wherein the initial input of the final node embedding vector is the node feature matrix;

[0009] S3, constructing a similarity matrix according to the final embedding vector of the node, and screening the similarity matrix based on preset constraints to obtain a final similarity matrix;

[0010] S4, constructing a degree matrix based on the final similarity matrix and the mapping transformation relationship, constructing an initial Laplace matrix through the final similarity matrix and the degree matrix, normalizing the initial Laplace matrix, and obtaining a Laplace matrix;

[0011] S5, calculating the eigenvalue set of the Laplace matrix, constructing an eigenvector corresponding to each eigenvalue in the eigenvalue set, and constructing a community classification feature matrix through the eigenvectors;

[0012] S6, cluster analysis is performed on the community classification feature matrix to obtain the community division results.

[0013] Preferably, step S1 comprises:

[0014] Construct an undirected graph G = (V, E), where V is a node set and E is an edge set, and construct a node feature matrix for each node in the node set. The node features of the node feature matrix are other nodes connected to the node by edges. The value of edge connection is 1, and the value of no edge connection is 0.

[0015] Preferably, step S2 comprises:

[0016] The node representation learning model is a GraphSAGE model, and the steps of constructing the node representation learning model include: setting a neighbor sampling function to sample multi-order neighbor nodes of each node; setting an aggregation function to aggregate the information of the sampled multi-order neighbor nodes; iteratively updating the node embedding vector until a preset number of iterations is reached to obtain the final node embedding vector, and the initial input of the node embedding vector is the node feature matrix.

[0017] Preferably, the neighbor sampling function is:

[0018] N(v) = random.choice(v nei_table ,size)

[0019] Among them, v nei_tableis the neighbor node mapping table of node v, which stores the node and its corresponding neighbor nodes with edge relationships. size is the number of nodes sampled at each order, and N(v) is the neighbor node set of each order of node v.

[0020] Preferably, the mean aggregation function is:

[0021]

[0022] in, is the node embedding vector of node v’s neighbor node information aggregation from the first to Nth order, is the current embedding of node v, p is the class of the neighboring node, P is the number of network grids.

[0023] Preferably, the final embedding vector of the node is:

[0024]

[0025] Among them, W p is the weight matrix, σ is the activation function of LeakyReLU, CONCAT is the concatenation function, The final embedding vector for the node.

[0026] Preferably, step S3 comprises:

[0027] The similarity matrix is:

[0028]

[0029] Among them, s ij is the similarity matrix, e i For node v i The final node embedding vector, e j For node v j The final embedding vector of the node, ξ is the bandwidth coefficient of the Gaussian kernel function, d 2 (e i ,e j ) is e i and e j The Euclidean distance of

[0030] The preset constraints are:

[0031] S={s ij |1≤i≤n,1≤j≤n}

[0032] Among them, n represents the number of nodes and S is the final similarity matrix.

[0033] Preferably, step S4 comprises:

[0034] The diagonal values ​​of the final similarity matrix are assigned to 0, S(i,i)=0, and the mapping conversion relationship is:

[0035] D=s1,…,s i ,…,s n

[0036]

[0037] Where D is the degree matrix, s i For node v i The sum of similarities of connected nodes;

[0038] The initial Laplace matrix L = DS is constructed by the final similarity matrix and the degree matrix, and the initial Laplace matrix is ​​normalized to obtain the Laplace matrix L' = D -1 / 2 LD -1 / 2 .

[0039] Preferably, step S5 comprises:

[0040] Find the smallest k eigenvalues ​​of L' and the eigenvectors corresponding to the eigenvalues. The characteristic expressions of the eigenvectors and L' are:

[0041]

[0042] f a is the eigenvector corresponding to the ath eigenvalue, f b is the eigenvector corresponding to the bth eigenvalue,

[0043] Construct the community classification feature matrix through the feature vector:

[0044] F=[f1,f2,…,f k ]

[0045] Among them, F is the community classification feature matrix, f k is the eigenvector corresponding to the kth eigenvalue.

[0046] Preferably, step S6 comprises:

[0047] Perform cluster analysis on the community classification feature matrix, set the number of clusters to t, use the K-means algorithm to cluster the feature matrix F, and get the clustering result C = {C1, C2, ..., C t}, cluster C t is the tth community, and the clustering result is used as the community division result corresponding to the node set.

[0048] The node representation learning and community division method based on multi-order neighbor information fusion of the present invention has the following beneficial effects compared with the prior art:

[0049] (1) By comprehensively considering node characteristics, network topology, node representation learning and community division, the accuracy and efficiency of community division are improved. In the node representation learning stage, a more comprehensive and accurate node representation is learned by integrating multi-order neighbor information, which provides high-quality input for subsequent community division. In the community division stage, the spectral clustering method is used to efficiently discover the community structure of the network through feature decomposition and cluster analysis. The organic combination of the two stages makes full use of node characteristics and network structure information, and improves the overall performance of community division.

[0050] (2) By randomly selecting a subset of neighbor nodes of a node, the computational complexity is reduced while retaining neighbor information, enabling the graph neural network to efficiently process large-scale graph data and capture the local structure and dependency relationships between nodes, thereby improving the computational efficiency and scalability of the graph neural network and providing suitable input data for the training and prediction of the graph neural network.

[0051] (3) The node’s neighbor node information is aggregated through the mean aggregation function to generate a new embedding representation of the node, so that the node’s embedding vector can integrate the feature information of the neighbor nodes, improving the graph neural network’s ability to express node features and realizing the transmission and aggregation of node features. This enables the graph neural network to effectively capture the dependencies and structural information between nodes, thereby improving the performance and generalization ability of the graph neural network. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0053] Figure 1 This is a flow chart of the node representation learning and community partitioning method based on multi-order neighbor information fusion of the present invention. DETAILED DESCRIPTION

[0054] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] Embodiment 1

[0056] It provides a node representation learning and community division method based on multi-order neighbor information fusion, such as Figure 1 As shown, the following steps are included:

[0057] S1, constructing an undirected graph, the undirected graph comprising a node set and an edge set, and constructing a node feature matrix according to the connection relationship between the nodes in the node set;

[0058] S2, constructing a node representation learning model, wherein the node representation learning model includes a neighbor sampling function and a mean aggregation function, wherein the neighbor sampling function is used to sample multi-order neighbor nodes, and the mean aggregation function is used to aggregate neighbor node information of multi-order neighbor nodes, and iteratively update the node embedding vector to obtain the final node embedding vector, wherein the initial input of the final node embedding vector is the node feature matrix;

[0059] S3, constructing a similarity matrix according to the final embedding vector of the node, and screening the similarity matrix based on preset constraints to obtain a final similarity matrix;

[0060] S4, constructing a degree matrix based on the final similarity matrix and the mapping transformation relationship, constructing an initial Laplace matrix through the final similarity matrix and the degree matrix, normalizing the initial Laplace matrix, and obtaining a Laplace matrix;

[0061] S5, calculating the eigenvalue set of the Laplace matrix, constructing an eigenvector corresponding to each eigenvalue in the eigenvalue set, and constructing a community classification feature matrix through the eigenvectors;

[0062] S6, cluster analysis is performed on the community classification feature matrix to obtain the community division results.

[0063] It should be noted that:

[0064] Community structure is one of the important features of graphs. It mines the potential information between graphs by identifying densely connected node clusters. Node clusters within the same community are densely connected by edges, while nodes between communities are sparsely connected by edges. Researchers have developed many algorithms to explore community structures, such as Infomap, Louvain algorithm, and algorithms based on graph representation. Among them, graph representation technology can be used to discover more information hidden in nodes and edges to divide community structures. However, in the process of learning node representation, the propagation of information may cause the generated node representation to easily fall into over-smoothing, resulting in information loss or fuzziness. At the same time, for network structures with high-dimensional sparse features, existing algorithms have the problem of ignoring neighborhood node information, resulting in poor performance of learning representation results.

[0065] In a social network, users usually form different groups or communities with similar interests, attributes or interaction patterns. Using the method of this embodiment, user groups in a social network can be automatically discovered. By analyzing the characteristics and evolution laws of user groups, the structure and dynamics of the social network can be deeply understood, providing a basis for the management, optimization and personalized services of the social network. For example, user classification, community recommendation, social influence analysis, etc. can be performed based on group information.

[0066] In the industrial chain and supply chain network, enterprises form a complex business relationship network through raw material supply, product sales, etc. Using the method of this embodiment, enterprise communities in the industrial chain and supply chain network can be discovered. By analyzing the roles, cooperative relationships, and risk propagation pathways of enterprise communities, the structure and operational efficiency of the supply chain can be optimized, and the stability and competitiveness of the industrial chain can be improved. For example, supplier evaluation, risk warning, and supply chain reconstruction can be performed based on community information.

[0067] Traditional node representation learning methods usually only consider the direct neighbor information of the node, ignoring higher-order neighbor relationships. However, this embodiment can effectively capture the multi-order neighbor information of the node by introducing the neighbor sampling function and the mean aggregation function. The neighbor sampling function samples the multi-order neighbors according to the similarity or importance between the nodes, and selects the most relevant or representative neighbor nodes. The mean aggregation function aggregates the feature information of the sampled multi-order neighbor nodes to generate a comprehensive representation of the node. By iteratively updating the node embedding vector, the node's own characteristics and multi-order neighbor information are fully integrated, and a more comprehensive and accurate node representation is learned, thereby improving the quality of node representation learning.

[0068] After obtaining high-quality node representation, this embodiment can effectively discover the community structure in the network by constructing a similarity matrix and a Laplace matrix, combined with a spectral clustering method. The similarity matrix measures the similarity between nodes and is calculated by the similarity of the node embedding vectors. The Laplace matrix reflects the topological structure of the network and the connection relationship between the nodes. By performing eigendecomposition on the Laplace matrix, the community classification feature matrix is ​​obtained, and then cluster analysis is performed to finally obtain the community division result of the network. This method makes full use of the node embedding vector obtained by node representation learning, combined with the network topology information, to achieve accurate community division.

[0069] This embodiment comprehensively considers the node characteristics and network topology, and improves the accuracy and efficiency of community division through the organic combination of node representation learning and community division. The node representation learning stage learns a more comprehensive and accurate node representation by integrating multi-order neighbor information, providing high-quality input for subsequent community division. The community division stage uses the spectral clustering method to efficiently discover the community structure of the network through feature decomposition and cluster analysis. The organic combination of the two stages makes full use of node characteristics and network structure information, and improves the overall performance of community division.

[0070] Both the node representation learning and community partitioning stages can be applied to complex networks of various types and sizes. The neighbor sampling function and mean aggregation function can be flexibly adjusted according to the characteristics of the network to adapt to different network structures. The spectral clustering method is based on matrix decomposition and clustering analysis, and has good adaptability to network scale. In addition, the method is highly robust to changes in network structure. Even if the network undergoes local topological changes or node attribute changes, stable and accurate community partitioning results can still be obtained by relearning node representations and updating similarity matrices.

[0071] Step S1 includes:

[0072] Construct an undirected graph G = (V, E), where V is a node set and E is an edge set, and construct a node feature matrix for each node in the node set. The node features of the node feature matrix are other nodes connected to the node by edges. The value of edge connection is 1, and the value of no edge connection is 0.

[0073] It should be noted that:

[0074] The original data is abstracted into an undirected graph G, where V represents the node set and E represents the edge set.

[0075] Undirected graphs can represent the connection relationship between nodes and reflect the structural information of data.

[0076] By constructing an undirected graph, unstructured raw data can be converted into a graph structure, making it easier for graph neural networks to process and analyze the data.

[0077] Construct a node feature matrix for each node in the node set V.

[0078] The node feature matrix represents the connection relationship between each node and other nodes, that is, the node's neighbor information.

[0079] If node i is connected to node j by an edge, the position of node j in the feature matrix of node i is taken as 1; if there is no edge connection, the value is 0.

[0080] The node feature matrix provides the local structural information of the node and reflects the relationship between the node and its neighboring nodes.

[0081] Step S2 includes:

[0082] The node representation learning model is a GraphSAGE model, and the steps of constructing the node representation learning model include: setting a neighbor sampling function to sample multi-order neighbor nodes of each node; setting an aggregation function to aggregate the information of the sampled multi-order neighbor nodes; iteratively updating the node embedding vector until a preset number of iterations is reached to obtain the final node embedding vector, and the initial input of the node embedding vector is the node feature matrix.

[0083] It should be noted that:

[0084] By constructing an undirected graph and a node feature matrix, the original data is converted into a graph structure and node feature representation, making it suitable for the input format of the graph neural network.

[0085] Graph neural networks can use graph structure and node feature information to learn node representations and perform downstream tasks such as node classification and link prediction.

[0086] Undirected graphs and node feature matrices provide rich structural information, enabling graph neural networks to capture the relationships and dependencies between nodes, thereby improving the performance and generalization ability of the model.

[0087] Step S1 converts the original data into a format that can be directly processed by the graph neural network, providing a suitable input representation for subsequent model training and prediction.

[0088] The neighbor sampling function is:

[0089] N(v) = random.choice(v nei_table ,size)

[0090] Among them, v nei_table is the neighbor node mapping table of node v, which stores the node and its corresponding neighbor nodes with edge relationships. size is the number of nodes sampled at each order, and N(v) is the neighbor node set of each order of node v.

[0091] It should be noted that:

[0092] The neighbor node mapping table is a data structure used to store each node and its corresponding neighbor nodes.

[0093] For node v, v nei_table All neighbor nodes that have edge relationships with v are stored.

[0094] The neighbor node mapping table provides the ability to quickly access and find node neighbors, avoiding the computational complexity of repeatedly calculating neighbor nodes in large-scale graphs.

[0095] The neighbor sampling function N(v) uses the random.choice function to map the neighbor nodes of node v to the node v. nei_table Randomly select size nodes from .

[0096] The random selection process is without replacement, that is, the probability of each neighbor node being selected is equal.

[0097] By randomly selecting neighbor nodes, the computational complexity can be reduced while retaining the node's neighbor information.

[0098] The neighbor sampling function N(v) randomly selects a subset of the neighbor nodes of node v as the neighbor node set of v.

[0099] The process of randomly selecting neighbor nodes can significantly reduce the amount of computation, especially when processing large-scale graph data.

[0100] By controlling the size parameter, the number of nodes sampled at each level can be flexibly adjusted to balance the computational efficiency and the degree of retention of neighbor information.

[0101] The output N(v) of the neighbor sampling function is the set of neighbor nodes of each order of node v, which can be used as the input of the graph neural network to aggregate the feature information of the neighbor nodes.

[0102] Through neighbor sampling, graph neural networks can perform feature aggregation and information transfer within the local neighborhood of each node, capturing the local structure and dependencies between nodes.

[0103] The neighbor sampling function randomly selects a subset of neighbor nodes of node v, while retaining neighbor information and reducing computational complexity. This sampling strategy enables graph neural networks to efficiently process large-scale graph data and capture local structures and dependencies between nodes. The beneficial effect of the neighbor sampling function is to improve the computational efficiency and scalability of graph neural networks, while also providing suitable input data for the training and prediction of graph neural networks.

[0104] The mean aggregation function is:

[0105]

[0106] in, is the node embedding vector of node v’s neighbor node information aggregation from the first to Nth order, is the current embedding of node v, p is the class of the neighboring node, P is the number of network grids.

[0107] It should be noted that:

[0108] The mean aggregation function takes the embedding representations of the first-order to N-order neighbor nodes of node v as input and performs an aggregation operation on them.

[0109] The aggregation operation uses the mean function, which averages the embedding vectors of neighboring nodes.

[0110] Through mean aggregation, the feature information of neighbor nodes can be effectively summarized to obtain a comprehensive representation.

[0111] The output of the mean aggregation function represents the new embedding vector of node v after aggregating the information of its first-order to N-order neighbor nodes.

[0112] This new embedding vector incorporates the feature information of node v itself, that is, the current embedding And the characteristic information of neighboring nodes.

[0113] Through the mean aggregation function, the embedding representation of node v is updated and optimized, which can better capture the role and semantic information of node v in the graph structure.

[0114] The beneficial effect of the mean aggregation function is that it realizes the transfer and aggregation of node features, so that the embedding representation of node v can integrate the information of neighboring nodes.

[0115] Through mean aggregation, graph neural networks can perform feature transfer and information interaction within the neighborhood of a node, capturing dependencies and structural information between nodes.

[0116] The output of the mean aggregation function serves as the new embedding representation of node v, which can be used for calculation and update of subsequent graph neural network layers.

[0117] By applying the mean aggregation function layer by layer, the graph neural network can gradually aggregate and transfer node features to achieve modeling and learning of the graph structure.

[0118] The beneficial effect of the mean aggregation function is that it improves the ability of graph neural networks to express node features, enabling them to effectively capture the relationships and structural information between nodes.

[0119] The mean aggregation function generates a new embedding representation of node v by aggregating the neighbor node information of node v. This aggregation operation enables the embedding vector of node v to integrate the feature information of neighbor nodes, improving the ability of the graph neural network to express node features. The beneficial effect of the mean aggregation function is that it realizes the transmission and aggregation of node features, enabling the graph neural network to effectively capture the dependencies and structural information between nodes, thereby improving the performance and generalization ability of the graph neural network.

[0120] The final embedding vector of the node is:

[0121]

[0122] Among them, W p is the weight matrix, σ is the activation function of LeakyReLU, CONCAT is the concatenation function, The final embedding vector for the node.

[0123] It should be noted that:

[0124] The final embedding vector of the node is the concatenation function CONCAT which combines the current embedding of node v and Stitched together.

[0125] The concatenation operation connects two vectors along a specified dimension to form a higher-dimensional vector.

[0126] Through concatenation, the final node embedding vector contains the feature information of node v itself and the aggregated information of neighboring nodes, providing a more comprehensive node representation.

[0127] The concatenated vector is dot-producted with the weight matrix to achieve feature conversion and dimension adjustment.

[0128] The weight matrix is ​​a learnable parameter matrix used to map the concatenated vectors to the new feature space.

[0129] Through the transformation of the weight matrix, the final embedding vector of the node can learn a more abstract and advanced feature representation.

[0130] The result of the dot product operation is transformed nonlinearly through the sigmoid activation function to introduce nonlinear characteristics.

[0131] The LeakyReLU activation function is used here, which introduces a small negative slope in the negative part to avoid the "dead ReLU" problem.

[0132] The role of the sigmoid activation function is to increase the expressive power of the model, enabling it to learn more complex feature relationships.

[0133] The beneficial effect of the node final embedding vector is to fuse the current embedding of node v with the aggregated information of neighboring nodes to generate the final embedding representation of node v at the pth order.

[0134] Through the concatenation operation, the final embedding vector of the node combines the node’s own features and the aggregated information of neighboring nodes, providing a more comprehensive and informative node representation.

[0135] The transformation of the weight matrix enables the final embedding vector of the node to learn more abstract and advanced feature representations, improving the feature learning ability of the graph neural network.

[0136] The nonlinear transformation of the activation function increases the expressive power of the model, enabling it to capture more complex feature relationships.

[0137] The final node embedding vector, as the output of the graph neural network, can be used for prediction and decision-making of downstream tasks, such as node classification, link prediction, etc.

[0138] The final embedding vector of the node is generated by concatenating the current embedding of node v and the aggregated information of neighboring nodes, and after weight matrix conversion and nonlinear transformation of activation function, the final embedding representation vector of node v at the pth order is generated. This embedding vector combines the characteristics of the node itself and the information of neighboring nodes, providing a more comprehensive and abstract node representation. The beneficial effect of the final embedding vector of the node is to improve the feature learning and expression ability of the graph neural network, enabling it to better capture the complex relationships and structural information between nodes, thereby improving the performance of the graph neural network in downstream tasks.

[0139] Step S3 includes:

[0140] The similarity matrix is:

[0141]

[0142] Among them, s ij is the similarity matrix, e i For node v i The final node embedding vector, e j For node v j The final embedding vector of the node, ξ is the bandwidth coefficient of the Gaussian kernel function, d 2 (e i ,e j ) is e i and e j The Euclidean distance of

[0143] The preset constraints are:

[0144] S={s ij |1≤i≤n,1≤j≤n}

[0145] Among them, n represents the number of nodes and S is the final similarity matrix.

[0146] It should be noted that:

[0147] The similarity matrix is ​​calculated by Gaussian kernel function for node v i and node v jThe final node embedding vector e i and e j The similarities between.

[0148] The Gaussian kernel function converts the Euclidean distance into a similarity measure, where the smaller the distance, the higher the similarity.

[0149] The bandwidth coefficient ξ controls the scale of the Gaussian kernel function and affects the sensitivity of the similarity.

[0150] By calculating the similarity between the final embedding vectors of nodes, the similarity matrix captures the similarity relationship between nodes.

[0151] The preset constraints define the form and range of the final similarity matrix S.

[0152] S is an n×n matrix, where n represents the number of nodes and s ij Represents node v i and node v j The similarities between.

[0153] The constraints ensure the integrity and validity of the final similarity matrix S, which contains the similarity information between all nodes.

[0154] The beneficial effect of similarity matrix calculation is to convert the final embedding vector of the node into a similarity measure through the Gaussian kernel function, which quantifies the similarity relationship between nodes.

[0155] The Gaussian kernel function takes into account the Euclidean distance between node embedding vectors. The smaller the distance, the higher the similarity, and vice versa. This similarity measure can effectively capture the similarity relationship between nodes.

[0156] The choice of bandwidth coefficient ξ affects the sensitivity of similarity. A suitable bandwidth coefficient can balance the local and global similarity relationship and improve the quality of the similarity matrix.

[0157] The beneficial effect of presetting constraints is to ensure the integrity and validity of the final similarity matrix S, which contains the similarity information between all nodes and provides a basis for subsequent clustering or other tasks.

[0158] The final similarity matrix S can be used for various downstream tasks, such as clustering, community discovery, link prediction, etc., by utilizing the similarity relationship between nodes for analysis and prediction.

[0159] The similarity matrix calculation in step S3 converts the final node embedding vector into a similarity measure through a Gaussian kernel function, and quantifies the similarity relationship between nodes. The preset constraints ensure the integrity and validity of the final similarity matrix S. The beneficial effect of similarity matrix calculation and preset constraints is to provide a matrix representation that quantifies node similarity, which provides a basis for subsequent clustering or other tasks. By utilizing the similarity relationship between nodes, graph structure data can be better analyzed and understood, and tasks such as clustering, community discovery, and link prediction can be achieved, thereby improving the effect of graph analysis and mining.

[0160] Step S4 includes:

[0161] The diagonal values ​​of the final similarity matrix are assigned to 0, S(i,i)=0, and the mapping conversion relationship is:

[0162] D=s1,…,s i ,…,s n

[0163]

[0164] Where D is the degree matrix, s i For node v i The sum of similarities of connected nodes;

[0165] The initial Laplace matrix L = DS is constructed by the final similarity matrix and the degree matrix, and the initial Laplace matrix is ​​normalized to obtain the Laplace matrix L' = D -1 / 2 LD -1 / 2 .

[0166] It should be noted that:

[0167] The diagonal values ​​of the final similarity matrix are assigned to 0, that is, S(i,i) = 0, eliminating the similarity between the node and itself.

[0168] The degree matrix D is calculated by mapping the transformation relationship, where s i Represents the node v i The sum of similarities of connected nodes.

[0169] The degree matrix D reflects the sum of similarities of each node, that is, the "degree" information of the node.

[0170] The initial Laplacian matrix L=DS is constructed by the final similarity matrix S and the degree matrix D.

[0171] The diagonal elements of the initial Laplacian matrix L represent the degree of the nodes, and the off-diagonal elements represent the similarity relationship between the nodes.

[0172] Normalize the initial Laplace matrix L to obtain the normalized Laplace matrix L'=D-1 / 2 LD -1 / 2 .

[0173] The purpose of normalization is to eliminate the influence of degree differences on clustering results, so that nodes with different degrees have the same importance in clustering.

[0174] The normalized Laplace matrix L' has better numerical stability and clustering performance.

[0175] The beneficial effect of the mapping transformation relationship is to capture the sum of similarity information of each node by calculating the degree matrix D, reflecting the "degree" characteristics of the node.

[0176] The beneficial effect of the initial Laplacian matrix construction is to convert the similarity matrix into a Laplacian matrix, comprehensively consider the similarity between nodes and the degree information of the nodes, and more comprehensively represent the graph structure information.

[0177] The beneficial effect of normalization is to eliminate the influence of degree differences on clustering results, so that nodes with different degrees have the same importance in clustering, thus improving the quality and stability of clustering.

[0178] The normalized Laplacian matrix L' has better numerical stability and clustering performance in spectral clustering, and can more accurately capture the intrinsic characteristics of the graph structure.

[0179] By constructing the Laplacian matrix and performing normalization, the graph structure information can be better utilized in spectral clustering to achieve effective node clustering and community discovery.

[0180] The beneficial effect of the mapping conversion relationship, initial Laplace matrix construction and normalization processing in step S4 is to convert the similarity matrix into a Laplace matrix and normalize it to better capture the graph structure information. By comprehensively considering the similarity between nodes and the degree information of nodes, the normalized Laplace matrix has better numerical stability and clustering performance in spectral clustering, can more accurately discover the community structure in the graph, and improve the clustering quality and effect.

[0181] Step S5 includes:

[0182] Find the smallest k eigenvalues ​​of L' and the eigenvectors corresponding to the eigenvalues. The characteristic expressions of the eigenvectors and L' are:

[0183]

[0184] f a is the eigenvector corresponding to the ath eigenvalue, f b is the eigenvector corresponding to the bth eigenvalue,

[0185] Construct the community classification feature matrix through the feature vector:

[0186] F=[f1,f2,…,f k ]

[0187] Among them, F is the community classification feature matrix, f k is the eigenvector corresponding to the kth eigenvalue.

[0188] It should be noted that:

[0189] Find the smallest k eigenvalues ​​and their corresponding eigenvectors of the normalized Laplace matrix L'.

[0190] The eigenvalue represents the importance and stability of the graph structure, and smaller eigenvalues ​​correspond to important structural information in the graph. The eigenvector represents the main direction and mode of the graph structure, capturing the similarity relationship between nodes.

[0191] The eigenvectors and Laplacian matrices satisfy the characteristic expressions:

[0192]

[0193] This expression shows that the feature vector f can minimize the weighted square difference of similarities between nodes.

[0194] When the values ​​of nodes a and b in the feature space are a and f b When they are close, the similarity between them is s ab When the value difference between node a and node b in the feature space is large, the similarity between them is small and the square difference is large.

[0195] Minimizing this expression means that in the feature space, similar nodes have similar feature values, and dissimilar nodes have different feature values, thereby achieving effective distinction and clustering of nodes.

[0196] The community classification feature matrix F = [f1, f2, ..., f k ].

[0197] Each column represents a eigenvector, corresponding to a main direction or mode of the graph structure.

[0198] The community classification feature matrix F maps the graph structure from the original high-dimensional space to the low-dimensional feature space, retaining important information of the graph structure.

[0199] The beneficial effect of solving eigenvalues ​​and eigenvectors is to reveal the importance and stability of the graph structure and capture the similarity relationship between nodes.

[0200] The beneficial effect of the characteristic expressions of eigenvectors and Laplacian matrices is to achieve effective differentiation and clustering of nodes in the feature space, where similar nodes have similar eigenvalues ​​and dissimilar nodes have different eigenvalues.

[0201] The beneficial effect of constructing a community classification feature matrix is ​​to map the graph structure from a high-dimensional space to a low-dimensional feature space, extract the intrinsic structure and relationship of the data, and provide an effective feature representation for subsequent clustering and community discovery.

[0202] By solving the eigenvalues ​​and eigenvectors and constructing the community classification feature matrix, we can reveal the important patterns and directions of the graph structure, achieve effective node clustering and community discovery, and improve the clustering quality and effect.

[0203] The beneficial effect of solving the eigenvalues ​​and eigenvectors and constructing the community classification feature matrix in step S5 is to extract a low-dimensional representation of the graph structure and reveal the intrinsic structure and relationship of the data. By mapping the graph structure to a low-dimensional feature space, similar nodes have similar eigenvalues, and dissimilar nodes have different eigenvalues, which enables effective distinction and clustering of nodes. The community classification feature matrix provides an effective feature representation for subsequent clustering and community discovery, improving the quality and effect of clustering.

[0204] Step S6 includes:

[0205] Perform cluster analysis on the community classification feature matrix, set the number of clusters to t, use the K-means algorithm to cluster the feature matrix F, and get the clustering result C = {C1, C2, ..., C t}, cluster C t is the tth community, and the clustering result is used as the community division result corresponding to the node set.

[0206] It should be noted that:

[0207] The cluster analysis is performed on the community classification feature matrix F, with the aim of dividing the nodes into different communities based on their feature similarities.

[0208] Cluster analysis is an unsupervised learning method that classifies similar nodes into the same cluster and dissimilar nodes into different clusters by measuring the similarity or distance between nodes.

[0209] Setting the number of clusters to t means that we want to divide the node set into t communities.

[0210] The selection of the number of clusters can be based on prior knowledge or use some evaluation indicators (such as silhouette coefficient, Davies-Bouldin index, etc.) to determine the optimal number of clusters.

[0211] The K-means algorithm is used to cluster the feature matrix F, with the goal of dividing the nodes into t clusters.

[0212] The K-means algorithm is a classic clustering algorithm that assigns nodes to the nearest cluster center through iterative optimization and updates the location of the cluster center until convergence or the maximum number of iterations is reached.

[0213] The advantages of the K-means algorithm are simplicity, speed, and ease of implementation, and it is suitable for clustering large-scale data sets.

[0214] The clustering result C={C1,C2,…,C t}, where cluster C t represents the tth community.

[0215] Each cluster contains a group of nodes that have high similarity in the feature space and belong to the same community.

[0216] The clustering results reflect the community structure and relationships between nodes. The nodes within each community are closely connected, while the connections between nodes in different communities are weak.

[0217] The clustering result is used as the community division result corresponding to the node set, that is, each cluster corresponds to a community.

[0218] The community division results reveal the community structure and node affiliation in the network, providing a basis for subsequent community analysis and application.

[0219] The beneficial effect of cluster analysis is to automatically discover and detect community structures in the network based on the feature similarities of nodes, without the need for manual annotation or prior knowledge.

[0220] The beneficial effect of the K-means algorithm is that it can quickly and efficiently divide nodes into different communities, and is suitable for clustering large-scale data sets.

[0221] The beneficial effect of community division results is to reveal the community structure and node affiliation in the network, providing support for subsequent community analysis and applications, such as community discovery, community recommendation, influence analysis, etc.

[0222] In step S6, cluster analysis is performed on the community classification feature matrix, and the clustering result is obtained by using the K-means algorithm as the community division result. The beneficial effect is to automatically discover and detect the community structure in the network based on the feature similarity of the nodes, and reveal the community relationship and affiliation between the nodes. Through the application of cluster analysis and the K-means algorithm, the nodes can be quickly and efficiently divided into different communities, providing a basis and support for subsequent community analysis and application.

[0223] Embodiment 2

[0224] This paper provides a community division method based on a karate club dataset:

[0225] Dataset introduction: The karate club dataset is a classic social network dataset, containing 34 nodes and 78 edges. Nodes represent club members, and edges represent social relationships between members. This dataset contains the real community structure within the club.

[0226] Step 1: Construct an undirected graph

[0227] An undirected graph G = (V, E) is constructed based on a karate club data set, where V is a node set containing 34 nodes, and E is an edge set containing 78 edges.

[0228] Construct a node feature matrix, where the feature of each node is the other nodes connected to it by edges. The value is 1 if there is an edge connection, and 0 if there is no edge connection.

[0229] Step 2: Build a node representation learning model

[0230] The GraphSAGE model is used as the node representation learning model.

[0231] Set the neighbor sampling function to sample the multi-order neighbor nodes of each node, and the number of nodes sampled at each order is 10.

[0232] Set the mean aggregation function to aggregate the information of multi-order neighbor nodes obtained by sampling.

[0233] Iteratively update the node embedding vector, set the number of iterations to 100, and obtain the final node embedding vector with a dimension of 64.

[0234] Step 3: Construct similarity matrix

[0235] According to the final embedding vector of the node, the similarity between nodes is calculated and the similarity matrix is ​​constructed.

[0236] The similarity matrix is ​​screened based on the preset constraints to obtain the final similarity matrix.

[0237] Step 4: Construct the Laplacian matrix

[0238] The degree matrix D is constructed based on the final similarity matrix and the mapping transformation relationship.

[0239] The initial Laplacian matrix L is constructed by the final similarity matrix and the degree matrix.

[0240] Normalize the initial Laplace matrix to obtain the Laplace matrix L'=D -1 / 2 LD -1 / 2 .

[0241] Step 5: Construct community classification feature matrix

[0242] Calculate the eigenvalue set of the Laplace matrix L' and select the eigenvectors corresponding to the smallest two eigenvalues.

[0243] The community classification feature matrix F is constructed through the feature vector.

[0244] Step 6: Community Division

[0245] Perform cluster analysis on the community classification feature matrix F and set the number of clusters to 2.

[0246] The K-means algorithm is used to cluster the feature matrix F and obtain the clustering result C = {C1, C2}.

[0247] The clustering result is used as the community division result corresponding to the node set.

[0248] Result analysis:

[0249] The community division results are compared with the real community structure of a karate club dataset.

[0250] Calculate the accuracy, recall, F1 value and other evaluation indicators of community division to evaluate the effect of community division.

[0251] Visualize the community division results and observe the structure of the community and the ownership of the nodes.

[0252] Through this embodiment, a karate club dataset is successfully divided into communities using a node representation learning and community division method based on multi-order neighbor information fusion, and a good division effect is achieved. This method takes into account the multi-order neighbor information of the node, and achieves accurate community division through node representation learning and spectral clustering algorithm.

[0253] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A node representation learning and community division method based on multi-order neighbor information fusion, characterized in that: The following steps are involved: S1, constructing an undirected graph, the undirected graph comprising a node set and an edge set, and constructing a node feature matrix according to the connection relationship between the nodes in the node set; S2, constructing a node representation learning model, wherein the node representation learning model includes a neighbor sampling function and a mean aggregation function, wherein the neighbor sampling function is used to sample multi-order neighbor nodes, and the mean aggregation function is used to aggregate neighbor node information of multi-order neighbor nodes, and iteratively update the node embedding vector to obtain the final node embedding vector, wherein the initial input of the final node embedding vector is the node feature matrix; S3, constructing a similarity matrix according to the final embedding vector of the node, and screening the similarity matrix based on preset constraints to obtain a final similarity matrix; S4, constructing a degree matrix based on the final similarity matrix and the mapping transformation relationship, constructing an initial Laplace matrix through the final similarity matrix and the degree matrix, normalizing the initial Laplace matrix, and obtaining a Laplace matrix; S5, calculating the eigenvalue set of the Laplace matrix, constructing an eigenvector corresponding to each eigenvalue in the eigenvalue set, and constructing a community classification feature matrix through the eigenvectors; S6, cluster analysis is performed on the community classification feature matrix to obtain the community division results.

2. The node representation learning and community division method based on multi-order neighbor information fusion as claimed in claim 1, characterized in that: Step S1 includes: Construct an undirected graph G = (V, E), where V is a node set and E is an edge set, and construct a node feature matrix for each node in the node set. The node features of the node feature matrix are other nodes connected to the node by edges. The value of edge connection is 1, and the value of no edge connection is 0.

3. The node representation learning and community division method based on multi-order neighbor information fusion as claimed in claim 2, characterized in that: Step S2 includes: The node representation learning model is a GraphSAGE model, and the steps of constructing the node representation learning model include: setting a neighbor sampling function to sample multi-order neighbor nodes of each node; setting an aggregation function to aggregate the information of the sampled multi-order neighbor nodes; iteratively updating the node embedding vector until a preset number of iterations is reached to obtain the final node embedding vector, and the initial input of the node embedding vector is the node feature matrix.

4. The node representation learning and community division method based on multi-order neighbor information fusion as claimed in claim 3, characterized in that: The neighbor sampling function is: N(v)=random.choice(v nei_table ,size) Among them, v nei_table is the neighbor node mapping table of node v, which stores the node and its corresponding neighbor nodes with edge relationships. size is the number of nodes sampled at each order, and N(v) is the neighbor node set of each order of node v.

5. The node representation learning and community division method based on multi-order neighbor information fusion as claimed in claim 4, characterized in that: The mean aggregation function is: in, is the node embedding vector of node v’s neighbor node information aggregation from the first to Nth order, is the current embedding of node v, p is the class of the neighboring node, P is the number of network grids.

6. The node representation learning and community division method based on multi-order neighbor information fusion as claimed in claim 5, characterized in that: The final embedding vector of the node is: Among them, W p is the weight matrix, σ is the activation function of LeakyReLU, CONCAT is the concatenation function, The final embedding vector for the node.

7. The node representation learning and community division method based on multi-order neighbor information fusion as claimed in claim 6, characterized in that: Step S3 includes: The similarity matrix is: Among them, s ij is the similarity matrix, e i For node v i The final node embedding vector, e j For node v j The final embedding vector of the node, ξ is the bandwidth coefficient of the Gaussian kernel function, d 2 (e i ,e j ) is e i and e j The Euclidean distance of The preset constraints are: S={s ij |1≤i≤n,1≤j≤n} Among them, n represents the number of nodes and S is the final similarity matrix.

8. The node representation learning and community division method based on multi-order neighbor information fusion as claimed in claim 7, characterized in that: Step S4 includes: The diagonal values ​​of the final similarity matrix are assigned to 0, S(i, i) = 0, and the mapping conversion relationship is: D=s1,…,s i ,…,s n Where D is the degree matrix, s i For node v i The sum of similarities of connected nodes; The initial Laplace matrix L = DS is constructed by the final similarity matrix and the degree matrix, and the initial Laplace matrix is ​​normalized to obtain the Laplace matrix L′ = D -1 / 2 LD -1 / 2 .

9. The node representation learning and community division method based on multi-order neighbor information fusion as claimed in claim 8, characterized in that: Step S5 includes: Find the smallest k eigenvalues ​​of L′ and the eigenvectors corresponding to the eigenvalues. The characteristic expressions of the eigenvectors and L′ are: f a is the eigenvector corresponding to the ath eigenvalue, f b is the eigenvector corresponding to the bth eigenvalue, Construct the community classification feature matrix through the feature vector: F=[f1,f2,…,f k ] Among them, F is the community classification feature matrix, f k is the eigenvector corresponding to the kth eigenvalue.

10. The node representation learning and community division method based on multi-order neighbor information fusion according to claim 9, characterized in that: Step S6 includes: Perform cluster analysis on the community classification feature matrix, set the number of clusters to t, use the K-means algorithm to cluster the feature matrix F, and get the clustering result C = {C1, C2, ..., C t }, cluster C t is the tth community, and the clustering result is used as the community division result corresponding to the node set.

Citation Information

Cited By

  • Relation cluster database optimization method based on multi-modal learning

    CN119046316A

  • Optimization method of relational cluster database based on multimodal learning

    CN119046316B

  • RTA-based graph embedding feature construction method and system, and training method of advertisement click-through rate prediction model

    CN121094891A