Community division method and device, electronic equipment and readable storage medium

By adjusting the community ownership of edge nodes based on edge interpolation and similarity in community detection, the problem of excessive small communities caused by more edge nodes is solved, and the quality of community division is improved, which is manifested as superior to current in modularity and NMI evaluation. There is a way.

CN119273488APending Publication Date: 2025-01-07CHINA MOBILE (XIONGAN) ICT CO LTD +3
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411307898.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

With the large number of edge nodes, existing community detection methods lead to a large number of small communities, reducing the quality of community division results.

Method used

By determining the target edge based on the edge intranumerization in the network and calculating the first and second similarities, the community attribution of the edge nodes is adjusted to improve the quality of community division.

Benefits of technology

Effectively reduce the number of small communities and improve the quality of community division results, which is manifested as superior to existing methods in modularity and standardized mutual information (NMI) assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119273488A_ABST
    Figure CN119273488A_ABST
Patent Text Reader

Abstract

The invention discloses a community division method and device, electronic equipment and a readable storage medium, and the method comprises the steps: determining a target edge based on the edge betweenness of all edges in a network, the network being composed of a plurality of nodes and a plurality of edges, the target edge being an edge connecting two communities in the network; a first similarity and a second similarity are determined, the first similarity is the similarity between the first edge node and the second neighbor node, the second similarity is the similarity between the first edge node and the first neighbor node, and the first edge node and the second edge node are nodes at the two ends of the target edge respectively; the first edge node initially belongs to a first community in the two communities, the second edge node initially belongs to a second community in the two communities, the first neighbor node is a neighbor node of the first edge node in the first community, and the second neighbor node is a neighbor node of the second edge node in the second community; and adjusting the community to which the first edge node belongs based on the first similarity and the second similarity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of edge detection, and in particular to a community division method, device, electronic device and readable storage medium. Background Art

[0002] In the community division results of current community detection methods, edge nodes are usually divided into a community separately. In this case, if there are many edge nodes between communities, a large number of small communities will be generated, which will lead to low quality of community division results. Summary of the invention

[0003] The present application discloses a community division method, device, electronic device and readable storage medium, which can improve the quality of community division.

[0004] In order to solve the above problems, this application adopts the following technical solutions: In a first aspect, an embodiment of the present application discloses a community partitioning method, including: determining a target edge based on the edge betweenness of all edges in a network, wherein the network is composed of multiple nodes and multiple edges, and the target edge is an edge in the network connecting two communities; determining a first similarity and a second similarity, wherein the first similarity is the similarity between a first edge node and a second neighbor node, and the second similarity is the similarity between the first edge node and the first neighbor node, the first edge node and the second edge node are nodes at both ends of the target edge, respectively, the first edge node initially belongs to the first community of the two communities, the second edge node initially belongs to the second community of the two communities, the first neighbor node is a neighbor node of the first edge node in the first community, and the second neighbor node is a neighbor node of the second edge node in the second community; based on the first similarity and the second similarity, adjusting the community to which the first edge node belongs.

[0005] In a second aspect, an embodiment of the present application discloses a community division device, including: a determination module, used to determine a target edge based on the edge betweenness of all edges in a network, wherein the network is composed of multiple nodes and multiple edges, and the target edge is an edge in the network connecting two communities; the determination module is also used to determine a first similarity and a second similarity, wherein the first similarity is the similarity between a first edge node and a second neighbor node, and the second similarity is the similarity between the first edge node and the first neighbor node, the first edge node and the second edge node are nodes at both ends of the target edge, respectively, the first edge node initially belongs to the first community of the two communities, the second edge node initially belongs to the second community of the two communities, the first neighbor node is a neighbor node of the first edge node in the first community, and the second neighbor node is a neighbor node of the second edge node in the second community; an adjustment module, used to adjust the community to which the first edge node belongs based on the first similarity and the second similarity.

[0006] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0007] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0008] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions, which, when executed by a computer, cause the computer to execute: the steps of the method described in the first aspect.

[0009] The technical solution adopted in this application can achieve the following beneficial effects: An embodiment of the present application provides a community division method, which determines a target edge based on the edge betweenness of all edges in a network, where the target edge is an edge connecting two communities in the network, and then determines a first similarity between a first edge node and a second neighbor node and a second similarity between the first edge node and the first neighbor node, where the first edge node and the second edge node are nodes at both ends of the target edge, respectively, the first edge node initially belongs to the first community of the two communities, the second edge node initially belongs to the second community of the two communities, the first neighbor node is a neighbor node of the first edge node in the first community, and the second neighbor node is a neighbor node of the second edge node in the second community, and then based on the first similarity and the second similarity, the community to which the first edge node belongs is adjusted, thereby improving the quality of community division. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 A flowchart of a community division method disclosed in an embodiment of the present application; Figure 2 A network architecture diagram disclosed in an embodiment of the present application; Figure 3 A flowchart of a community division method disclosed in an embodiment of the present application; Figure 4 A schematic diagram of an initial community disclosed in an embodiment of the present application; Figure 5 A schematic diagram of the structure of a community division device disclosed in an embodiment of the present application; Figure 6 A schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0011] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0012] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the electrically connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0013] The community division method, device, electronic device and readable storage medium disclosed in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0014] This application discloses a community division method. Figure 1 FIG. 1 is a flow chart of a community division method disclosed in an embodiment of the present application. Figure 1 As shown, the method comprises the following steps: S120. Determine a target edge based on edge betweenness of all edges in a network, wherein the network is composed of a plurality of nodes and a plurality of edges, and the target edge is an edge connecting two communities in the network.

[0015] Network architecture such as Figure 2 shown. Figure 2 The network shown is an undirected unweighted graph G(V, E), where G represents the graph, V={v1,v2,v3 ... vn} represents the node set, and E={e1,e2,e3 ... en} represents the edge set.

[0016] S140. Determine a first similarity and a second similarity, wherein the first similarity is a similarity between a first edge node and a second neighbor node, and the second similarity is a similarity between the first edge node and a first neighbor node. The first edge node and the second edge node are nodes at two ends of the target edge, respectively. The first edge node initially belongs to a first community of the two communities, and the second edge node initially belongs to a second community of the two communities. The first neighbor node is a neighbor node of the first edge node in the first community, and the second neighbor node is a neighbor node of the second edge node in the second community.

[0017] It should be noted that the neighbor nodes in this application are all direct neighbor nodes.

[0018] In the present application, the first similarity between the first edge node and the second neighbor node can be determined based on the neighbor nodes of the first edge node, the neighbor nodes of the second neighbor node, and the connection relationship between the first edge node and the second neighbor node; the second similarity between the first edge node and the first neighbor node can be determined based on the neighbor nodes of the first edge node, the neighbor nodes of the first neighbor node, and the connection relationship between the first edge node and the first neighbor node.

[0019] S160: Adjust the community to which the first edge node belongs based on the first similarity and the second similarity.

[0020] In the present application, the first edge node initially belongs to the first community, and then based on the first similarity between the first edge node and the second neighbor node, and the second similarity between the first edge node and the first neighbor node, the community to which the first edge node belongs is adjusted, thereby avoiding the generation of a large number of communities and improving the quality of community division.

[0021] An embodiment of the present application provides a community division method, which determines a target edge based on the edge betweenness of all edges in a network, where the target edge is an edge connecting two communities in the network, and then determines a first similarity between a first edge node and a second neighbor node and a second similarity between the first edge node and the first neighbor node, where the first edge node and the second edge node are nodes at both ends of the target edge, respectively, the first edge node initially belongs to the first community of the two communities, the second edge node initially belongs to the second community of the two communities, the first neighbor node is a neighbor node of the first edge node in the first community, and the second neighbor node is a neighbor node of the second edge node in the second community, and then based on the first similarity and the second similarity, the community to which the first edge node belongs is adjusted, thereby improving the quality of community division.

[0022] It should be noted that the community to which the second edge node belongs may also be adjusted in the same manner as the above method, and this application will not repeat it here.

[0023] In the embodiment of the present application, adjusting the community to which the first edge node belongs based on the first similarity and the second similarity may include: when the first similarity is greater than the second similarity, adjusting the first edge node to the second community. That is, when the first similarity between the first edge node and the second neighbor node is greater than the second similarity between the first edge node and the first neighbor node, adjusting the first edge node to the second community to which the second neighbor node belongs, so as to improve the quality of community division.

[0024] In the embodiment of the present application, before determining the target edge based on the edge betweenness of all edges in the network, the method may also include: determining a third similarity between a first node and a second node, wherein the first node and the second node are any two nodes in the network; when the third similarity is greater than a first preset threshold, determining that the second node is a similar node to the first node; and when neither the first node nor the second node is divided into a community, establishing a third community, wherein the third community includes the first node and the second node.

[0025] Exemplarily, the first preset threshold may be 0. The present application does not limit the specific value of the first preset threshold, and the specific value of the first preset threshold may be set according to actual needs.

[0026] In an implementation manner, after determining that the second node is a similar node to the first node, the method may further include: if the first node belongs to a fourth community and the second node has not been assigned to a community, assigning the second node to the fourth community.

[0027] In one implementation, after determining that the second node is a similar node to the first node, the method may further include: when the first node belongs to the fifth community and the second node belongs to the sixth community, determining the size of the fifth community and the size of the sixth community; and when the sum of the size of the fifth community and the size of the sixth community is less than a second preset threshold, merging the fifth community and the sixth community.

[0028] It should be noted that the size of the community is the number of nodes included in the community, and the second preset threshold can be set according to actual needs.

[0029] When the first node belongs to the fifth community and the second node belongs to the sixth community, and the sum of the size of the fifth community and the size of the sixth community is less than a second preset threshold, the fifth community and the sixth community are merged to reduce the number of communities and improve the quality of community division.

[0030] In an embodiment of the present application, determining the third similarity between the first node and the second node may include: determining the third similarity between the first node and the second node based on neighbor nodes of the first node, neighbor nodes of the second node, and a connection relationship between the first node and the second node.

[0031] Exemplarily, the third similarity between the first node and the second node may be determined based on the following formula: ; where u is the first node and v is the second node, is the third similarity between the first node and the second node, is the neighbor node of the first node, is the neighbor node of the second node, , that is, when the first node and the second node are directly connected neighbor nodes, ,otherwise , is the value of the adjacency matrix element corresponding to the first node and the second node in the adjacency matrix corresponding to the network. This formula is used to calculate the similarity by adding , making the directly connected molecules larger than the indirectly connected molecules. Therefore, the calculated similarity between the two directly connected nodes is greater than the similarity between the two indirectly connected nodes.

[0032] It should be noted that the first similarity between the first edge node and the second neighbor node, and the second similarity between the first edge node and the first neighbor node mentioned above can be calculated using the above formula, and this application will not repeat them here.

[0033] In an embodiment of the present application, determining the target edge based on the edge betweenness of all edges in the network may include: determining the edge betweenness of all edges in the network; and determining the edge with the largest edge betweenness as the target edge.

[0034] In the present application, the edge betweenness of all edges in the network can be calculated by the existing edge betweenness calculation method. For example, it can be calculated by the formula Calculate, s, t, v are any three nodes, is the total number of shortest paths from s to t, is the total number of paths passing through v.

[0035] The process of the community division method of this application is as follows Figure 3 As shown, a first node is randomly selected, and a second node similar to the first node is determined by traversing the nodes to calculate the similarity, and then the communities to which the first node and the second node belong are determined, and the initial community division is completed, and the nodes with higher similarity are divided into one community. Determining the communities to which the first node and the second node belong specifically includes: when the first node and the second node have not divided their communities, establishing a third community, wherein the third community includes the first node and the second node; when the first node belongs to the fourth community and the second node has not divided its community, dividing the second node into the fourth community; when the first node belongs to the fifth community and the second node belongs to the sixth community, determining the size of the fifth community and the size of the sixth community, and when the sum of the size of the fifth community and the size of the sixth community is less than the second preset threshold, merging the fifth community and the sixth community.

[0036] After the initial community division is completed, there will be cases where the edge nodes between two communities are divided incorrectly, such as Figure 4As shown, according to the network topology, node 9 belongs to the left community, but after completing the initial community division, it is mistakenly divided into the right community. Therefore, after completing the initial community division, continue to determine the target edge connecting the two communities in the network based on the edge betweenness of all edges in the network, determine the first edge node and the second edge node at both ends of the target edge, calculate the first similarity between the first edge node and the second neighbor node, calculate the second similarity between the first edge node and the first neighbor node, the first edge node initially belongs to the first community of the two communities, the second edge node initially belongs to the second community of the two communities, the first neighbor node is the neighbor node of the first edge node in the first community, and the second neighbor node is the neighbor node of the second edge node in the second community, and then adjust the community to which the first edge node belongs based on the first similarity and the second similarity to improve the quality of community division.

[0037] Table 1 gives four real network structures. Table 2 shows the test comparison results of this solution (SimEdge-CD) and existing technical solutions (Sim_closure, Walktrap, LPA, Attractor, Leiden). Normalized Mutual Information (NMI) and modularity Q are indicators for evaluating the quality of community division.

[0038] Table 1 Real network structure

[0039] Table 2 Test comparison results

[0040] As can be seen from Table 2, the Leiden method obtains the highest modularity in the four real networks, the method of this application obtains the second highest modularity in the Karate club, Football game schedule, and Ecoli networks, and the SimEdge-CD modularity ranks third in the Dolphin network. In terms of NMI measurement, the method of this application has the largest NMI value in the Dolphin and Football game schedule networks. Based on the above comparison results, the method of this application is superior to the existing methods and can divide high-quality community structures.

[0041] The community division method provided in the embodiment of the present application may be executed by a community division device. In the embodiment of the present application, the community division device provided in the embodiment of the present application is described by taking the execution of the community division method by the community division device as an example.

[0042] Figure 5 Schematic diagram of the structure of a community division device disclosed in an embodiment of the present application. Figure 5 As shown, the community division device 500 includes: a determination module 510 and an adjustment module 520 .

[0043] In the present application, a determination module 510 is used to determine a target edge based on the edge betweenness of all edges in a network, wherein the network is composed of multiple nodes and multiple edges, and the target edge is an edge in the network connecting two communities; the determination module 510 is also used to determine a first similarity and a second similarity, wherein the first similarity is the similarity between a first edge node and a second neighbor node, and the second similarity is the similarity between the first edge node and the first neighbor node, the first edge node and the second edge node are nodes at both ends of the target edge, respectively, the first edge node initially belongs to the first community of the two communities, the second edge node initially belongs to the second community of the two communities, the first neighbor node is a neighbor node of the first edge node in the first community, and the second neighbor node is a neighbor node of the second edge node in the second community; an adjustment module 520 is used to adjust the community to which the first edge node belongs based on the first similarity and the second similarity.

[0044] In an implementation, the adjustment module 520 adjusts the community to which the first edge node belongs based on the first similarity and the second similarity, including: when the first similarity is greater than the second similarity, adjusting the first edge node to the second community.

[0045] In one implementation, the above-mentioned device also includes: the determination module 510 is also used to determine the third similarity between the first node and the second node before determining the target edge based on the edge betweenness of all edges in the network, wherein the first node and the second node are any two nodes in the network; the determination module 510 is also used to determine that the second node is a similar node to the first node when the third similarity is greater than a first preset threshold; an establishment module is used to establish a third community when neither the first node nor the second node is divided into the community to which they belong, wherein the third community includes the first node and the second node.

[0046] In one implementation, the device further includes: a partitioning module, configured to, after determining that the second node is a similar node to the first node, partition the second node into the fourth community if the first node belongs to the fourth community and the second node has not been partitioned into any community.

[0047] In one implementation, the above-mentioned device also includes: the determination module 510, which is also used to determine the size of the fifth community and the size of the sixth community after determining that the second node is a similar node to the first node, when the first node belongs to the fifth community and the second node belongs to the sixth community; a merging module, which is used to merge the fifth community and the sixth community when the sum of the size of the fifth community and the size of the sixth community is less than a second preset threshold.

[0048] In one implementation, the determination module 510 determines the third similarity between the first node and the second node, including: determining the third similarity between the first node and the second node based on the neighbor nodes of the first node, the neighbor nodes of the second node, and the connection relationship between the first node and the second node.

[0049] In one implementation, the determination module 510 determines the target edge based on the edge betweenness of all edges in the network, including: determining the edge betweenness of all edges in the network; and determining the edge with the largest edge betweenness as the target edge.

[0050] The community division device provided in the embodiment of the present application can implement each process implemented in the community division method embodiment, and will not be described again here to avoid repetition.

[0051] Alternatively, if Figure 6 As shown, an embodiment of the present application also provides an electronic device 600, including a processor 601 and a memory 602, wherein the memory 602 stores programs or instructions that can be executed on the processor 601, and when the program or instructions are executed by the processor 601, the various steps of the above-mentioned community division method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not repeated here.

[0052] It should be noted that the electronic devices in the embodiments of the present application include mobile electronic devices and non-mobile electronic devices.

[0053] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned community division method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0054] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0055] An embodiment of the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes: the steps of the above-mentioned community division method.

[0056] The above embodiments of the present application focus on describing the differences between the various embodiments. As long as the different optimization features between the various embodiments are not contradictory, they can be combined to form a better embodiment. Considering the simplicity of the text, they will not be repeated here.

[0057] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A community division method, characterized in that: include: Determining a target edge based on edge betweenness of all edges in a network, wherein the network is composed of a plurality of nodes and a plurality of edges, and the target edge is an edge connecting two communities in the network; Determine a first similarity and a second similarity, wherein the first similarity is a similarity between a first edge node and a second neighbor node, the second similarity is a similarity between the first edge node and a first neighbor node, the first edge node and the second edge node are nodes at both ends of the target edge, respectively, the first edge node initially belongs to a first community of the two communities, the second edge node initially belongs to a second community of the two communities, the first neighbor node is a neighbor node of the first edge node in the first community, and the second neighbor node is a neighbor node of the second edge node in the second community; The community to which the first edge node belongs is adjusted based on the first similarity and the second similarity.

2. The method according to claim 1, characterized in that The adjusting, based on the first similarity and the second similarity, the community to which the first edge node belongs includes: When the first similarity is greater than the second similarity, the first edge node is adjusted to the second community.

3. The method according to claim 1, characterized in that Before determining the target edge based on the edge betweenness of all edges in the network, the method further includes: Determine a third similarity between a first node and a second node, wherein the first node and the second node are any two nodes in the network; When the third similarity is greater than a first preset threshold, determining that the second node is a similar node to the first node; In the case that neither the first node nor the second node is divided into a community, a third community is established, wherein the third community includes the first node and the second node.

4. The method according to claim 3, characterized in that After determining that the second node is a similar node to the first node, the method further includes: When the first node belongs to a fourth community and the second node is not assigned to a community, the second node is assigned to the fourth community.

5. The method according to claim 3, characterized in that: After determining that the second node is a similar node to the first node, the method further includes: When the first node belongs to a fifth community and the second node belongs to a sixth community, determining a size of the fifth community and a size of the sixth community; When the sum of the size of the fifth community and the size of the sixth community is smaller than a second preset threshold, the fifth community and the sixth community are merged.

6. The method according to claim 3, characterized in that The determining the third similarity between the first node and the second node includes: A third similarity between the first node and the second node is determined based on neighbor nodes of the first node, neighbor nodes of the second node, and a connection relationship between the first node and the second node.

7. A community division device, characterized in that: include: A determination module, configured to determine a target edge based on edge betweenness of all edges in a network, wherein the network is composed of a plurality of nodes and a plurality of edges, and the target edge is an edge in the network connecting two communities; The determination module is further used to determine a first similarity and a second similarity, wherein the first similarity is the similarity between the first edge node and the second neighbor node, the second similarity is the similarity between the first edge node and the first neighbor node, the first edge node and the second edge node are nodes at both ends of the target edge, the first edge node initially belongs to the first community of the two communities, the second edge node initially belongs to the second community of the two communities, the first neighbor node is a neighbor node of the first edge node in the first community, and the second neighbor node is a neighbor node of the second edge node in the second community; An adjustment module is used to adjust the community to which the first edge node belongs based on the first similarity and the second similarity.

8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the community division method according to any one of claims 1 to 6 are implemented.

9. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the community division method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer is caused to execute: the steps of the community division method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Software performance real-time monitoring system and method fused with edge computing

    CN120256239A