Community detection label propagation method based on node degree and betweenness centrality
By using the label propagation method based on node degree and betweenness centrality in community detection, layer-by-layer propagation and iterative update of node labels, the problem of randomness and accuracy of community detection in the existing technology is solved, and a more accurate community is achieved. Structure identification and faster convergence.
Patent Information
- Application Number
- CN202411281608.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-10-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing community detection algorithms based on label propagation have problems such as high randomness, low accuracy, local optimal traps, resolution limitations, and sensitivity to initial conditions, making it difficult to effectively identify community structures in large and complex networks.
Adopt a community detection label propagation method based on node degree and betweenness centrality. By calculating the importance of each node, label propagation layer by layer, using core node and neighborhood information, combined with normalized mutual information and modularity to evaluate community division Quality, iteratively updates node labels until convergence.
It improves the performance and convergence speed of label propagation, can more accurately identify community structures in complex networks, reduces the instability of results and local optimal traps, and enhances the detection ability of small or large communities.
Smart Images

Figure CN118780932A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of community detection, and in particular relates to a community detection label propagation method based on node degree and betweenness centrality. Background Art
[0002] Since complex networks usually show obvious modularity or community structure, that is, there are densely connected sets of nodes, identifying these community structures helps to better understand the topological characteristics and organizational form of the network. At the same time, communities in the network often correspond to sets of nodes with the same attributes or functions. Community detection technology can be used to discover functional modules in the network, which is of great value in many application scenarios such as social network analysis, bioinformatics, and transportation network optimization. In addition, the community structure reflects the modular characteristics of the network and can also be used to compress and visualize the network, which helps to better analyze and understand large-scale complex networks. Therefore, community detection is an important technical support for complex network analysis.
[0003] However, in the prior art, the community detection algorithm based on label propagation faces multiple challenges: First, the algorithm is highly random, resulting in unstable results, and each run may produce different community divisions. Second, the algorithm has low accuracy when dealing with complex networks, and is prone to falling into local optimality and failing to identify the true community structure. In addition, resolution limitations make it difficult for the algorithm to detect very small or very large communities, resulting in unreasonable community divisions. The sensitivity of initial conditions also significantly affects the final results, because the random selection of initial labels will lead to different outputs. The algorithm assumes that all nodes have the same influence in label propagation, which ignores the differences between nodes and affects the accuracy of the results. Finally, especially in large and complex networks, the algorithm may sometimes fail to converge within a reasonable time, increasing the difficulty of application. These problems limit its wide application and effectiveness in different scenarios. Summary of the invention
[0004] In order to solve the above technical problems, the present invention proposes a community detection label propagation method based on node degree and betweenness centrality to solve the problems existing in the above prior art.
[0005] To achieve the above object, the present invention provides a community detection label propagation method based on node degree and betweenness centrality, comprising the following steps:
[0006] Construct an undirected graph and an adjacency matrix of an undirected graph based on a complex network, initialize the label of each node of the undirected graph, and set Record the number of times each node's label is modified;
[0007] Calculating the degree and betweenness centrality of each node, and calculating the average degree and average betweenness centrality of the complex network, calculating the importance of each node based on the degree, betweenness centrality, average degree and average betweenness centrality, and obtaining core nodes based on the importance;
[0008] Based on the core nodes, label propagation is performed layer by layer. First, label propagation is performed on non-public neighbor nodes in the target node. When all non-public neighbor nodes in the target node obtain labels and join the community, label propagation is performed on public neighbor nodes in the target node.
[0009] When all common neighbor nodes of the target node have obtained labels, the source node and the target node are updated to perform the second-level label propagation, and the label propagation step is iterated until the labels of the nodes in the network no longer change or the set maximum number of iterations is reached;
[0010] Normalized mutual information and modularity are used to evaluate the quality of community division.
[0011] Preferably, the method of performing label propagation on non-public neighbor nodes in the target node also includes: when the non-public neighbor node does not have a label and the node receives the label for the first time, directly obtaining the label of the corresponding source node and joining the community where the source node is located.
[0012] Preferably, the method for performing label propagation on non-public neighbor nodes in the target node includes:
[0013] When a non-public neighbor node has a label, the number of label modifications is less than four times, and the label received by the node is different from its own label, the attraction of different communities to the node is calculated. If the maximum attraction is unique, the node joins the community with the maximum attraction. If the maximum attraction is not unique, the node randomly joins a community with the maximum attraction.
[0014] Preferably, the expression of the attraction is:
[0015] In the formula, Representation Node With the community The number of common neighbors of an internal node, Representation Node With the community The number of connected edges between Representing the community For Node The attraction, Representation Node and There is an edge between Representation Node The set of first-order neighbor nodes of Representation Node The set of first-order neighbor nodes.
[0016] Preferably, the method for performing label propagation on common neighbor nodes in the target node includes:
[0017] When the number of label modifications of a common neighbor node is less than four times, the attraction of different communities to the node is calculated. If the maximum attraction is unique, the node is added to the community with the maximum attraction. If the maximum attraction is not unique, the node is randomly added to a community with the maximum attraction.
[0018] Preferably, the following constraints exist when calculating the importance of each node:
[0019] The degree of the node > the average degree of the complex network;
[0020] The betweenness centrality of a node > the average betweenness centrality of a complex network.
[0021] Preferably, the expression for calculating the importance of each node is:
[0022]
[0023] In the formula, Represents a collection of nodes. Representation Node The importance of represents the impact factor, Representation Node The betweenness centrality of For Node The degree, represents the average betweenness centrality.
[0024] Preferably, the expression of the modularity is:
[0025]
[0026] In the formula, , are nodes in the complex network, is the number of edges in the complex network, For Node The degree, For Node The degree, is the adjacency matrix of the complex network, is the Kronecker function.
[0027] Compared with the prior art, the present invention has the following advantages and technical effects:
[0028] The present invention utilizes the core nodes and their neighborhood information in the network to iteratively propagate labels. First, the core nodes and community structure in the network are identified by community detection. Then, labels are propagated from the core nodes to make full use of their important position in the network. In each round of iteration, the node updates its own label according to the label information of its neighboring nodes, reflecting the idea of utilizing local topological information. This layer-by-layer label propagation method based on core nodes integrates multiple technologies such as community detection, neighborhood information aggregation, iterative label propagation, and node importance, and can effectively utilize the structural characteristics of the network and node attribute information, thereby improving the performance and convergence speed of label propagation. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0030] Figure 1 This is a flow chart of a community detection label propagation method based on node degree and betweenness centrality according to an embodiment of the present invention;
[0031] Figure 2 is an exemplary diagram of an embodiment of the present invention;
[0032] Figure 3 This is an example diagram of node label misclassification according to an embodiment of the present invention;
[0033] Figure 4 Parameters of the embodiment of the present invention Schematic diagram of the impact of different values of on this method. DETAILED DESCRIPTION
[0034] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0035] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0036] Embodiment 1
[0037] like Figure 1 As shown, this embodiment provides a community detection label propagation method based on node degree and betweenness centrality, including the following steps:
[0038] Construct an undirected graph and an adjacency matrix of an undirected graph based on a complex network, initialize the label of each node of the undirected graph, and set Record the number of times each node's label is modified;
[0039] Calculating the degree and betweenness centrality of each node, and calculating the average degree and average betweenness centrality of the complex network, calculating the importance of each node based on the degree, betweenness centrality, average degree and average betweenness centrality, and obtaining core nodes based on the importance;
[0040] Based on the core nodes, label propagation is performed layer by layer. First, label propagation is performed on non-public neighbor nodes in the target node. When all non-public neighbor nodes in the target node obtain labels and join the community, label propagation is performed on public neighbor nodes in the target node.
[0041] When all common neighbor nodes of the target node have obtained labels, the source node and the target node are updated to perform the second-level label propagation, and the label propagation step is iterated until the labels of the nodes in the network no longer change or the set maximum number of iterations is reached;
[0042] Normalized mutual information and modularity are used to evaluate the quality of community division.
[0043] The specific implementation operations are as follows:
[0044] Define an undirected graph and its adjacency matrix , defined as follows:
[0045]
[0046] in Represents a collection of nodes. Represents a collection of edges. Indicates the number of nodes. Indicates the number of edges. Representation Node The set of first-order neighbor nodes of Representation Node and There is an edge between them. At the same time, define the graph The community structure is as follows:
[0047]
[0048] Satisfies: (1) represents any community in the set C and (2) (3) .
[0049] Table 1
[0050]
[0051] The algorithm shown in Table 1 is used to find the core nodes in the network. First, the degree of each node in the network is calculated ( ), betweenness centrality ( ) and the average degree of the network ( ), average betweenness centrality ( ), the averages mentioned here are simple arithmetic averages. Next, the importance of each node is calculated by combining the degree and betweenness centrality of each node ( ) is used to find the core nodes in the network. In order to avoid the influence of edge nodes and to reduce the amount of calculation, two constraints are added when calculating the importance of nodes: (1) (2) Only when the node The degree of the node is greater than the average degree of the network. The node is calculated only when its betweenness centrality is greater than the average betweenness centrality of the network. The importance of node The importance of is 0. Since the degree and betweenness centrality of different nodes are not of the same order of magnitude, simply adding the degree and betweenness centrality of a node may lead to an incorrect assessment of the importance of the node. In order to avoid this problem, it is necessary to make some appropriate adjustments based on the original betweenness centrality value of the node. The importance of is calculated as follows:
[0052]
[0053] in Representation Node Importance of parameters As influencing factors, the weights of balance and betweenness centrality improve the generalization ability of the label propagation method. The value of is [0.0,1.0], according to Figure 4 As shown, we set =0.7. Representation Node The betweenness centrality of . For Node The degree.
[0054] Select core nodes based on the importance of the nodes. The node with the greatest importance in its first-order domain is selected As a core node in the network.
[0055] When all core nodes are selected, the label propagation phase begins. Used to record the source nodes of each layer in the label propagation process. Used to record the target nodes of each layer in the label propagation process. In the first layer of label propagation, the core node is the source node and its first-order neighbor node is the target node; in the second layer of label propagation, the first-order neighbor of the core node becomes the source node and the second-order neighbor of the core node becomes the target node. And so on.
[0056] The specific operations of the label propagation process are shown in Table 2. First, initialize the label and parameters of each node Each core node is an independent initial community. It is used to record all common neighbor nodes between any two communities. The first layer of label propagation starts from the core nodes and adds the core nodes to the set From the collection Take a node from For core nodes and its neighbor nodes , if the node Not in the collection , then due to the node This is the first time that the node receives a label. Directly inherit the core node After all non-common neighbor nodes in the first layer have obtained labels, labels are propagated to common neighbor nodes. This method makes full use of the influence of non-common neighbor nodes on common neighbor nodes, allowing more accurate calculation of the attraction or weight of different communities on common neighbor nodes, which is reflected in the label selection of node 4 in the subsequent example. From the perspective of information diffusion, nodes With the community The more common neighbors and edges an inner node has, the more likely it is that the node From the community The greater the likelihood of receiving information or influence, the greater the likelihood of receiving information or influence. For Node Therefore, we combine the node With the community The number of common neighbors between nodes, and the number of nodes With the community The number of connected edges between them, calculate the community For Node The specific calculation formula of attractiveness is as follows:
[0057]
[0058]
[0059]
[0060] in, Representation Node With the community The number of common neighbors of an inner node. Representation Node With the community The number of connected edges between . Representing the community For Node attraction.
[0061] Common neighbor nodes Choose to join the community that appeals to it the most among all the communities it is connected to. , get community When the maximum attraction is not unique, the node Randomly select a community among the most attractive communities Join and modify node labels. Once all common neighbor nodes are assigned to their respective communities, the first level of label propagation is completed. Expand the community and , To update a collection . And the target nodes in the first layer are used as the source nodes of the second layer label propagation, and then the first-order neighbors of these source nodes are used to update the set Next, the second layer of label propagation begins. The label propagation process of the second layer is similar to that of the first layer. This label propagation process is repeated until the labels of all nodes no longer change or the maximum number of iterations is reached.
[0062] Table 2
[0063]
[0064] Figure 2 A simple example of the layer-by-layer label propagation process is shown. The initial network structure and the label of each node are as follows Figure 2As shown in (a) in the figure. According to the importance of each node, it can be calculated that node 0 and node 5 are the core nodes in the network. According to the layer-by-layer label propagation rule, labels are first assigned to non-common neighbor nodes in each community: nodes 1, 2, and 3 obtain the label of core node 0 and join community 0; nodes 6, 7, and 8 obtain the label of core node 5 and join community 5. Then, labels are assigned to common neighbor nodes: the attraction of community 0 and community 5 to the common neighbor node 4 is calculated. Since node 4 has no common neighbors with the nodes directly connected to community 0 and is only connected to community 0 through one edge, the attraction of community 0 to node 4 is 1. Node 4 has two common neighbors (node 5 and node 6) with the nodes directly connected to community 5 and is connected to community 5 through two edges, so the weight of community 5 to node 4 is 4. Therefore, node 4 obtains the label of community 5 and joins community 5. The result of the first layer of label propagation is shown in Figure 2 As shown in (b) in the figure, the final result is Figure 2 As shown in (c) in .
[0065] Due to the complexity of the network, nodes may obtain incorrect labels during label propagation, which will reduce the accuracy of community detection and affect the propagation performance.
[0066] Figure 3 Some nodes and edges in the network are given, and an example of label misclassification is shown. Assume that node 0 and node 5 belong to two communities in the network respectively. According to the layer-by-layer label propagation rule, node 1 first obtains the label of node 0 and joins community 0, and nodes 3 and 4 obtain the label of node 5 and join community 5. From here, it can be found that although node 1 joins community 0, it is more closely connected with community 5. Compared with community 0, community 5 is more attractive to node 1, and node 1 should belong to community 5. The reason for this misclassification is that according to the layer-by-layer label propagation rule, nodes tend to obtain labels from communities closer to themselves during the label propagation process. Therefore, in order to solve this problem, this method defines a parameter for each node. . Representation Node The number of times the label of a node is modified, and the initial value is 0. It should be noted that in order to avoid endless label calibration of nodes, we consider that any node will no longer be calibrated after its label is modified three times.
[0067] Steps 11 to 18 in Table 2 describe the specific rules of label calibration in detail. In the layer-by-layer label propagation, the target nodes in each layer are divided into non-common neighbor nodes and common neighbor nodes. Non-common neighbor nodes .if , which means that the node The first time the label is received. Therefore, the node Get the node directly Tags, join the same community, and Increase by 1. If , which means that the node Already has a label. If the node If the received label is different from its own label, the node are considered as common neighbor nodes. Each community pair connected to the node Choose a community with the greatest appeal Join and update nodes Label, Increase by 1. When there are multiple communities with the highest attraction, the node Randomly select one of the communities to join and modify its label. .if , it is the same as step 14 to step 18 in Table 2 and will not be repeated here.
[0068] The experimental results and analysis are as follows:
[0069] In order to compare the community detection results of different methods and prove the effectiveness of this method. We considered four real datasets commonly used in community detection: Karate Club Network, Dolphin Network, FootballNetwork, and Polbooks Network. The Karate Network describes the social relationships among members of a karate club. The Dolphin Network records the connections between 62 dolphins, which are divided into two communities. The Football Network is a network created based on the American College Football League. A node in the network represents a team, and an edge represents the game data between two teams. The Polbooks Network records the interactions between readers of American political books. Table 3 summarizes the general information of the four real datasets, where , , and They represent the number of nodes, the number of edges, the number of communities and the average degree of nodes in the network respectively.
[0070] Table 3
[0071]
[0072] However, for many real networks, the true community structure is mostly unknown, which makes it impossible to accurately evaluate its true effect. Therefore, to expand the experiment, we generated 9 synthetic network datasets using the LFR model. The different configurations of the generated LFR networks are shown in Table 4. The detailed description of each parameter when generating the network is shown in Table 5. One of the key parameters is , which is used to describe the strength of internal links within a community and ranges from 0.0 to 1.0. The smaller it is, the closer the connections within the community are.
[0073] Table 4
[0074]
[0075] Table 5
[0076]
[0077] The experiment uses normalized mutual information ( ) and modularity ( ) is used as a community division quality evaluation indicator, and the specific definition of normalized mutual information is as follows:
[0078]
[0079] in, is a collection of real communities on the network. is the set of detected communities. Representing a collection The number of real communities in Representing a collection The number of communities detected in . Represents the confusion matrix, where rows are true communities and columns are detected communities. Representing a collection Real community With Collection Communities detected in The number of common nodes between them. and Represents real communities and detected communities When the community structure detected by the community detection algorithm is completely consistent with the real community structure in the network, Get the maximum value 1.
[0080] The specific definition of modularity is as follows:
[0081]
[0082] in, , is a node in the network, is the number of edges in the network, For Node The degree, is the adjacency matrix of the network, function is the Kronecker function. If the node and nodes belong to the same community, then ;otherwise, .
[0083] In order to balance the ratio of degree and betweenness centrality and achieve the most accurate community detection results, the authors tested the network on four real network datasets. The impact of different values on the community detection results of this method. The value range of is [0.0,1.0]. Since this method has potential randomness in the label propagation process, for each We repeated the method 5 times and averaged the values of different networks. like Figure 4 It can be clearly seen that when When , this method achieves the largest average , and has also achieved a large average on the football network Therefore, in the following experiments, The value of is fixed to 0.7 to obtain the best community detection results.
[0084] The average performance of this method (DBLPA) and other compared algorithms on real network datasets and synthetic network datasets The results are shown in Table 6. As can be seen from the table, DBLPA achieves the largest average , indicating that the community detection results of DBLPA are more accurate. In addition, observing the community detection results of these algorithms on all datasets, we can observe that these algorithms can achieve a large average result( ). However, in sparse networks ( ), DBLPA shows relatively higher community detection accuracy than other algorithms. This is because DBLPA can identify the core nodes of the community in sparse networks.
[0085] Table 6
[0086]
[0087] Table 7 shows the average modularity results on real network datasets and synthetic network datasets. It can be clearly seen that DBLPA obtains the largest average modularity on most datasets, indicating that the internal connections of the communities detected by this method are tighter.
[0088] Table 7
[0089]
[0090] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A community detection label propagation method based on node degree and betweenness centrality, characterized in that: The following steps are involved: Construct an undirected graph and an adjacency matrix of the undirected graph based on the complex network, initialize the label of each node of the undirected graph, and set a flag to record the number of times the label of each node has been modified; Calculating the degree and betweenness centrality of each node, and calculating the average degree and average betweenness centrality of the complex network, calculating the importance of each node based on the degree, betweenness centrality, average degree and average betweenness centrality, and obtaining core nodes based on the importance; Based on the core nodes, label propagation is performed layer by layer. First, label propagation is performed on non-public neighbor nodes in the target node. When all non-public neighbor nodes in the target node obtain labels and join the community, label propagation is performed on public neighbor nodes in the target node. When all common neighbor nodes of the target node have obtained labels, the source node and the target node are updated to perform the second-level label propagation, and the label propagation step is iterated until the labels of the nodes in the network no longer change or the maximum number of iterations set is reached; Normalized mutual information and modularity are used to evaluate the quality of community division.
2. The community detection label propagation method based on node degree and betweenness centrality according to claim 1 is characterized in that: The method for performing label propagation on non-public neighbor nodes in the target node also includes: when the non-public neighbor node does not have a label and the node receives the label for the first time, directly obtaining the label of the corresponding source node and joining the community where the source node is located.
3. The community detection label propagation method based on node degree and betweenness centrality according to claim 1 is characterized in that: The method for performing label propagation on non-public neighbor nodes in the target node includes: When a non-public neighbor node has a label, the number of label modifications is less than four times, and the label received by the node is different from its own label, the attraction of different communities to the node is calculated. If the maximum attraction is unique, the node joins the community with the maximum attraction. If the maximum attraction is not unique, the node randomly joins a community with the maximum attraction.
4. The community detection label propagation method based on node degree and betweenness centrality according to claim 3 is characterized in that: The expression of the attraction is: In the formula, Representation Node With the community The number of common neighbors of an internal node, Representation Node With the community The number of connected edges between Representing the community For Node The attraction Representation Node and There is an edge between Representation Node The set of first-order neighbor nodes of Representation Node The set of first-order neighbor nodes.
5. The community detection label propagation method based on node degree and betweenness centrality according to claim 1 is characterized in that: The method of performing label propagation on the common neighbor nodes in the target node includes: When the number of label modifications of a common neighbor node is less than four times, the attraction of different communities to the node is calculated. If the maximum attraction is unique, the node is added to the community with the maximum attraction. If the maximum attraction is not unique, the node is randomly added to a community with the maximum attraction.
6. The community detection label propagation method based on node degree and betweenness centrality according to claim 1 is characterized in that: The following constraints exist when calculating the importance of each node: The degree of the node > the average degree of the complex network; The betweenness centrality of a node > the average betweenness centrality of a complex network.
7. The community detection label propagation method based on node degree and betweenness centrality according to claim 1 is characterized in that: The expression for calculating the importance of each node is: In the formula, Represents a collection of nodes. Representation Node The importance of represents the impact factor, Representation Node The betweenness centrality of For Node The degree, represents the average betweenness centrality.
8. The community detection label propagation method based on node degree and betweenness centrality according to claim 1 is characterized in that: The expression of modularity is: In the formula, , are nodes in the complex network, is the number of edges in the complex network, For Node The degree, For Node The degree, is the adjacency matrix of the complex network, is the Kronecker function.
