A Community Detection Method Based on Graph Compression

By calculating node importance and using graph convolutional neural networks to compress and reconstruct the social network graph, the storage and processing problems caused by the excessive size of the social network graph are solved, and more efficient community detection is achieved.

CN116341656BActive Publication Date: 2025-10-28SHANGHAI NORMAL UNIVERSITY +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310329486.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2025-10-28
Estimated Expiration
2043-03-30

AI Technical Summary

Technical Problem

The large size of social network graphs leads to high storage space consumption and processing difficulties. Existing compression methods fail to effectively consider the importance of nodes, affecting detection accuracy.

Method used

By calculating the degree centrality, eigenvector centrality, and betweenness centrality of nodes, nodes with lower importance are selected for compression. Graph convolutional neural networks are then used to perform community detection on the compressed graph. Combined with weight adjustment and adjacency matrix reconstruction, reasonable node compression and community detection are achieved.

Benefits of technology

It effectively reduces the size of social network graphs, decreases storage requirements, simplifies data analysis, and improves the accuracy and efficiency of community detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116341656B_ABST
    Figure CN116341656B_ABST
Patent Text Reader

Abstract

This invention relates to a community detection method based on graph compression, comprising the following steps: acquiring initial graph information, sorting the importance of graph nodes, and selecting nodes to be compressed; compressing the nodes to be compressed to obtain a compressed graph, reconstructing the adjacency matrix using the compressed graph, and performing community detection on the compressed graph based on a graph convolutional network; expanding the communities detected in the compressed graph, restoring the community detection state of the initial graph, and obtaining the community detection result. Compared with existing technologies, this invention has advantages such as being able to compress the graph to a smaller size and achieving higher accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of social networks, and in particular to a community discovery method based on graph compression. Background Technology

[0002] In the information explosion era, with the widespread use of electronic devices, social networks are becoming increasingly prevalent and their scale is constantly expanding. The core of a social network lies in its participating users, which can be represented by nodes (entities) and edges (representing relationships between users (entities)) to construct a social network graph. Understanding the underlying data structure of social networks is crucial for their research. By mining and identifying community structures, we can obtain rich information from the network, understand the development patterns of the community, and the relationships between community structures. This not only helps in recommending services to community users and implementing personalized services but also facilitates the dissemination of specific information. However, as social networks continue to grow in scale, social network graphs often become extremely large, with massive amounts of data. This massive amount of data suffers from high redundancy and processing difficulties, occupying significant storage space and containing interfering information.

[0003] The large size of social network graphs poses a challenge to some community detection algorithms. Therefore, reducing the size of social network graphs has become an urgent problem to be solved. Some graph compression methods use a brute-force approach to compress nodes of degree 1 and 2 into their neighbors, which can remove some interfering information to some extent. However, this method does not take into account the importance of nodes and has obvious shortcomings. Summary of the Invention

[0004] The purpose of this invention is to provide a community detection method based on graph compression, which takes into account the importance between nodes to reduce the size of the social network graph and improve detection accuracy.

[0005] The objective of this invention can be achieved through the following technical solutions:

[0006] A community detection method based on graph compression includes the following steps:

[0007] Step 1) Obtain initial graph information, sort the importance of graph nodes, and select the nodes to be compressed;

[0008] Step 2) After compressing the nodes to be compressed, a compressed graph is obtained. The adjacency matrix is ​​reconstructed using the compressed graph, and community detection is performed on the compressed graph based on a graph convolutional network.

[0009] Step 3) Expand the communities detected by the compressed graph, restore the community detection state of the initial graph, and obtain the community detection results.

[0010] Step 1) includes the following steps:

[0011] Step 11) Obtain initial graph information;

[0012] Step 12) Calculate the degree centrality, eigenvector centrality, and betweenness centrality for each node in the initial graph as indicators of node importance, and sort the nodes according to their importance.

[0013] Step 13) Select the node to be compressed based on the sorting results and selection criteria.

[0014] The method for calculating the degree centrality is as follows:

[0015]

[0016] Where DC(v) i ) represents node v i Degree centrality, where n is the number of nodes in the social network, d(v i ) represents node v i The degree.

[0017] The method for calculating the betweenness centrality is as follows:

[0018]

[0019] Among them, BC(v i ) represents node v i The centrality of the middle, d st d represents the number of shortest paths from node s to node t. st (v i ) indicates that the shortest path passes through node v. i The quantity.

[0020] The method for calculating the centrality of the eigenvector is as follows:

[0021]

[0022] Among them, EC(v i ) and x i All represent node v i eigenvector centrality, x j Represents node v j The eigenvector centrality, c is a scaling constant, n is the number of nodes in the social network, a ij It is an element in the adjacency matrix. If there is an edge between node i and node j, then a ij =1, otherwise a ij =0.

[0023] The selection criteria are as follows:

[0024] Set(target) = bottom p(DC)∪bottom p (BC)∪bottom p (EC)-top p (DC)∪top p (BC)∪top p (EC)

[0025] Among them, bottom p (DC) represents the set of all nodes after sorting by degree centrality, p%, top p (DC) represents the set of the top p% of all nodes sorted by degree centrality; bottom p (BC) represents the set of all nodes after sorting by their betweenness centrality, p%, where p is the top. p (BC) represents the set of the top p% of nodes sorted by their betweenness centrality; bottom p (EC) represents the set of p% of the eigenvectors of all nodes after sorting by their eigenvector centrality, top p (EC) represents the set of the top p% of all nodes in terms of eigenvector centrality; p∈{15,20,25}, and Set(target) represents the set of nodes to be compressed.

[0026] Step 2) includes the following steps:

[0027] Step 21) Determine the authoritative neighbors of the node to be compressed, compress the node to be compressed into the authoritative neighbors, delete the node to be compressed and its edges, change the weight information of the graph, and obtain the compressed graph.

[0028] Step 22) Reconstruct the adjacency matrix of the graph based on the compressed graph;

[0029] Step 23) Use the adjacency matrix as input to the graph convolutional neural network to perform community detection on the compressed graph.

[0030] Step 21) specifically involves:

[0031] The node with the highest degree centrality among the neighboring nodes of the node to be compressed is selected as the authoritative neighbor. The node to be compressed is then compressed into the authoritative node. If the degree of the node to be compressed is 1, the node to be compressed and the edges between it and its neighbors are directly deleted. If the degree of the node to be compressed is greater than 1, and there are edges connecting its neighbors, the weight information is updated according to the weight adjustment formula. If there are no edges connecting its neighbors, new edges are added between the neighbors, the weight information is updated according to the weight adjustment formula, and the node to be compressed and the edges between it and its neighbors are deleted. The weight adjustment formula is as follows:

[0032]

[0033] Among them, W(v) j ,v k ) represents the uncompressed v j Nodes and v k The weight of the edges between nodes, W c (v j ,v k ) represents the compressed version of v j Nodes and v k The weight of the edges between nodes.

[0034] The specific method for reconstructing the adjacency matrix based on the compressed graph involves constructing the adjacency matrix based on the edge weights.

[0035] A ij =A ji =weight ij

[0036] Among them, A ij The elements of the adjacency matrix, weight ij Represents node v i and v j The weight of the edges between them.

[0037] The propagation method between the layers of the graph convolutional neural network is as follows:

[0038]

[0039] Among them, H (l) H represents the feature of the l-th layer. If it is the first layer, then H (l) =H (0) =X, where X represents the initial characteristic matrix of the graph, H (l+1) It is a feature of the (l+1)th layer, a new feature that aggregates the features of all neighboring nodes in the previous layer, W. (l) This represents the weight matrix of the l-th layer. and These represent the adjacency matrix A+I and the degree matrix D+I, respectively.

[0040] Compared with the prior art, the present invention has the following beneficial effects:

[0041] (1) This invention comprehensively considers the importance of a node itself, the importance of its neighbors, and the importance of its mediation, taking into account the importance of nodes from the perspective of the global structure. Based on these considerations, selecting an appropriate weight for node compression helps alleviate problems such as insufficient storage space and high data analysis difficulty caused by massive data growth. Furthermore, compressing non-critical nodes can simplify the operations of subsequent downstream tasks and enhance the graph structure.

[0042] (2) This invention utilizes graph convolutional neural networks to perform community detection on compressed graphs, which can better capture information about the graph structure and learn complex function representations, thereby more accurately describing the relationships between nodes. Compared with traditional methods, this invention can adaptively learn node features, reduce the storage size of data, and achieve good community detection results. Attached Figure Description

[0043] Figure 1 This is a schematic diagram of the method flow of the present invention;

[0044] Figure 2 This is the initial social network graph in an embodiment of the present invention;

[0045] Figure 3 This is a compressed diagram of the social network in an embodiment of the present invention. Detailed Implementation

[0046] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.

[0047] This embodiment provides a community detection method based on graph compression, such as... Figure 1 As shown, it includes the following steps:

[0048] Step 1) Obtain initial graph information, sort the graph nodes by importance, and select the nodes to be compressed.

[0049] Step 11) Obtain initial graph information.

[0050] In this embodiment, the obtained initial social network graph is as follows: Figure 2 As shown, let graph G = (V, E), v i Represents the nodes of graph G.

[0051] Definition 1: A social network graph is a graph structure consisting of social connections between people or organizations. In a social network graph, nodes represent people or organizations, and edges represent the social connections between them. This example focuses on undirected graphs.

[0052] Definition 2: Node V, in a social network graph, represents a user (entity).

[0053] Definition 3: Relation E, in this embodiment, refers to the undirected edge connecting the nodes.

[0054] Definition 4: Node degree, in a social network graph, refers to the number of relationships between a node and other nodes, with in-degree and out-degree being equal.

[0055] Definition 5: Node neighbor N(v iIn a social network graph, represents the relationship between node v. i A set of connected nodes.

[0056] Step 12) Calculate the degree centrality, eigenvector centrality, and betweenness centrality for each node in the initial graph as indicators of node importance, and sort the nodes according to their importance.

[0057] The method for calculating degree centrality is as follows:

[0058]

[0059] Where DC(v) i ) represents node v i Degree centrality, where n is the number of nodes in the social network, d(v i ) represents node v i The degree.

[0060] The method for calculating betweenness centrality is as follows:

[0061]

[0062] Among them, BC(v i ) represents node v i The centrality of the middle, d st d represents the number of shortest paths from node s to node t. st (v i ) indicates that the shortest path passes through node v. i The quantity.

[0063] The method for calculating the eigenvector centrality is as follows:

[0064]

[0065] Among them, EC(v i ) and x i All represent node v i eigenvector centrality, x j Represents node v j The eigenvector centrality, c is a scaling constant, n is the number of nodes in the social network, a ij It is an element in the adjacency matrix. If there is an edge between node i and node j, then a ij =1, otherwise a ij =0.

[0066] Step 13) Select the node to be compressed based on the sorting results and selection criteria.

[0067] The selection criteria are:

[0068] Set(target) = bottomp (DC)∪bottom p (BC)∪bottom p (EC)-top p (DC)∪top p (BC)∪top p (EC)

[0069] Among them, bottom p (DC) represents the set of all nodes after sorting by degree centrality, p%, top p (DC) represents the set of the top p% of all nodes sorted by degree centrality; bottom p (BC) represents the set of all nodes after sorting by their betweenness centrality, p%, where p is the top. p (BC) represents the set of the top p% of nodes sorted by their betweenness centrality; bottom p (EC) represents the set of p% of the eigenvectors of all nodes after sorting by their eigenvector centrality, top p (EC) represents the set of the top p% of all nodes in terms of eigenvector centrality; p∈{15,20,25}, and Set(target) represents the set of nodes to be compressed.

[0070] according to Figure 2 In this embodiment, the nodes to be compressed are v3 and v7.

[0071] Step 2) After compressing the nodes to be compressed, a compressed graph is obtained. The adjacency matrix is ​​reconstructed using the compressed graph, and community detection is performed on the compressed graph based on a graph convolutional network.

[0072] Step 21) Determine the authoritative neighbors of the node to be compressed, compress the node to be compressed into the authoritative neighbors, delete the node to be compressed and its edges, change the weight information of the graph, and obtain the compressed graph G. c .

[0073] Specifically, the node with the highest degree centrality among the neighboring nodes of the node to be compressed is selected as the authoritative neighbor. The node to be compressed is then compressed into the authoritative node. If the degree of the node to be compressed is 1, the node to be compressed and the edges between it and its neighbors are directly deleted. If the degree of the node to be compressed is greater than 1, and there are edges connecting its neighbors, the weight information is updated according to the weight adjustment formula. If there are no edges connecting its neighbors, new edges are added between the neighbors, the weight information is updated according to the weight adjustment formula, and the node to be compressed and the edges between it and its neighbors are deleted. The weight adjustment formula is as follows:

[0074]

[0075] Among them, W(v)j ,v k ) represents the uncompressed v j Nodes and v k The weight of the edge between nodes, if v j Nodes and v k If nodes are connected by edges, then W(v) j ,v k If the value is 1, and there are no connected edges, then W(v) j ,v k Take 0. W c (v j ,v k ) represents the compressed version of v j Nodes and v k The weight of the edges between nodes.

[0076] In this embodiment, the authoritative neighbors are determined to be v4 and v5. Therefore, v3 is compressed into v4, and v7 is compressed into v5. Since v3 is only connected to v4 by an edge, its degree is 1, and node v3 and its edge are directly deleted. v7 is connected to both v5 and v9, and there is an edge between v5 and v9. Therefore, according to the weight adjustment formula, the weight between the compressed nodes v5 and v9 is obtained, and node v7 and its two edges are deleted. The calculated weight between v5 and v9 is:

[0077]

[0078] The resulting compressed image is as follows Figure 3 As shown.

[0079] Step 22) Reconstruct the adjacency matrix of the graph based on the edge weights in the compressed graph:

[0080] A ij =A ji =weight ij

[0081] Among them, A ij The elements of the adjacency matrix, wight ij Represents node v i and v j The weight of the edges between them.

[0082] Step 23) Use the adjacency matrix as input to the graph convolutional neural network to perform community detection on the compressed graph.

[0083] An important parameter of a graph convolutional neural network is the Laplacian matrix L, where L = DA, A is the adjacency matrix and D is the degree matrix. Once the adjacency matrix is ​​determined, the Laplacian matrix can be obtained, thus enabling community detection through the graph convolutional neural network.

[0084] The propagation mechanism between layers in a graph convolutional neural network is as follows:

[0085]

[0086] Among them, H (l) H represents the feature of the l-th layer. If it is the first layer, then H (l) =H (0) =X, where X represents the initial characteristic matrix of the graph, H (l+1) It is a feature of the (l+1)th layer, a new feature that aggregates the features of all neighboring nodes in the previous layer, W. (l) This represents the weight matrix of the l-th layer. and These represent the adjacency matrix A+I and the degree matrix D+I, respectively.

[0087] Step 3) Expand the community for compressed image detection. Figure 1 As shown in (5)-(6), the community detection state of the initial graph is restored to obtain the community detection results.

[0088] In summary, graph compression techniques can reduce the size of large-scale graphs, not only decreasing storage space and simplifying downstream graph analysis tasks, but also enhancing graph structure by filtering out unimportant structures and edges. Combining graph compression with deep learning models for community detection tasks can better capture graph structure information, learn complex functional representations, and more accurately describe the relationships between nodes, thus achieving better results.

[0089] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.

Claims

1. A community detection method based on graph compression, characterized in that, Includes the following steps: Step 1) Obtain initial graph information, sort the graph nodes by importance, and select the nodes to be compressed; Step 1) includes the following steps: Step 11) Obtain initial graph information; Step 12) Calculate the degree centrality, eigenvector centrality, and betweenness centrality for each node in the initial graph as indicators of node importance, and sort the nodes according to their importance; Step 13) Select the nodes to be compressed based on the sorting results and selection criteria; The selection criteria are as follows: in, This represents the degree centrality of all nodes after sorting. The set of %. The degree centrality of all nodes is represented before sorting. The set of %. This represents the order of the betweenness centrality of all nodes. The set of %. The order of the center centrality of all nodes before sorting. The set of %. This represents the eigenvector centrality of all nodes after sorting. The set of %. The eigenvector centrality of all nodes before sorting The set of %. , This represents the set of nodes to be compressed. Step 2) After compressing the nodes to be compressed, a compressed graph is obtained. The adjacency matrix is ​​reconstructed using the compressed graph, and community detection is performed on the compressed graph based on a graph convolutional network. Step 2) includes the following steps: Step 21) Determine the authoritative neighbors of the node to be compressed, compress the node to be compressed into the authoritative neighbors, delete the node to be compressed and its edges, change the weight information of the graph, and obtain the compressed graph. Step 21) specifically involves: The node with the highest degree centrality among the neighboring nodes of the node to be compressed is selected as the authoritative neighbor. The node to be compressed is then compressed into the authoritative node. If the degree of the node to be compressed is 1, the node to be compressed and the edges between it and its neighbors are directly deleted. If the degree of the node to be compressed is greater than 1, and there are edges connecting its neighbors, the weight information is updated according to the weight adjustment formula. If there are no edges connecting its neighbors, new edges are added between the neighbors, the weight information is updated according to the weight adjustment formula, and the node to be compressed and the edges between it and its neighbors are deleted. The weight adjustment formula is as follows: in, Represents before compression Nodes and The weights of edges between nodes Represents the compressed Nodes and The weights of edges between nodes; Step 22) Reconstruct the adjacency matrix of the graph based on the compressed graph; Step 23) Use the adjacency matrix as input to the graph convolutional neural network to perform community detection on the compressed graph; Step 3) Expand the communities detected by the compressed graph, restore the community detection state of the initial graph, and obtain the community detection results.

2. The community detection method based on graph compression according to claim 1, characterized in that, The method for calculating the degree centrality is as follows: in, Represents a node Degree centrality, It refers to the number of nodes in the social network. Represents a node The degree.

3. The community detection method based on graph compression according to claim 1, characterized in that, The method for calculating the betweenness centrality is as follows: in, Represents a node The centrality of the middle, Represents a node To the node The number of shortest paths, This indicates the nodes visited in the shortest path. The quantity.

4. The community detection method based on graph compression according to claim 1, characterized in that, The method for calculating the centrality of the eigenvector is as follows: in, and All represent nodes eigenvector centrality, Represents a node eigenvector centrality, It is a proportionality constant. It refers to the number of nodes in the social network. It is an element in the adjacency matrix, if the node i and nodes j There is a border between them. =1, otherwise =0.

5. The community detection method based on graph compression according to claim 1, characterized in that, The specific method for reconstructing the adjacency matrix based on the compressed graph involves constructing the adjacency matrix based on the edge weights. in, Represents the elements of the adjacency matrix. Represents a node The weight of the edges between them.

6. The community detection method based on graph compression according to claim 1, characterized in that, The propagation method between the layers of the graph convolutional neural network is as follows: in, Indicates the first The characteristics of a layer, if it is the first layer, then , X This represents the initial characteristic matrix of the graph. It is the first The features of a layer are new features that aggregate the features of all neighboring nodes in the previous layer. Indicates the first l The weight matrix of the layer, and Representing the adjacency matrix respectively Degree matrix .

Citation Information

Patent Citations

  • Feature enhancement-based graph compression method

    CN110633394A

  • Social network user community discovery method based on Markov similarity enhancement

    CN114969562A