Community discovery method based on enumeration of maximal directed dense subgraphs
By transforming social network data into directed dense subgraphs and enumerating them, and utilizing the maximal directed dense subgraph enumeration method, the accuracy problem of community discovery in large social platforms is solved, and efficient identification of large-scale communities is achieved.
Patent Information
- Application Number
- CN202410755778.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2044-06-12
AI Technical Summary
There is a lack of effective methods in the current technology to accurately discover large-scale communities, especially in large social platforms where there is a lack of community discovery methods based on social network data.
By transforming social network data into directed dense subgraphs, using the maximal directed dense subgraph enumeration method, sets are generated based on the minimum in-degree of vertices. Target subgraphs are then generated through recursive enumeration and pivot point updates, ultimately determining the target community.
It enables the accurate discovery of large-scale communities from social network data, improving the accuracy and efficiency of community identification.
Smart Images

Figure CN118710429B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and particularly relates to a community discovery method based on enumeration of maximal directed dense subgraphs. BACKGROUND
[0002] There are a large number of social users in a large social platform, and a community refers to a group of social users with the same social circle or the same interest preference, and identifying the community in the social platform can realize more accurate social recommendation or content recommendation. However, due to the large number of social users in the large social platform, a large amount of social network data will be generated, and there is currently no good method for accurately discovering large-scale communities based on the social network data. SUMMARY
[0003] The present application provides a community discovery method based on enumeration of maximal directed dense subgraphs, to solve the defect that all large-scale communities cannot be accurately discovered based on social network data in the prior art, and to accurately discover large-scale communities from social network data.
[0004] The present application provides a community discovery method based on enumeration of maximal directed dense subgraphs, comprising:
[0005] The social network data to be processed is converted into a to-be-processed graph, the to-be-processed graph includes a plurality of vertices and a plurality of directed edges, the vertices in the to-be-processed graph correspond to social network users in the to-be-processed social network data, and the directed edges in the to-be-processed graph correspond to association information between the social network users in the to-be-processed social network data;
[0006] The vertices in the to-be-processed graph are sorted based on the minimum out-degree and in-degree of each vertex, to obtain a first sorting result, and a total branch corresponding to each vertex is generated based on the first sorting result, the total branch corresponds to a set group, the set group includes a mandatory set, a candidate set and an exclusion set which are disjoint, the mandatory set and the exclusion set corresponding to the total branch respectively include related points before and after the vertex corresponding to the total branch in the first sorting result, and the distance between the related points and the vertex corresponding to the total branch in the to-be-processed graph is less than or equal to 2;
[0007] recursively enumerate each of the total branches to obtain a target subgraph corresponding to the total branch, in the process of recursively enumerating the total branch, updating the set group corresponding to the branch based on the pivot point to generate a plurality of branches, each branch corresponding to a set group, determining a target branch in each branch of the total branch, taking the point in the mandatory set corresponding to the target branch as a target vertex, the pivot point being the vertex in the mandatory set and the candidate set in the set group, the mandatory set corresponding to the target branch corresponding to a target subgraph, the target subgraph being a maximum subgraph in the to-be-processed graph with a size exceeding a preset limit value and satisfying a first constraint condition, the first constraint condition being that the out-degree of each vertex is not less than n-k and the in-degree is not less than n-l, n being the number of vertices in the to-be-processed graph, k and l being positive integers greater than or equal to 1;
[0008] determining a target community based on all the target subgraphs, the social network users in the target community being the social network users corresponding to the vertices in the target subgraph.
[0009] According to the community discovery method based on maximum directed dense subgraph enumeration provided by the application, the related points also satisfy a second constraint condition, and the second constraint condition is:
[0010] If there is a directed edge between the related point and the vertex corresponding to the total branch, the number of points in the intersection of the first connection point set and the second connection point set is greater than a first value, the first connection point being a neighbor of the related point and the vertex corresponding to the total branch, respectively, and the first value being a difference value between twice the minimum value of the preset limit value and k and l;
[0011] If there is no directed edge between the related point and the vertex corresponding to the total branch, the number of points in the intersection of the first connection point set and the second connection point set is greater than a second value, and the second value is a difference value between twice the minimum value of the preset limit value and k and l plus 2.
[0012] According to the community discovery method based on maximum directed dense subgraph enumeration provided by the application, the updating of the set group corresponding to the branch based on the pivot point to generate a plurality of branches comprises:
[0013] When the pivot point belongs to the mandatory set in the set group:
[0014] Batching the first type of points in the candidate set into the mandatory set and the exclusion set to generate a plurality of first branches, determining a continue branch or a pruning branch based on the mandatory set corresponding to each first branch;
[0015] adding the remaining second type points in the candidate set to the mandatory set or the excluded set in batches to generate a plurality of second branches, determining to continue a branch or to prune a branch based on the mandatory set corresponding to each of the second branches, the remaining second type points being points in the second type points after removing the first type points corresponding to the pruned first branches;
[0016] when the first type point is an out-edge neighbor of the hub point, the second type point is an in-edge neighbor of the hub point, and when the first type point is an in-edge neighbor of the hub point, the second type point is an out-edge neighbor of the hub point;
[0017] when the hub point belongs to the candidate set in the set group:
[0018] adding the hub point to the excluded set to generate a new branch;
[0019] obtaining an upper bound corresponding to a branch after adding the hub point to the mandatory set, determining whether the upper bound exceeds the preset limit value, if yes, adding the hub point to the mandatory set to generate a new branch, and if no, pruning the branch, the upper bound corresponding to the branch reflecting a maximum size of a maximal subgraph satisfying the first constraint condition formed by points in the mandatory set and the candidate set corresponding to the branch.
[0020] According to the social group discovery method based on maximal directed dense subgraph enumeration provided by the application, the determination of the branch to be continued or pruned based on the mandatory set corresponding to each of the first branches and the determination of the branch to be continued or pruned based on the mandatory set corresponding to each of the second branches comprises:
[0021] when the branch is constructed based on the hub point in the mandatory set, determining whether the mandatory set corresponding to the branch satisfies the first constraint condition, if yes, continuing the branch, and if no, pruning the branch.
[0022] According to the social group discovery method based on maximal directed dense subgraph enumeration provided by the application, the obtaining of the upper bound corresponding to the branch after adding the hub point to the mandatory set comprises:
[0023] sorting out-edge neighbors of the hub point in ascending order of the number of non-in-edge neighbors in the mandatory set to obtain a second sorting result;
[0024] acquire the maximum i that makes the number of newly added non-out-edge neighbors not greater than the non-out-edge neighbor number limit as the out-degree reference value, wherein the newly added non-out-edge neighbor number is the number of newly added non-out-edge neighbors in the mandatory set after the first i points in the second sorting result are added to the mandatory set, and the non-out-edge neighbor number is the sum of the maximum number of non-out-edge neighbors that can be accommodated under the premise that the out-degree of all points in the mandatory set corresponding to the branch is not less than n-k;
[0025] sum the size of the mandatory set corresponding to the branch, the out-degree reference value, k, and the difference between the non-out-edge neighbor number of the hub point in the mandatory set corresponding to the branch to obtain an out-degree upper bound value corresponding to the branch;
[0026] acquire an in-degree upper bound value corresponding to the branch, and take the minimum value of the out-degree upper bound value and the in-degree upper bound value as the upper bound.
[0027] According to the community discovery method based on the enumeration of the maximum directed dense subgraph provided by the application, the acquisition of the upper bound of the branch corresponding to the hub point added to the mandatory set comprises:
[0028] sort the neighbors of the hub point in ascending order of the minimum out-degree and in-degree in the mandatory set corresponding to the branch to obtain a third sorting result;
[0029] sequentially traverse the points in the third sorting result as to-be-processed points to process the to-be-processed points to remove the to-be-processed points from the third sorting result or keep the to-be-processed points;
[0030] sum the size of the mandatory set, the number of points kept in the third sorting result, and the maximum number of neighbors of the hub point that can be accommodated in the mandatory set under the first preset condition to obtain the upper bound;
[0031] when processing each to-be-processed point, the following operations are performed:
[0032] select a point with the minimum accommodated non-out-edge neighbor number from the non-in-edge neighbors of the to-be-processed point in the mandatory set as a first point, and select a point with the minimum accommodated non-in-edge neighbor number from the non-out-edge neighbors of the to-be-processed point in the mandatory set as a second point, wherein the accommodated non-out-edge neighbor number is the number of non-out-edge neighbors that can be accommodated in the mandatory set, and the accommodated non-in-edge neighbor number is the number of non-in-edge neighbors that can be accommodated in the mandatory set;
[0033] if the accommodated non-out-edge neighbor number of the first point and the accommodated non-in-edge neighbor number of the second point are both greater than 0, then subtract 1 from the accommodated non-out-edge neighbor number of the first point and the accommodated non-in-edge neighbor number of the second point;
[0034] If the first point has the contained non-out-edge neighbor number or the second point has the contained non-in-edge neighbor number not greater than 0, the to-be-processed point is removed from the third sorting result.
[0035] The application further provides a community discovery device based on enumeration of a maximum directed dense subgraph, comprising:
[0036] a graph conversion module, configured to convert to-be-processed social network data into a to-be-processed graph, the to-be-processed graph comprising a plurality of vertices and a plurality of directed edges, the vertices in the to-be-processed graph corresponding to social network users in the to-be-processed social network data, and the directed edges in the to-be-processed graph corresponding to association information between the social network users in the to-be-processed social network data; a preprocessing module, configured to sort the vertices in the to-be-processed graph based on the minimum out-degree and in-degree of each vertex, to obtain a first sorting result, and to generate a total branch corresponding to each vertex based on the first sorting result, the total branch corresponding to a set group, the set group comprising a mandatory set, a candidate set and an excluded set which are disjoint from each other, the initial values of the mandatory set and the excluded set corresponding to the total branch respectively comprising relevant points before and after the vertex corresponding to the total branch in the first sorting result, the distance between the relevant points and the vertex corresponding to the total branch in the to-be-processed graph being less than or equal to 2;
[0037] a recursive enumeration module, configured to recursively enumerate each total branch to obtain a target subgraph corresponding to the total branch, in the process of recursively enumerating the total branch, updating the set group corresponding to a branch based on a pivot point to generate a plurality of branches, each branch corresponding to a set group, determining a target branch in each branch of the total branch, taking the points in the mandatory set corresponding to the target branch as target vertices, the pivot point being the vertices in the mandatory set and the candidate set in the set group, the mandatory set corresponding to the target branch corresponding to a target subgraph, the target subgraph being a maximum subgraph in the to-be-processed graph which has a size exceeding a preset limit value and satisfies a first constraint condition, the first constraint condition being that the out-degree of each vertex is not less than n-k and the in-degree of each vertex is not less than n-l, n being the number of vertices in the to-be-processed graph, and k and l being positive integers greater than or equal to 1;
[0038] a community determination module, configured to determine a target community based on all the target subgraphs, the social network users in the target community being the social network users corresponding to the vertices in the target subgraph.
[0039] The application further provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and capable of running on the processor, the processor implementing the program to realize the community discovery method based on enumeration of a maximum directed dense subgraph according to any one of the above.
[0040] The application further provides a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the community discovery method based on enumeration of maximal directed dense subgraphs according to any of the above.
[0041] The application further provides a computer program product comprising a computer program which, when executed by a processor, implements the community discovery method based on enumeration of maximal directed dense subgraphs according to any of the above.
[0042] The application provides a community discovery method based on enumeration of maximal directed dense subgraphs, which comprises the following steps: converting to-be-processed social network data into a to-be-processed graph, the to-be-processed graph comprising a plurality of vertices and a plurality of directed edges, the vertices in the to-be-processed graph corresponding to social network users in the to-be-processed social network data, and the directed edges in the to-be-processed graph corresponding to association information between the social network users in the to-be-processed social network data; sorting each vertex in the to-be-processed graph based on the minimum value of the out-degree and the in-degree of the vertex, to obtain a first sorting result, and generating a total branch corresponding to each vertex based on the first sorting result, the total branch corresponding to a set group, the set group comprising a mandatory set, a candidate set and an excluded set which are disjoint from each other, the initial values of the mandatory set and the excluded set corresponding to the total branch respectively comprising relevant points before and after the vertex corresponding to the total branch in the first sorting result, the distance between the relevant points and the vertex corresponding to the total branch in the to-be-processed graph being less than or equal to 2; recursively enumerating each total branch to obtain a target subgraph corresponding to the total branch, in the process of recursively enumerating the total branch, updating the set group corresponding to the branch based on a pivot point to generate a plurality of branches, each branch corresponding to a set group, determining a target branch in each branch of the total branch, taking the points in the mandatory set corresponding to the target branch as target vertices, the pivot point being the vertices in the mandatory set and the candidate set in the set group, the mandatory set corresponding to the target branch corresponding to the target subgraph, and the target subgraph being a maximal subgraph in the to-be-processed graph which has a size exceeding a preset limit value and satisfies a first constraint condition, the first constraint condition being that the out-degree of each vertex is not less than n-k and the in-degree of each vertex is not less than n-l, n being the number of vertices in the to-be-processed graph, and k and l being positive integers greater than or equal to 1; and determining a target community based on all the target subgraphs, the social network users in the target community being the social network users corresponding to the vertices in the target subgraph.
[0043] The method provided by this invention transforms the social network data to be processed into a graph to be processed. For each vertex in the graph, a corresponding set group is generated. Branches are generated by recursively enumerating the set groups corresponding to the vertices, ultimately yielding a target subgraph. The target subgraph is a maximal subgraph in the graph to be processed whose size exceeds a preset limit, and whose out-degree of each vertex is not less than nk and in-degree is not less than nl. Target communities are determined based on the target subgraph. This allows for the accurate discovery of large-scale communities from social networks by searching for maximal dense subgraphs exceeding the preset limit in the graph corresponding to the social network data to be processed. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0045] Figure 1 This is a flowchart illustrating a community discovery method based on maximally directed dense subgraph enumeration provided by the present invention.
[0046] Figure 2 This is a schematic diagram of a directed graph;
[0047] Figure 3 This is a pseudocode diagram illustrating the overall framework of a community discovery method based on maximally directed dense subgraph enumeration provided by this invention.
[0048] Figure 4 This is a pseudocode diagram illustrating the updating of the candidate set and the exclusion set in a social discovery method based on maximal directed dense subgraph enumeration provided by the present invention.
[0049] Figure 5 This is a pseudocode illustration of the preprocessing in a community detection method based on maximally directed dense subgraph enumeration provided by the present invention;
[0050] Figure 6 This is a pseudocode illustration of the branching rules in a community detection method based on maximally directed dense subgraph enumeration provided by this invention. Figure 1 ;
[0051] Figure 7 This is a pseudocode illustration of the branching rules in a community discovery method based on maximally directed dense subgraph enumeration provided by this invention. Figure 2 ;
[0052] Figure 8 This is a schematic diagram of a community discovery device based on maximally directed dense subgraph enumeration provided by the present invention.
[0053] Figure 9 is a structural schematic diagram of an electronic device provided by the present application. DETAILED DESCRIPTION
[0054] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described clearly and completely below with reference to the drawings in the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.
[0055] The present application provides a community discovery method based on maximum directed dense subgraph enumeration. Figures 1-7 The present application provides a community discovery method based on maximum directed dense subgraph enumeration.
[0056] As shown in the method provided by the present application, the method comprises the steps of: Figure 1
[0057] S110, converting the to-be-processed social network data into a to-be-processed graph, the to-be-processed graph comprising a plurality of vertices and a plurality of directed edges, the vertices in the to-be-processed graph corresponding to the social network users in the to-be-processed social network data, and the directed edges in the to-be-processed graph corresponding to the association information between the social network users in the to-be-processed social network data;
[0058] S120, sorting the vertices in the to-be-processed graph based on the out-degree and in-degree minimum values of the vertices, obtaining a first sorting result, and generating a total branch corresponding to each vertex based on the first sorting result, the total branch corresponding to a set group, the set group comprising a compulsory set, a candidate set and an exclusion set which are disjoint from each other, and the initial values of the compulsory set and the exclusion set corresponding to the total branch respectively comprising the related points before and after the vertex corresponding to the total branch in the first sorting result, the distance between the related points and the vertex corresponding to the total branch in the to-be-processed graph being less than or equal to 2;
[0059] S130, recursively enumerate each total branch to obtain a target subgraph corresponding to the total branch, in the process of recursively enumerating the total branch, update the set group corresponding to the branch based on the hub point to generate a plurality of branches, each branch corresponding to a set group, determine a target branch in each branch of the total branch, take the point in the mandatory set corresponding to the target branch as a target vertex, the hub point is the vertex in the mandatory set and the candidate set in the set group, the mandatory set corresponding to the target branch corresponds to the target subgraph, the target subgraph is a maximum subgraph in the to-be-processed graph with a size exceeding a preset limit value and satisfying a first constraint condition, the first constraint condition is that the out-degree of each vertex is not less than n-k and the in-degree is not less than n-l, n is the number of vertices in the to-be-processed graph, k and l are positive integers greater than or equal to 1;
[0060] S140, determine a target community based on all target subgraphs, the social network users in the target community are the social network users corresponding to the vertices in the target subgraph.
[0061] The to-be-processed social network data can be generated based on the process of using a social platform by a social user, and in the present application, the acquisition and storage of the to-be-processed social network data can be performed within the scope allowed by applicable laws and regulations based on the consent of the social user.
[0062] When converting the to-be-processed social network data into a to-be-processed graph, each social user in the to-be-processed social network data is taken as a vertex in the to-be-processed graph, and a directed edge in the to-be-processed graph is generated based on the association information between the social users in the to-be-processed social network data. The association information can reflect the attention and interaction between the social users. For example, when a social user A follows a social user B on a social platform, a directed edge from A to B can be generated, or when A frequently likes and comments on the content published by B, a directed edge from A to B can be generated.
[0063] The size of the graph refers to the number of vertices included in the graph. First, the (k, l)-plex is explained. In a directed (k, l)-plex with n vertices, the out-degree of any vertex is required to be at least n_k, and the in-degree is required to be at least n_l. For a large graph, there are many (k, l)-plex subgraphs (for k, l≥2, any two points can form a (k, l)-plex). In the method provided by the present application, the purpose of discovering large-scale communities is achieved by finding a maximum (k, l)-plex subgraph with a size exceeding a preset size limit.
[0064] In a simple directed graph G with n vertices, if a vertex in the graph satisfies the out-degree greater than or equal to n_k, the vertex is called k-satisfied, otherwise it is called k-unsatisfied. Similarly, if the in-degree of a vertex is greater than or equal to n_l, the vertex is called l-satisfied, otherwise it is called l-unsatisfied. In a directed graph G, given two positive integers k, l≥1, for a derived subgraph H of the graph, if H is a (k, l)-plex, and there is no other derived subgraph H' of the graph such that and H' is also a (k, l)-plex, then H is called a maximal (k, l)-plex of the graph. As shown in the graph Figure 2 , the derived subgraph {0, 1, 2} is a maximal (1, 1)-plex.
[0065] Therefore, in a directed graph G, given two positive integers k, l≥1 and a positive integer q≥1, for a maximal (k, l)-plex H of the graph, if |H|≥q, then H is called a maximal (k, l)-plex of the graph G with a size limit of q.
[0066] As shown in the graph Figure 3 , the basic flow of the method provided by the present application is as follows:
[0067] 1. After obtaining the to-be-processed graph, first, pre-process it to obtain a plurality of set groups, each set group including a mandatory set P, a candidate set C and an exclusion set X which are disjoint from each other, and call the recursive enumeration method (MBDP) for each set group obtained by pre-processing to perform the first recursive enumeration Figure 3 in lines 1-2.
[0068] 2. Determine whether P (lines 4-6) or P∪C (lines 8-11) in the current recursion has met the maximality and size limit.
[0069] 3. Use a multiple branching algorithm based on a pivot point (line 7) to perform the second recursive enumeration according to the attribution of the pivot point v (lines 12-21).
[0070] 4. When v∈C and it is put into P, call the upper bound algorithm to check the rationality of the new branch (line 19), that is, whether the upper bound of the size of the point set of the maximal (k, l)-plex in the new branch exceeds the size limit q.
[0071] The method provided by the application divides the vertex set of the graph to be processed into three mutually disjoint parts: a mandatory set P, a candidate set C and an exclusion set X. The mandatory set P represents the vertex set of the (k, l)-plex selected in this round of recursion; the candidate set C represents the vertex set that has not been selected before this round of recursion and can still make P satisfy the (k, l)-plex after being added to P; and the exclusion set X represents the vertex set that has been selected before this round of recursion and can still make P satisfy the (k, l)-plex after being added to P. Obviously, when C and X are both empty sets, the (k, l)-plex obtained in P is a maximal (k, l)-plex. Wherein, C and X are updated through the update method (such as lines 9, 15 and 20 in Figure 3 ) after P changes to ensure that the definitions thereof are satisfied, as shown in Figure 4 .
[0072] The pre-processing process of the graph to be processed is the process of generating the set group corresponding to each total branch, that is, the process of generating the first branch corresponding to each vertex in the graph to be processed. The process is based on Theorem One and Theorem Two:
[0073] Theorem One: In a directed graph G, given a (k, l)-plex H. If |H| > k + l - 2, then the distance between any two points in H, diam(G[H]) ≤ 2, and |H| represents the number of vertices in H. The distance between any two points in the graph refers to the minimum number of edges that can form a path between the two points in the graph.
[0074] Theorem Two (pruning rule): In a directed graph G = (V, E), given a (k, l)-plex H. If |H| > k + l - 2, then for any two points u, v ∈ V:
[0075] If the directed edge <u, v> ∈ E or the directed edge <v, u> ∈ E, then |N G (u) ∩ N G (v)| ≥ |H| - 2min{k, l}.
[0076] If the directed edge and the directed edge , then |N G (u) ∩ N G (v)| ≥ |H| - 2min{k, l} + 2.
[0077] Based on Theorem One, the total branch corresponding to each vertex can be initially generated, as shown in Figure 5 , wherein represents the out-degree neighbor of v i in G, represents the in-degree neighbor of v i in G, represents the vertexi In G, there exists a point with an out-degree distance of 2 (i.e., an intermediate point v). i The neighbor who went out, and (It is the out-degree neighbor of this point), Indicates v i In G, there exists a point with an in-degree distance of 2 (i.e., an intermediate point v). i in-degree neighbors, and (These are the in-degree neighbors of that point). In other words, the required and excluded sets corresponding to the main branch include relevant points in the first sorting result that are after and before the vertex corresponding to the main branch, and the distance between the relevant points and the vertex corresponding to the main branch in the graph to be processed is less than or equal to 2.
[0078] Based on Theorem 2, further constraints can be applied to the main branch to reduce its number and subsequent data processing volume. Specifically, the second relevant point must satisfy the second constraint condition: if there is a directed edge between the relevant point and the vertex corresponding to the main branch, the number of points in the intersection of the first and second connection point sets is greater than the first value. The first connection point is the neighbor of the relevant point and the vertex corresponding to the main branch, respectively. The first value is the difference between the preset limit value and twice the minimum value among k and l. If there is no directed edge between the relevant point and the vertex corresponding to the main branch, the number of points in the intersection of the first and second connection point sets is greater than the second value. The second value is the difference between the preset limit value and twice the minimum value among k and l plus 2.
[0079] This invention sorts the vertices in ascending order according to the minimum out-degree and in-degree of each vertex as {v1, ..., v...} n}( Figure 3 (Line 2 in the text). For each branch, only keep the part related to v. i Points that satisfy Theorem 1 and Theorem 2 between them form the candidate set C and the exclusion set X. Figure 3 Lines 3-7 in the code). For each group of P, C, X obtained from this, the MBDP method is called for the first recursive enumeration ( Figure 3 (Line 8 in the text).
[0080] In the method provided by this invention, the generation of new branches during the recursive enumeration process is handled separately based on the attribution of pivot points. When generating a new branch based on a branch, each point in the intersection of the required set and the candidate set of the branch is taken as a pivot point, and branches are generated separately based on the pivot points. For example... Figure 3 As shown, before updating the set group corresponding to the branch based on the hub point to generate multiple branches, it is first determined whether the branch set where the hub point is located satisfies the condition. Figure 3 If lines 8-10 in the code do not meet the requirements, update the set group corresponding to the branch based on the pivot point to generate multiple branches.
[0081] Updating the set groups corresponding to the branches based on the pivot point to generate a plurality of branches, comprising:
[0082] When the pivot point belongs to the mandatory set in the set groups:
[0083] Adding the first type points in the candidate set to the mandatory set and the excluded set in batches to generate a plurality of first branches, determining to continue branching or pruning branching based on the mandatory set corresponding to each first branch;
[0084] Adding the remaining second type points in the candidate set to the mandatory set or the excluded set in batches to generate a plurality of second branches, determining to continue branching or pruning branching based on the mandatory set corresponding to each second branch, the remaining second type points being the points in the second type points after removing the first type points corresponding to the pruned first branches;
[0085] When the first type point is an out-edge neighbor of the pivot point, the second type point is an in-edge neighbor of the pivot point, and when the first type point is an in-edge neighbor of the pivot point, the second type point is an out-edge neighbor of the pivot point;
[0086] When the pivot point belongs to the candidate set in the set groups:
[0087] Adding the pivot point to the excluded set to generate a new branch;
[0088] Obtaining an upper bound corresponding to the branch after adding the pivot point to the mandatory set, determining whether the upper bound exceeds a preset limit value, if yes, adding the pivot point to the mandatory set to generate a new branch, if not, pruning the branch, the upper bound corresponding to the branch reflecting the maximum size of a maximum subgraph satisfying the first constraint condition formed by the points in the mandatory set and the candidate set corresponding to the branch.
[0089] Specifically, when v∈P, the out-degree of v in P is The number of points in P that are not out-edge neighbors of v is To make v keep k-satisfied, at most non-out-edge neighbors of v in the candidate set C can be selected and put into the mandatory set P. Similarly, to make v keep l-satisfied, at most non-in-edge neighbors of v in the candidate set C can be selected and put into the mandatory set P. Therefore, in the method provided by the present application, the following branching rules are given for the pivot point v:
[0090] Taking the out-degree as an example.
[0091] Let that is, the number of non-out-edge neighbors of v in the candidate set C is m, and the number of non-out-edge neighbors that v can accommodate in the mandatory set P is p. Then, according to the rules as shown in Figure 6 r+1 branches (r=min(m, p)) are constructed. The in-degree is the same.
[0092] In one possible implementation, branches can be generated independently based on out-degree and in-degree, respectively. However, to reduce computational cost, in another possible implementation, the process of generating new branches based on the pivot point is as follows: Figure 7 As shown. Figure 7 In the expression, when v∈P, the number of branches for degree (rows 2 and 4) and the number of branches for in-degree (rows 3-4) are calculated respectively. Considering that outSet∩inSet may not be an empty set, choosing the side with the smallest number of branches first can reduce the size of the set on the other side. Therefore, the sets with the first branch and the sets with the second branch are obtained according to the size of the number of branches. Figure 7 (line 5 in the text), then according to the branching rule ( Figure 6 ) build branches in sequence ( Figure 7 (Lines 6 and 10 in the text).
[0093] For the branch obtained after two constructions, if P′ satisfies (k, l)-plex, then continue to call the MBDP method. Figure 7 (Lines 11-14 in the document). That is, determining the continuation or pruning branch based on the mandatory set corresponding to each first branch, and determining the continuation or pruning branch based on the mandatory set corresponding to each second branch, including:
[0094] When a branch is constructed based on a pivot point in a mandatory set, determine whether the mandatory set corresponding to the branch satisfies the first constraint condition. If so, continue the branching process; otherwise, prune the branch.
[0095] When v∈C, we only need to consider placing it into the required set P or the excluded set X, respectively. When v is placed into X, since P remains unchanged, there is no need to update it; we can directly call the MBDP method. Figure 7 (Line 15 in the text). When v is put into P, since P will be updated, the upper bound algorithm needs to be called to calculate whether the upper bound of the size of the point set of the maximum (k, l)-plex in this branch exceeds the size limit q. If it is satisfied, the branch can continue to call the MBDP method. Figure 7 (Lines 16-18 in the code), otherwise the branch can be pruned.
[0096] In other words, when v∈C, before putting v into P to branch the current branch, it is first determined whether the upper bound of the size of the maximum (k, l)-plex point set in the branch generated after putting v into P exceeds the preset size limit. If so, a new branch is generated to put v into P; otherwise, a new branch is not generated to put v into P.
[0097] The method provided in this invention offers two ways to determine the upper bound: a method that considers the in-degree and out-degree tolerance relationships separately, and a method that considers both in-degree and out-degree tolerance relationships simultaneously. These will be described separately below.
[0098] When determining the upper bound by considering the in-degree and out-degree tolerance relationships separately, the upper bound corresponding to the branch after adding the pivot point to the mandatory set is obtained, including:
[0099] Sort the outgoing neighbors of the hub in ascending order according to the number of non-incoming neighbors in the mandatory set to obtain the second sorting result;
[0100] The largest value i that makes the number of newly added non-outgoing neighbors no greater than the limit of the number of non-outgoing neighbors is obtained as the out-degree reference value. The number of newly added non-outgoing neighbors is the minimum number of non-outgoing neighbors added to the required set corresponding to the branch after adding the first i points in the second sorting result to the required set corresponding to the branch. The number of non-outgoing neighbors is the sum of the maximum number of non-outgoing neighbors that can be accommodated under the premise that the out-degree of all points in the required set corresponding to the branch is not less than nk.
[0101] The upper bound of the out-degree of the branch is obtained by summing the differences between the size of the required set corresponding to the branch, the out-degree reference value, k and the number of non-out-edge neighbors of the pivot point in the required set corresponding to the branch;
[0102] Obtain the upper bound of the in-degree for each branch, and use the minimum of the upper bound of the out-degree and the upper bound of the in-degree as the upper bound.
[0103] The method of determining the upper bound by considering the in-degree and out-degree tolerance relationships is based on Theorem 3 and Theorem 4.
[0104] Theorem 3: In an undirected graph G = (V, E), given a required set P and a candidate set C.
[0105] For v∈C, all u∈N C (v) According to the number of non-neighbors of point u in P Sort in ascending order, and let the sorting result be N. C (v) = {u1, ..., u} d}.set up For N C The first i points in (v), i.e.
[0106] make After all points are added to P, the minimum number of new non-neighbors added to P is . Let the sum of the maximum number of non-neighbors that a point in P can accommodate while satisfying k-satisfied conditions be .
[0107] Then, among all k-plexes containing P in the derived subgraph G[P∪C], the size ω of the k-plex with the largest point set is:
[0108]
[0109] In the above formula, |P| is the number of points that must exist in the maximum k-plex, represents the number of non-neighbors that can be accommodated for v under the premise of k-satisfied, and the last part represents the number of points selected in C as much as possible.
[0110] In the last part, since it is selected from N C (v) points, v is always k-satisfied. However, the algorithm does not strictly guarantee whether the points in P are still k-satisfied, but when fill(P, C, i) exceeds sup(P), it is not a k-plex, thus obtaining a relatively tight upper bound.
[0111] Applying Theorem Three to a directed graph, we can get:
[0112] Theorem Four: In a directed graph G=(V, E), given a mandatory set P and a candidate set C.
[0113] For v∈C, all non-incoming edge neighbors of point u in P are sorted in ascending order, and let the sorted result be Let be the first i points in , that is
[0114] Let the number of all points in P after being put into P be Let the sum of the maximum number of non-outgoing edge neighbors that all points in P can accommodate under the premise of k-satisfied be
[0115] Then in the (k, l)-plex containing P in the derived subgraph G[P∪C], the size of the largest (k, l)-plex ω has:
[0116]
[0117] Similarly, only consider the in-degree, that is, replace the out-degree used in the process of considering the out-degree calculation with the in-degree, and the in-degree with the out-degree, we can get:
[0118]
[0119] Therefore, select the minimum value of and as the upper bound.
[0120] When the way of determining the upper bound by simultaneously considering the out-degree and in-degree accommodation relationship is adopted, the upper bound corresponding to the branch after the hub point is added to the mandatory set is obtained, comprising:
[0121] The neighbors of the hub point are sorted in ascending order according to the minimum value of the out-degree and in-degree in the mandatory set corresponding to the branch to obtain a third sorting result; and the points in the third sorting result are sequentially traversed as a to-be-processed point for processing to remove the to-be-processed point from the third sorting result or keep it;
[0122] The size of the mandatory set, the number of points kept in the third sorting result, and the number of neighbors of the hub point that can be accommodated in the mandatory set under the first preset condition are summed up to obtain the upper bound;
[0123] When each to-be-processed point is processed, the following operations are performed:
[0124] A point with the smallest number of accommodated non-out-edge neighbors is selected as a first point from the non-in-edge neighbors of the to-be-processed point in the mandatory set, and a point with the smallest number of accommodated non-in-edge neighbors is selected as a second point from the non-out-edge neighbors of the point in the mandatory set, the number of accommodated non-out-edge neighbors is the number of non-out-edge neighbors that can be accommodated in the mandatory set, and the number of accommodated non-in-edge neighbors is the number of non-in-edge neighbors that can be accommodated in the mandatory set;
[0125] If the number of accommodated non-out-edge neighbors of the first point and the number of accommodated non-in-edge neighbors of the second point are both greater than 0, the number of accommodated non-out-edge neighbors of the first point and the number of accommodated non-in-edge neighbors of the second point are both reduced by 1;
[0126] If the number of accommodated non-out-edge neighbors of the first point or the number of accommodated non-in-edge neighbors of the second point is not greater than 0, the to-be-processed point is removed from the third sorting result.
[0127] The way of determining the upper bound by simultaneously considering the out-degree and in-degree accommodation relationship is realized based on theorem five.
[0128] Theorem five: in a directed graph G=(V, E), given a mandatory set P and a candidate set C. For v∈C, calculate all u∈N C (v) sort {u1,..., u n} in ascending order according to the minimum value of the out-degree and in-degree of point u in P.
[0129] For any w∈P, calculate the number of non-out-edge neighbors and the number of non-in-edge neighbors
[0130] Select v i in order to perform the following operations:
[0131] From the non-in-edge neighbor i of u and non-out-neighbor Select the point w1, w2 with the minimum sup(w1, P) and sup(w2, P) value from the set ).
[0132] If sup + (w1, P) > 0 and sup(w2, P) > 0, then reduce sup+(w1, P) and sup-(w2, P) by 1.
[0133] Otherwise, remove u i from N C (v).
[0134] Let R be the number of points remaining in N C (v) after the operation, then in all (k, l)-plexes containing P in the derived subgraph G[P∪C], the size ω of the (k, l)-plex with the largest point set size is:
[0135]
[0136] In the theorem, |P| is the number of points that must exist in the maximum (k, l)-plex, represents the maximum number of non-neighbors (including non-out-neighbor and non-in-neighbor) that can be accommodated for a point v under the premise of k-satisfied and l-satisfied, and R represents the number of points selected as much as possible in C.
[0137] Before recursively enumerating each branch corresponding set group, if the candidate set and the exclusion set in the set group are both empty sets, and the number of points in the mandatory set is greater than the preset limit value, the recursive enumeration of the branch is not performed, and the subgraph of the vertices in the mandatory set in the to-be-processed data graph is output as the target subgraph.
[0138] All target subgraphs are regarded as a target community, and a community with a size greater than a preset limit value is accurately discovered from to-be-processed social data.
[0139] A community discovery device based on maximum directed dense subgraph enumeration provided by the present application is described below. The community discovery device based on maximum directed dense subgraph enumeration described below can be correspondingly referred to the community discovery method based on maximum directed dense subgraph enumeration described above. As shown in Figure 8 The community discovery device based on maximum directed dense subgraph enumeration provided by the present application includes:
[0140] The graph conversion module 810 is configured to convert the to-be-processed social network data into a to-be-processed graph, the to-be-processed graph including a plurality of vertices and a plurality of directed edges, the vertices in the to-be-processed graph corresponding to social network users in the to-be-processed social network data, and the directed edges in the to-be-processed graph corresponding to association information between the social network users in the to-be-processed social network data;
[0141] The preprocessing module 820 is configured to sort the vertices in the to-be-processed graph based on minimum out-degree and in-degree of each vertex, to obtain a first sorting result, and to generate a total branch corresponding to each vertex based on the first sorting result, the total branch corresponding to a set group, the set group including a mandatory set, a candidate set and an exclusion set which are disjoint from each other, and the initial values of the mandatory set and the exclusion set corresponding to the total branch respectively including relevant points before and after the vertex corresponding to the total branch in the first sorting result, the distance between the relevant points and the vertex corresponding to the total branch in the to-be-processed graph being less than or equal to 2.
[0142] The recursive enumeration module 830 is configured to recursively enumerate each total branch to obtain a target subgraph corresponding to the total branch, and in the process of recursively enumerating the total branch, to update the set group corresponding to the branch based on a pivot point to generate a plurality of branches, each branch corresponding to a set group, to determine a target branch in each branch of the total branch, to take the points in the mandatory set corresponding to the target branch as target vertices, and to take the vertices in the mandatory set and the candidate set in the set group as the pivot point, the mandatory set corresponding to the target branch corresponding to the target subgraph, the target subgraph being a maximal subgraph in the to-be-processed graph whose size exceeds a preset limit value and which satisfies a first constraint condition, and the first constraint condition being that the out-degree of each vertex is not less than n-k and the in-degree of each vertex is not less than n-l, n being the number of vertices in the to-be-processed graph, and k and l being positive integers greater than or equal to 1.
[0143] The community determination module 840 is configured to determine a target community based on all the target subgraphs, the social network users in the target community being the social network users corresponding to the vertices in the target subgraph.
[0144] Figure 9 An example of an entity structure diagram of an electronic device is shown in FIG. 1. Figure 9As shown, the electronic device can include a processor 910, a communications interface 920, a memory 930, and a communications bus 940, wherein the processor 910, the communications interface 920, and the memory 930 complete mutual communication through the communications bus 940. The processor 910 can invoke a logic instruction in the memory 930 to execute a community discovery method based on maximum directed dense subgraph enumeration, which includes: converting to-be-processed social network data into a to-be-processed graph, the to-be-processed graph including a plurality of vertices and a plurality of directed edges, the vertices in the to-be-processed graph corresponding to social network users in the to-be-processed social network data, and the directed edges in the to-be-processed graph corresponding to association information between the social network users in the to-be-processed social network data; sorting each vertex in the to-be-processed graph based on a minimum value of an out-degree and an in-degree of each vertex to obtain a first sorting result, and generating a total branch corresponding to each vertex based on the first sorting result, the total branch corresponding to a set group, the set group including a mandatory set, a candidate set, and an exclusion set that are disjoint from each other, and the initial values of the mandatory set and the exclusion set corresponding to the total branch respectively including related points before and after a vertex corresponding to the total branch in the first sorting result, the distance between the related points and the vertex corresponding to the total branch in the to-be-processed graph being less than or equal to 2; recursively enumerating each total branch to obtain a target subgraph corresponding to the total branch, in the process of recursively enumerating the total branch, updating the set group corresponding to the branch based on a pivot point to generate a plurality of branches, each branch corresponding to a set group, determining a target branch in each branch of the total branch, taking the points in the mandatory set corresponding to the target branch as target vertices, the pivot point being the vertices in the mandatory set and the candidate set in the set group, the mandatory set corresponding to the target branch corresponding to the target subgraph, and the target subgraph being a maximum subgraph in the to-be-processed graph that has a size exceeding a preset limit value and satisfies a first constraint condition, the first constraint condition being that the out-degree of each vertex is not less than n-k and the in-degree of each vertex is not less than n-l, n being the number of vertices in the to-be-processed graph, and k and l being positive integers greater than or equal to 1; and determining a target community based on all target subgraphs, the social network users in the target community being the social network users corresponding to the vertices in the target subgraph.
[0145] In addition, the logic instructions in the memory 930 described above can be implemented in the form of software function units and sold or used as independent products, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0146] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program being stored in a non-transitory computer readable storage medium, and the computer program being capable of executing the community discovery method based on the enumeration of the maximum directed dense subgraph when executed by a processor, the method comprising: converting the to-be-processed social network data into a to-be-processed graph, the to-be-processed graph comprising a plurality of vertices and a plurality of directed edges, the vertices in the to-be-processed graph corresponding to the social network users in the to-be-processed social network data, and the directed edges in the to-be-processed graph corresponding to the association information between the social network users in the to-be-processed social network data; sorting the vertices in the to-be-processed graph based on the minimum values of the out-degree and the in-degree of each vertex to obtain a first sorting result, and generating a total branch corresponding to each vertex based on the first sorting result, the total branch corresponding to a set group, the set group comprising a mandatory set, a candidate set and an excluded set which are disjoint from each other, the initial values of the mandatory set and the excluded set corresponding to the total branch respectively comprising the relevant vertices before and after the vertex corresponding to the total branch in the first sorting result, the distance between the relevant vertices and the vertex corresponding to the total branch in the to-be-processed graph being less than or equal to 2; recursively enumerating each total branch to obtain a target subgraph corresponding to the total branch, in the process of recursively enumerating the total branch, updating the set group corresponding to the branch based on a pivot point to generate a plurality of branches, each branch corresponding to a set group, determining a target branch in each branch of the total branch, taking the vertices in the mandatory set corresponding to the target branch as target vertices, the pivot point being the vertices in the mandatory set and the candidate set in the set group, the mandatory set corresponding to the target branch corresponding to the target subgraph, the target subgraph being a maximum subgraph in the to-be-processed graph whose size exceeds a preset limit value and satisfies a first constraint condition, the first constraint condition being that the out-degree of each vertex is not less than n-k and the in-degree of each vertex is not less than n-l, n being the number of vertices in the to-be-processed graph, k and l being positive integers greater than or equal to 1; and determining a target community based on all the target subgraphs, the social network users in the target community being the social network users corresponding to the vertices in the target subgraph.
[0147] In yet another aspect, the present application also provides a non-transitory computer readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the community discovery method based on enumeration of maximal directed dense sub-graphs as provided by the above method, which comprises: converting to-be-processed social network data into a to-be-processed graph, the to-be-processed graph comprising a plurality of vertices and a plurality of directed edges, the vertices in the to-be-processed graph corresponding to social network users in the to-be-processed social network data, and the directed edges in the to-be-processed graph corresponding to association information between the social network users in the to-be-processed social network data; sorting the vertices in the to-be-processed graph based on the minimum values of the out-degree and the in-degree of each vertex to obtain a first sorting result, and generating a total branch corresponding to each vertex based on the first sorting result, the total branch corresponding to a set group, the set group comprising a mandatory set, a candidate set and an excluded set which are disjoint from each other, the initial values of the mandatory set and the excluded set corresponding to the total branch respectively comprising relevant points before and after the vertex corresponding to the total branch in the first sorting result, the distance between the relevant points and the vertex corresponding to the total branch in the to-be-processed graph being less than or equal to 2; recursively enumerating the total branch to obtain a target sub-graph corresponding to the total branch, in the process of recursively enumerating the total branch, updating the set group corresponding to the branch based on a pivot point to generate a plurality of branches, each branch corresponding to a set group, determining a target branch in each branch of the total branch, taking the points in the mandatory set corresponding to the target branch as target vertices, the pivot point being the vertices in the mandatory set and the candidate set in the set group, the mandatory set corresponding to the target branch corresponding to the target sub-graph, the target sub-graph being a maximal sub-graph in the to-be-processed graph whose size exceeds a preset limit value and which satisfies a first constraint condition, the first constraint condition being that the out-degree of each vertex is not less than n-k and the in-degree of each vertex is not less than n-l, n being the number of vertices in the to-be-processed graph, and k and l being positive integers greater than or equal to 1; and determining a target community based on all the target sub-graphs, the social network users in the target community being the social network users corresponding to the vertices in the target sub-graphs.
[0148] The apparatus embodiments described above are merely illustrative, wherein the units shown as separated components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment scheme. Those skilled in the art can understand and implement without creative labor.
[0149] Those skilled in the art can clearly understand the technical solutions of the various embodiments from the above description of the embodiments, and the various embodiments can be implemented by means of software with the necessary general hardware platforms, and of course, can also be implemented by hardware. Based on such understanding, the above technical solutions, essentially or in other words, the part of the prior art that makes a contribution, can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, and the like, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0150] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for some technical features therein; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A community detection method based on maximal directed dense subgraph enumeration, characterized in that, include: The social network data to be processed is transformed into a graph to be processed, which includes multiple vertices and multiple directed edges. The vertices in the graph correspond to social network users in the social network data to be processed, and the directed edges in the graph correspond to the association information between the social network users in the social network data to be processed. The association information reflects the attention or interaction between the social network users. The vertices in the graph to be processed are sorted based on the minimum in-degree of each vertex to obtain a first sorting result. Based on the first sorting result, a total branch is generated for each vertex. The total branch corresponds to a set group, which includes a set of non-overlapping required sets, candidate sets, and exclusion sets. The required set and the exclusion set corresponding to the total branch respectively include relevant points in the first sorting result that are after and before the vertex corresponding to the total branch. The distance between the relevant points and the vertex corresponding to the total branch in the graph to be processed is less than or equal to 2. Each of the main branches is recursively enumerated to obtain the target subgraph corresponding to the main branch. During the recursive enumeration of the main branches, the set group corresponding to the branch is updated based on the pivot point to generate multiple branches, each branch corresponding to one set group. The target branch is determined from each branch of the main branch, and the points in the mandatory set corresponding to the target branch are taken as target vertices. The pivot point is the vertex in the mandatory set and the candidate set of the set group. The mandatory set corresponding to the target branch corresponds to the target subgraph. The target subgraph is a maximal subgraph in the graph to be processed whose size exceeds a preset limit and satisfies a first constraint condition, where the out-degree of each vertex is not less than a certain value. in-degree is not less than , The number of vertices in the graph to be processed. , It is a positive integer greater than or equal to 1; The target community is determined based on all the target subgraphs, and the social network users in the target community are the social network users corresponding to the vertices in the target subgraphs. The relevant points also satisfy a second constraint condition, which is: If there is a directed edge between the relevant point and the vertex corresponding to the main branch, then the number of points in the intersection of the first set of connection points and the second set of connection points is greater than a first value. The first connection points are neighbors of the relevant point and the vertex corresponding to the main branch, respectively. The first value is the preset limit value and... , The difference between twice the minimum value; If there is no directed edge between the relevant point and the vertex corresponding to the main branch, then the number of points in the intersection of the first set of connecting points and the second set of connecting points is greater than the second value, and the second value is the preset limit value and... , The difference between twice the minimum value and 2; The step of updating the set group corresponding to the branch based on the hub point to generate multiple branches includes: When the hub point belongs to the required set in the set group: The first type of points in the candidate set are added to the required set and the excluded set in batches to generate multiple first branches. Based on the required set corresponding to each first branch, a continuing branch or a pruning branch is determined. The remaining second-type points in the candidate set are added to the mandatory set or the exclusion set in batches to generate multiple second branches. Based on the mandatory set corresponding to each second branch, a continuing branch or a pruning branch is determined. The remaining second-type points are the points in the second-type points after removing the first-type points corresponding to the pruned first branch. When the first type point is an outgoing neighbor of the hub point, the second type point is an incoming neighbor of the hub point; when the first type point is an incoming neighbor of the hub point, the second type point is an outgoing neighbor of the hub point. When the hub point belongs to the candidate set in the set group: Add the pivot point to the exclusion set to generate a new branch; Obtain the upper bound of the branch after adding the pivot point to the required set, determine whether the upper bound exceeds the preset limit value, if so, add the pivot point to the required set to generate a new branch, otherwise prune the branch, the upper bound of the branch reflects the maximum size of the maximal subgraph that satisfies the first constraint condition formed by the points in the required set and the candidate set corresponding to the branch.
2. The community detection method based on maximal directed dense subgraph enumeration according to claim 1, characterized in that, The process of determining whether to continue or prune a branch based on the mandatory set corresponding to each first branch, and the process of determining whether to continue or prune a branch based on the mandatory set corresponding to each second branch, includes: When a branch is constructed based on the pivot point of the required set, determine whether the required set corresponding to the branch satisfies the first constraint condition. If so, continue the branching process; otherwise, prune the branch.
3. The community detection method based on maximal directed dense subgraph enumeration according to claim 2, characterized in that, The step of obtaining the upper bound of the branch corresponding to the branch after adding the hub point to the mandatory set includes: Sort the outgoing neighbors of the hub point in ascending order according to the number of non-incoming neighbors in the mandatory set to obtain the second sorting result; The largest value i that ensures the number of newly added non-outgoing edge neighbors is no greater than the limit for the number of non-outgoing edge neighbors is obtained as the out-degree reference value. Here, the number of newly added non-outgoing edge neighbors is the minimum number of non-outgoing edge neighbors added to the required set corresponding to the branch after adding the first i points from the second sorting result. The number of non-outgoing edge neighbors is such that the out-degree of all points in the required set corresponding to the branch is no less than [a certain value]. Under the premise that it can accommodate the maximum sum of non-outbound neighbors; The size of the required set corresponding to the branch, the out-degree reference value, The sum of the differences in the number of non-outgoing neighbors of the pivot point in the required set corresponding to the branch is used to obtain the upper bound of the out-degree of the branch. Obtain the upper bound of the in-degree corresponding to the branch, and take the minimum value between the upper bound of the out-degree and the upper bound of the in-degree as the upper bound.
4. The community detection method based on maximal directed dense subgraph enumeration according to claim 3, characterized in that, The step of obtaining the upper bound of the branch corresponding to the branch after adding the hub point to the mandatory set includes: Sort the neighbors of the hub point in ascending order according to the minimum in-degree value in the required set corresponding to the branch, and obtain the third sorting result; The points in the third sorting result are traversed sequentially as points to be processed to remove or retain the points to be processed from the third sorting result. The upper bound is obtained by summing the size of the required set, the number of points retained in the third sorting result, and the maximum number of neighbors of the hub point that the required set can accommodate under the first preset condition; When processing each of the points to be processed, the following operations are performed: From the non-incoming neighbors of the point to be processed in the mandatory set, select the point with the smallest number of non-outcoming neighbors that can be accommodated as the first point; from the non-outcoming neighbors of the point in the mandatory set, select the point with the smallest number of non-incoming neighbors that can be accommodated as the second point. The number of non-outcoming neighbors that can be accommodated is the number of non-outcoming neighbors that can be accommodated in the mandatory set, and the number of non-incoming neighbors that can be accommodated is the number of non-incoming neighbors that can be accommodated in the mandatory set. If the number of non-outbound neighbors that the first point has and the number of non-inbound neighbors that the second point has are both greater than 0, then the number of non-outbound neighbors that the first point has and the number of non-inbound neighbors that the second point has are both reduced by 1. If the number of non-outbound neighbors that the first point has or the number of non-inbound neighbors that the second point has is not greater than 0, then the point to be processed is removed from the third sorting result.
5. A community discovery device based on maximal directed dense subgraph enumeration, characterized in that, include: The graph conversion module is used to convert the social network data to be processed into a graph to be processed. The graph to be processed includes multiple vertices and multiple directed edges. The vertices in the graph to be processed correspond to social network users in the social network data to be processed, and the directed edges in the graph to be processed correspond to the association information between the social network users in the social network data to be processed. The association information reflects the attention or interaction between the social network users. The preprocessing module is used to sort the vertices in the graph to be processed based on the minimum in-degree of each vertex, to obtain a first sorting result, and to generate a total branch corresponding to each vertex based on the first sorting result. The total branch corresponds to a set group, which includes a set of non-overlapping required sets, candidate sets, and exclusion sets. The initial values of the required set and the exclusion set corresponding to the total branch respectively include relevant points in the first sorting result that are after and before the vertex corresponding to the total branch. The distance between the relevant points and the vertex corresponding to the total branch in the graph to be processed is less than or equal to 2. The recursive enumeration module is used to recursively enumerate each of the main branches to obtain the target subgraph corresponding to the main branch. During the recursive enumeration of the main branches, the set group corresponding to the branch is updated based on the pivot point to generate multiple branches, each branch corresponding to one set group. The target branch is determined among the branches of the main branch, and the points in the mandatory set corresponding to the target branch are taken as target vertices. The pivot point is the vertex in the mandatory set and the candidate set in the set group. The mandatory set corresponding to the target branch corresponds to the target subgraph. The target subgraph is a maximal subgraph in the graph to be processed whose size exceeds a preset limit and satisfies a first constraint condition, where the out-degree of each vertex is not less than a certain value. in-degree is not less than , The number of vertices in the graph to be processed. , It is a positive integer greater than or equal to 1; The community determination module is used to determine the target community based on all the target subgraphs, wherein the social network users in the target community are the social network users corresponding to the vertices in the target subgraphs. The relevant points also satisfy a second constraint condition, which is: If there is a directed edge between the relevant point and the vertex corresponding to the main branch, then the number of points in the intersection of the first set of connection points and the second set of connection points is greater than a first value. The first connection points are neighbors of the relevant point and the vertex corresponding to the main branch, respectively. The first value is the preset limit value and... , The difference between twice the minimum value; If there is no directed edge between the relevant point and the vertex corresponding to the main branch, then the number of points in the intersection of the first set of connecting points and the second set of connecting points is greater than the second value, and the second value is the preset limit value and... , The difference between twice the minimum value and 2; The step of updating the set group corresponding to the branch based on the hub point to generate multiple branches includes: When the hub point belongs to the required set in the set group: The first type of points in the candidate set are added to the required set and the excluded set in batches to generate multiple first branches. Based on the required set corresponding to each first branch, a continuing branch or a pruning branch is determined. The remaining second-type points in the candidate set are added to the mandatory set or the exclusion set in batches to generate multiple second branches. Based on the mandatory set corresponding to each second branch, a continuing branch or a pruning branch is determined. The remaining second-type points are the points in the second-type points after removing the first-type points corresponding to the pruned first branch. When the first type point is an outgoing neighbor of the hub point, the second type point is an incoming neighbor of the hub point; when the first type point is an incoming neighbor of the hub point, the second type point is an outgoing neighbor of the hub point. When the hub point belongs to the candidate set in the set group: Add the pivot point to the exclusion set to generate a new branch; Obtain the upper bound of the branch after adding the pivot point to the required set, determine whether the upper bound exceeds the preset limit value, if so, add the pivot point to the required set to generate a new branch, otherwise prune the branch, the upper bound of the branch reflects the maximum size of the maximal subgraph that satisfies the first constraint condition formed by the points in the required set and the candidate set corresponding to the branch.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the community discovery method based on maximal directed dense subgraph enumeration as described in any one of claims 1 to 4.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the community discovery method based on maximal directed dense subgraph enumeration as described in any one of claims 1 to 4.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the community discovery method based on maximal directed dense subgraph enumeration as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Community discovery method in social network based on maximum group enumeration
CN109978705A
Method for searching target sub-graph in directed graph and related equipment
CN115438088A