Community search method and device on attribute graph with scale limitation and readable storage medium

By acquiring subgraph constraint information of the attribute graph and heuristic community search, the pruning rule discards candidate nodes that cannot form a triangle, and the target subgraph with the highest graph attribute score is selected as the optimal community, thus solving the accuracy and efficiency problems of community search on attribute graphs with limited scale.

CN116805024BActive Publication Date: 2026-02-17SOUTH CENTRAL UNIVERSITY FOR NATIONALITIES
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310663187.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-06
Publication Date
2026-02-17
Estimated Expiration
2043-06-06

AI Technical Summary

Technical Problem

Existing technologies struggle to efficiently and accurately search for communities on attribute graphs with limited scale, particularly in social networks, where it is difficult to efficiently and accurately find communities that meet the requirements of scale, structural density, and attribute similarity.

Method used

By acquiring preset subgraph constraint information, including query nodes, attribute sets, and size limits, a heuristic community search method is adopted. Candidate nodes that cannot form a triangle with any two nodes in the current optimal solution set are discarded using pruning rules. The target subgraph with the highest graph attribute score is selected as the optimal community.

Benefits of technology

It improves the accuracy and efficiency of searching for limited-size communities on attribute graphs, avoids the difficulty of specifying parameters, and can quickly and effectively find subgraphs that meet the requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116805024B_ABST
    Figure CN116805024B_ABST
Patent Text Reader

Abstract

The application relates to a community search method and device on an attribute graph with a limited scale and a readable storage medium, relates to the technical field of community search, and comprises the following steps: obtaining preset subgraph constraint information, wherein the subgraph constraint information comprises a query node, an attribute set and a scale limitation range; performing heuristic community search on a preset attribute graph based on the subgraph constraint information and a preset first pruning rule to obtain a target subgraph with the highest graph attribute score, wherein the first pruning rule comprises discarding a candidate node which cannot form a triangle with any two nodes in a current optimal solution set obtained through search, and the candidate node is a neighbor node of the query node; and taking the target subgraph as an optimal community. Through the application, the accuracy and efficiency of the community search on the attribute graph with the limited scale can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of community search, and in particular relates to a community search method, device and readable storage medium on an attribute graph with scale limitation. BACKGROUND

[0002] In recent years, various types of graphs have been widely used in many practical applications, one of which is online communities. Generally speaking, the nodes in the graph represent entities in real life, and the edges represent social relationships between entities, for example, users with strong social relationships on a social network (such as mutual attention or attention to a specific user) can form a community, and the social platform can recommend the same product to people in the same community because they are most likely to have the same purchasing tendency.

[0003] Among them, with the rapid development of large social networks, attribute graphs have attracted industry attention. Many network structures in real life can be modeled as graphs with attributes of nodes, and this modeling method has significance in many practical applications. For example, when organizing a trip, it is generally desirable for all participants to have as similar interests as possible in the attractions, and entities modeled by network nodes often have attributes that are crucial to understanding communities. Not only are attribute graphs of research interest, but it is also meaningful to combine specific problems in real life and scale-constrained community search results, thus forming a scale-limited community search problem. Therefore, how to efficiently and accurately implement scale-limited community search on attribute graphs is a current problem to be solved. SUMMARY

[0004] The present application provides a community search method, device and readable storage medium on an attribute graph with scale limitation, to efficiently and accurately implement scale-limited community search on attribute graphs.

[0005] In a first aspect, a community search method on an attribute graph with scale limitation is provided, comprising the following steps:

[0006] Obtaining preset subgraph constraint information, the subgraph constraint information including a query node, an attribute set and a scale limitation range;

[0007] Performing heuristic community search on a preset attribute graph based on the subgraph constraint information and a preset first pruning rule to obtain a target subgraph with the highest graph attribute score, the first pruning rule including discarding candidate nodes that cannot form a triangle with any two nodes in a current optimal solution set obtained by the search, the candidate nodes being neighbor nodes of the query node;

[0008] Taking the target subgraph as an optimal community.

[0009] In a second aspect, a device for community search on an attribute graph with a limited scale is provided, comprising:

[0010] an acquisition unit configured to acquire preset subgraph constraint information, the subgraph constraint information comprising a query node, an attribute set, and a scale limit range;

[0011] a search unit configured to perform heuristic community search on a preset attribute graph based on the subgraph constraint information and a preset first pruning rule to obtain a target subgraph with the highest graph attribute score, the first pruning rule comprising discarding a candidate node that cannot form a triangle with any two nodes in a current optimal solution set obtained by the search, the candidate node being a neighbor node of the query node; and taking the target subgraph as an optimal community.

[0012] In a third aspect, a computer readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the computer program is configured to implement the community search method on an attribute graph with a limited scale.

[0013] The present application provides a community search method, device and readable storage medium on an attribute graph with a limited scale, comprising acquiring preset subgraph constraint information, the subgraph constraint information comprising a query node, an attribute set, and a scale limit range; performing heuristic community search on a preset attribute graph based on the subgraph constraint information and a preset first pruning rule to obtain a target subgraph with the highest graph attribute score, the first pruning rule comprising discarding a candidate node that cannot form a triangle with any two nodes in a current optimal solution set obtained by the search, the candidate node being a neighbor node of the query node; and taking the target subgraph as an optimal community. For community search on an attribute graph with a limited scale, the present application determines the optimal community by using the graph attribute score, i.e., using a community model without parameters to measure the tightness of the community, thereby avoiding the difficulty of specifying parameters, and introducing a pruning rule for community search to quickly and effectively find a subgraph meeting the requirements, thereby effectively improving the accuracy and efficiency of community search on an attribute graph with a limited scale. BRIEF DESCRIPTION OF DRAWINGS

[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0015] Figure 1 A flowchart of a community search method on an attribute graph with a limited scale provided by the embodiments of the present application;

[0016] Figure 2A first attribute social network diagram provided for an embodiment of the present application;

[0017] Figure 3 A second attribute social network diagram provided for an embodiment of the present application;

[0018] Figure 4 A third attribute social network diagram provided for an embodiment of the present application;

[0019] Figure 5 A fourth attribute social network diagram provided for an embodiment of the present application;

[0020] Figure 6 An F1 score diagram provided for an embodiment of the present application;

[0021] Figure 7 An impact diagram of changing a query attribute set size on a result provided for an embodiment of the present application;

[0022] Figure 8 A result size diagram of different algorithms on a DBLP dataset provided for an embodiment of the present application;

[0023] Figure 9 A result size diagram of different algorithms on an Amazon dataset provided for an embodiment of the present application;

[0024] Figure 10 An impact diagram of changing a size limit on a minimum degree of a result provided for an embodiment of the present application;

[0025] Figure 11 An impact diagram of changing a size limit on an edge density of a result provided for an embodiment of the present application;

[0026] Figure 12 A running time diagram of different algorithms on a Dbpedia dataset provided for an embodiment of the present application;

[0027] Figure 13 A running time diagram of different algorithms on an Amazon dataset provided for an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of embodiments of the present application, rather than all embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0029] The embodiment of the present application provides a community search method and device on an attribute graph with scale limitation and a readable storage medium, so that the community search on the attribute graph with scale limitation is efficiently and accurately realized.

[0030] For the convenience of description, part of related professional terms will be explained as follows:

[0031] Community search, the target of community search is to find a compact community containing a query node.

[0032] Attribute community search, attribute community query (or ACQ), that is, given an attribute graph G, a node and a positive integer k, AC is a community composed of closely related vertices; in particular, AC satisfies structural cohesion (i.e. close connection between vertices) and keyword cohesion (i.e. high attribute similarity between vertices), and ACQ will return one or more attribute subgraphs of G, and the degree of each node in the subgraph is greater than or equal to k.

[0033] Community search with scale limitation, not only the attribute graph has research significance, but also it is very meaningful to combine specific problems in real life to constrain the scale of community search results. For example, in practical applications, many application programs need to limit the number of vertices or members in the community, so community search with scale limitation is needed.

[0034] In addition, Table 1 also lists the symbols used in the present application and their definitions.

[0035] Table 1 Commonly used symbols

[0036]

[0037]

[0038] Figure 1 The embodiment of the present application provides a community search method on an attribute graph with scale limitation, comprising the following steps:

[0039] Step S10: obtaining preset subgraph constraint information, the subgraph constraint information comprising a query node, an attribute set and a scale limitation range;

[0040] Exemplarily, according to observation in daily life, when traveling or organizing activities, there are usually some limitations. For example, Figure 2Imagine a social network with 10 members. Nodes in the graph represent entities (e.g., Eric), edges (e.g., the edge between Eric and Tom) represent social relationships between entities, and attributes represent places the entities are interested in visiting (e.g., shopping malls, parks, and museums). Suppose Eric wants to organize a trip to a certain city. To ensure a positive social atmosphere during the trip, he wants members to know each other and have similar travel interests. Due to various limitations, the number of participants needs to be between 4 and 6. Considering these practical factors and Eric's requirements, {Eric, Tom, Jeff, Ben, Tonny, Alex} would be a good combination.

[0041] Understandably, many real-life problems can be simplified into community search problems under different conditions. For example, the aforementioned problem of organizing tour groups can be efficiently solved by defining it as a community search problem on a property graph. Specifically, such as... Figure 3 As shown, it contains 10 nodes. When initiating a query to search for a suitable community (including the query node), to save time and other costs, it is required that the nodes in the subgraph have as many identical attribute words as possible. Due to accommodation and transportation constraints, it is desired that there be at least l people and at most h people participating. Furthermore, to successfully organize this trip, a good social atmosphere within the team is obviously important, so it is desired that the nodes in the final returned subgraph have a relatively compact structure. The above community search with size constraints can be transformed into: given a connected attribute graph G = (V, E) and a query Q = (v... q , W, [l, h]), where V represents the set of vertices in graph G, E represents the set of edges in graph G, v q This represents the query node, W represents the attribute set, l and h represent the upper and lower limits of the size constraint range, respectively, and query Q represents v. q Initiate a query to search for a community H with a set of attributes W and a number of nodes in the range [l, h].

[0042] To address the problem of searching for communities with limited size on attribute graphs, this embodiment aims to search for a community represented by a subgraph H of an undirected attribute graph G, satisfying connectivity, size constraints, structural cohesion, and attribute cohesion. To better illustrate the two metrics of structural cohesion and attribute cohesion, this embodiment will introduce the following important definitions.

[0043] Definition 1 (Property graph G): A property graph is denoted as G = (V, E) with n = |V(G)| vertices and m = |E(G)| edges, each vertex v e V contains one or more attributes, denoted as attr(v), and the union of all vertex attributes is attr(V), i.e., |attr(V)| = ∑ v∈V attr(v).

[0044] Definition 2 (Degree density p d ): Given a graph H, it is obvious that, Then the degree density of H can be defined as

[0045] Definition 3 (Triangle density p Δ ): Given a graph H, its triangle density can be defined as

[0046] In order to ensure the high tightness of the nodes in the subgraph, a tool is needed to limit the tightness. However, overemphasizing the tightness of the graph or the similarity of the attributes between the nodes may cause the result to lose balance and return a subgraph that is structurally tight but has low attribute relevance, or a subgraph that has high attribute relevance but is structurally loose. Therefore, when measuring the structural tightness, traditional k-core (which is the largest subgraph of graph G, where the degree of each vertex in the subgraph is at least k), k-truss (which is the largest subgraph of graph G, where each edge contains at least (k-2) triangles in the subgraph), and other models face two contradictions:

[0047] Generally, the larger the value of k, the smaller the subgraph (the subgraph is more tight), and the number of attributes contained in the subgraph will be less; while a smaller value of k can ensure that relatively more nodes contain the query attribute, but the tightness of the structure is not guaranteed.

[0048] Therefore, it is difficult to set the value of k. Therefore, the embodiment converts the tightness or relevance of the structure and attributes into the ratio of the total number of edges and triangles to the number of vertices in the subgraph, and then takes the edge density and triangle density as the standard for judging the attribute cohesion and structural cohesion of the subgraph.

[0049] Definition 4 (Edge attribute score ES): It refers to the sum of the number of attribute words of the two nodes on each edge and the same attribute words in W, which measures the importance or influence of the edge on the entire graph, which can be represented as ES(e, W) = |W ∩ attr(u)| + |W ∩ attr(v)|, the edge e is composed of nodes (u, v).

[0050] Definition 5 (Triangle Attribute Score TS): refers to the sum of the edge attribute scores of the three edges of a triangle, which measures the importance or influence of the triangle to the whole graph, which can be expressed as TS(A, W) =∑ e∈{(u,v),(v,w),(u,w)} ES(e, W).

[0051] The embodiment encourages subgraphs to contain more vertices or edges that are similar to the query attributes. For example, in Figure 3 , given a query Q = (v0, W, [l, h]), W = {zoo, park, museum}, triangle {v0, v4, v9} scores higher than triangle {v0, v8, v9} because each vertex in triangle {v0, v4, v9} covers all query attribute words, while vertex v8 in {v0, v8, v9} only contains one query attribute word.

[0052] Definition 6 (Graph Attribute Score AS): based on the above definition, the embodiment will use the edge density and triangle density in subgraph H to measure the score of subgraph H relative to attribute set W, that is,

[0053] In addition, the embodiment also defines the specification of the proposed community search problem with size constraints on the attribute graph (i.e. SACS problem).

[0054] Definition 7 (Community Search Problem with Size Constraints on Attribute Graph): given a connected attribute graph G = (V, E), a query Q = (v q , W, [l, h]), that is, v q initiates a query to search a subgraph H with an attribute set W and a node number in the range [l, h], which satisfies the following three conditions:

[0055] (1) Connectivity: H is connected and v q ∈ V(H);

[0056] (2) Size constraint: l ≤ |V(H)| ≤ h;

[0057] (3) Structural and attribute cohesion: among the subgraphs satisfying the above two conditions, the graph attribute score of H is the largest, that is, H is

[0058] It should be understood that a SACS query in the embodiment is initiated by a query node v qThe subgraph constraint information includes a query node, an attribute set W, and a size lower bound I and a size upper bound h, and the purpose is to find a subgraph with a certain size, closely connected and attribute related. The values of the parameters I and h can be selected according to the resource limitations of actual applications. In order to facilitate expression, it is assumed in the embodiment that there is only one query node and the query attribute set W has at most three attribute words, but it needs to be noted that the embodiment can also be extended to handle multiple query nodes and larger attribute sets. In the embodiment, the subgraph of G satisfying the first two conditions (i.e., connectivity and size limitation) is a feasible solution, and the subgraph satisfying all three conditions is an optimal solution.

[0059] For example, referring to FIG. 1, Figure 2 As shown in FIG. 1, given a social network graph G, a query Q = (v0, W, [4, 8]) and W = {zoo, park, museum}, it is assumed that H1 = {v0, v4, v8, v9}, AS(H1, W) = 11.25, H1 is a feasible solution (there are multiple feasible solutions), H2 = {v0, v1, v2, v4, v5, v7, v8, v9}, AS(H2, W) = 14.125; since AS(H1, W) < AS(H2, W), H2 is an optimal solution.

[0060] Therefore, when performing community search with size limitation on an attribute graph, the embodiment needs to first obtain constraint information for searching a community with size limitation, which includes a query node, an attribute set, and a size limitation range. For example, the query node is v0, the attribute set W = {zoo, park, museum}, and the size limitation range is [3, 6], then the optimal subgraph with the attribute set W = {zoo, park, museum} and the number of nodes in the range of [3, 6] is searched from the starting point v0.

[0061] Step S20: performing heuristic community search on the preset attribute graph based on the subgraph constraint information and a preset first pruning rule to obtain a target subgraph with the highest graph attribute score, the first pruning rule including discarding a candidate node that cannot form a triangle with any two nodes in a current optimal solution set obtained by the search, the candidate node being a neighbor node of the query node;

[0062] In the embodiment, the heuristic community search is performed on the preset attribute graph based on the subgraph constraint information and the preset first pruning rule to obtain a target subgraph with the highest graph attribute score, and specifically includes the following steps:

[0063] The current optimal solution set and the corresponding graph attribute score are initialized, and the query node is added to the current optimal solution set;

[0064] A plurality of neighbor nodes of the query node are added to a candidate node set as candidate nodes, the candidate nodes being nodes on the preset attribute graph.

[0065] sort the candidate nodes in the candidate node set based on a preset sorting rule to obtain a sorting result;

[0066] add the candidate nodes to the current optimal solution set in sequence according to the sorting result to form a new current optimal solution set and calculate a graph attribute score corresponding to the new current optimal solution set;

[0067] take a subgraph corresponding to a target current optimal solution set with the highest graph attribute score as a target subgraph;

[0068] When the number of nodes in the current optimal solution set is greater than or equal to a lower limit value of the scale limit range, discard a candidate node in the candidate node set that cannot form a triangle with any two nodes in the current optimal solution set.

[0069] In this embodiment, the candidate nodes in the candidate node set are sorted based on a preset sorting rule, specifically including the following steps:

[0070] determine the number of objects in the multiple attribute objects corresponding to each candidate node that are the same as the attributes in the attribute set, and determine the number of newly added triangles corresponding to each candidate node after the candidate node is added to the current optimal solution set;

[0071] sort the candidate nodes in the candidate node set in descending order of the number of newly added triangles;

[0072] If the number of newly added triangles of two candidate nodes is the same, sort the two candidate nodes in descending order of the number of objects;

[0073] If the number of newly added triangles and the number of objects of two candidate nodes are the same, sort the two candidate nodes in ascending order of the node number.

[0074] In this embodiment, the candidate nodes are added to the current optimal solution set in sequence according to the sorting result to form a new current optimal solution set and calculate a graph attribute score corresponding to the new current optimal solution set, specifically including the following steps:

[0075] add a first candidate node with the highest sorting to the current optimal solution set to obtain a new current optimal solution set, and calculate a first graph attribute score corresponding to the new current optimal solution set;

[0076] If the first graph attribute score is less than or equal to the graph attribute score corresponding to the current optimal solution set, discard the first candidate node;

[0077] take a next candidate node adjacent to the first candidate node as the candidate node with the highest sorting to perform the step of adding the first candidate node with the highest sorting to the current optimal solution set;

[0078] If the first graph attribute score is greater than the graph attribute score corresponding to the current optimal solution set, the step of adding the first candidate node with the highest ranking to the current optimal solution set based on the next candidate node adjacent to the first candidate node and the new current optimal solution set is performed.

[0079] Exemplarily, the embodiment gives a definition of the community search problem with size constraint on attributed graphs (SACS problem). It is very challenging to solve this problem because it is NP-hard. The principle that the SACS problem is NP-hard will be explained below.

[0080] Theorem 1: The SACS problem is NP-hard.

[0081] Proof: The embodiment will prove that the decision problem of the SACS problem is an NPC problem by reducing the team problem. Specifically, the decision problem of the SACS problem is defined as follows: given a graph G = (V, E), a query Q = (v q , W, [l, h]) and an integer s, determine whether there is a subgraph H, that satisfies (1) H is connected and contains v q ; (2) l≤|V(H)|≤h; and (3) the AS value of H is at least s. Obviously, this decision problem belongs to the NP class problem.

[0082] Consider an instance of the k-clique problem (which is a set of k vertices of the graph G, such that each pair of vertices has an edge), input a graph G = (V, E) and an integer k, the purpose is to determine whether there is a k-clique (i.e. a complete subgraph of k vertices), which is converted into a decision SACS problem: add a virtual vertex v q , add an edge between v q and each vertex, generate a graph G', i.e. V(G') = V∪{v q}, E(G') = E∪{(v q , v)|v∈V}. The query of the decision SACS problem includes the query vertex v q , the query attribute set W, the size constraint [l, h] and the minimum graph attribute score threshold s. It is easy to verify that if and only if is a k-clique, then H∪{v q} is the solution of the decision SACS problem. Since it has been proved that the k-clique problem is an NPC problem, and the embodiment uses the k-clique problem to reduce the decision SACS problem, it can be concluded that the decision SACS problem is an NPC problem; and since the SACS problem can be reduced to the decision SACS problem, it can be further concluded that the SACS problem is an NP-hard problem.

[0083] For the SACS problem, the traditional community model usually needs to specify parameters, such as using the k-core community model to measure the subgraph structure tightness, and the k value needs to be specified in advance, for example, k = 4, and then the final subgraph minimum degree needs to be greater than or equal to 4. However, the specification of parameters often has certain difficulties. Therefore, the embodiment proposes a parameter-free community model, that is, searching for the optimal subgraph through the graph attribute score without specifying the parameters to limit the lower limit of the structure cohesion and the attribute cohesion, aiming to find the subgraph with the maximum graph attribute score, so that the structure and attribute restrictions are not lost even without parameters.

[0084] For the above SACS problem, the embodiment provides an exact algorithm (i.e., a basic algorithm) which aims to find the optimal connected subgraph containing the query node v q , the number of nodes is between [l, h], and the structure cohesion and attribute cohesion of the subgraph are high; the core of the algorithm is to score the nodes, edges and triangles, and select the feasible solution with the maximum AS value as the optimal solution by enumerating all feasible solutions.

[0085] wherein the exact algorithm Exact is as follows:

[0086]

[0087] Specifically, the embodiment will explain the principle of community search on an attribute graph with scale restriction in combination with the above Exact algorithm: first, remove the nodes in G that do not contain any one of the query attribute words, and the remaining nodes form a subgraph G' (lines 2-4); then, enumerate all connected subgraphs in G' containing v q , the number of nodes is between [l, h], and calculate their AS values (lines 6-8); when enumerating the connected subgraphs, the subgraphs that cannot become the optimal solution are pruned, that is, in the search process, if it can be determined that the score of the current subgraph cannot exceed the score of the optimal solution that has been found, the subgraph can be pruned; then, if the AS value of the current subgraph is greater than , update (lines 9-11); in a large graph, there can be multiple solutions with the same AS value, and then the subgraph with the maximum minimum degree is selected as the optimal solution Ψ (line 12) and output.

[0088] The algorithm complexity of the Exact algorithm will be analyzed as follows: The Exact algorithm can realize the community search with scale restriction on the attribute graph, but its time complexity is relatively high, because it needs to enumerate all subgraphs meeting condition 1 and condition 2 and calculate their AS values, and this process is very time-consuming in a large graph; therefore, in a large graph, the efficiency of the Exact algorithm can be relatively low, and it is difficult to obtain satisfactory results within a limited time. Two parts of the algorithm can cause high time complexity, which are generating all connected subgraphs of [l, h] nodes and calculating the AS value. In the worst case (i.e., the graph G is a complete graph), there are edges between all nodes, at this time, the number of connected subgraphs of the graph G is exponential, and therefore the time complexity of generating all connected subgraphs is O(2 n m 2 ); for calculating the AS value, in the worst case, each connected subgraph needs to be calculated once, and therefore the time complexity is O(2 n ), and when calculating the AS value, the edge attribute score of each triangle needs to be calculated, and the time complexity of this part is O(m 2 ), because each edge can appear in multiple triangles. Therefore, the total time complexity is O(2 n m 2 ).

[0089] Since the time complexity of the Exact algorithm is relatively high, in order to effectively reduce the time complexity and improve the search efficiency, the embodiment will propose a heuristic algorithm (i.e., the SACH algorithm) for the SACS problem, which performs heuristic search from the query node v q , and based on the addition of the pruning strategy, the algorithm can solve the problem within a reasonable time complexity. The pruning strategy involved in the SACH algorithm will be described first.

[0090] Lemma 1: When the intersection of the neighbor node set of the newly added node v and the current optimal solution C does not exist, the addition of v will reduce the AS value.

[0091] Proof: If the intersection of the neighbor node set of the newly added node v and the current optimal solution C does not exist, that is, the degree of the subgraph formed by the intersection of the neighbor node set N G (v) of the node v in G and C is 0, which can be represented as deg(N G (v)∩C)=0, then the graph attribute score of C∪{v} can be represented as: x is the edge attribute score increment, and a is the weight value parameter, and the specific value can be set according to actual requirements, because deg(N G(v)∩C) = 0, no new triangle, so the triangle attribute score is the same as that when node v is not added.

[0092] Assume deg(N G (v)∩C) = 0, AS(C∪{v}, W) > AS(C, W) holds, and we have: α∑ Δ∈Tri(C) TS(Δ, W) + (|V(C)| + 1)(1 - α)∑ e∈E(C) ES(e, W) < |V(C)|(1 - α)[∑ e∈E(C) ES(e, W) + x], expanding the term, we have: AS(C, W) < (1 - α)x; obviously (1 - α)x < AS(C∪{v}, W), so the assumption is not true; therefore, deg(N G (v)∩C) = 0, AS(C∪{v}, W) ≤ AS(C, W).

[0093] Pruning Rule 1 (i.e., the first pruning rule): when |V(C)| ≥ l, for a node v in the candidate node set R, if deg(N G (v)∩C) = 0, v is discarded, i.e., v can be discarded if v cannot form a triangle with any two nodes in C.

[0094] For example, referring to the social network graph shown in FIG. 1, assume that the edge (v1, v4) does not exist, and given a query Q = (v0, W, [4, 6]), where W = {zoo, park, museum}, initially C = {v0} and R = N G (C); the nodes v1, v2 and v3 in R are sorted in descending order of score C∪{v} (v), and if the same, in descending order of count W (v), and if the same, in descending order of count q (v); after sorting, R = {v1, v2, v3}; v1 is selected first to join C, then C = {v0}∪{v1}, and the nodes are then added in a loop until the current optimal solution C = {v0, v1, v2, v3, v4} is obtained, and AS(C, W) = 11.4; the number of nodes in C does not reach the upper limit, but v5 cannot form a triangle with any two nodes in C, so v5 is pruned. The algorithm stops.

[0095] It should be noted that if the edge (v1, v4) exists, the current optimal solution C is denoted as C', and the nodes are continuously added, and assume that AS(C'∪{v5}, W) = 13.667 at this time; obviously, if the addition of v5 increases the number of triangles in C, then v5 can be retained according to the provision of the pruning rule 1.

[0096] The heuristic algorithm SACH is shown as follows:

[0097]

[0098] For the convenience of expression, the embodiment assumes that all nodes in graph G contain at least one attribute identical to any element in query attribute set W; it is to be noted that the algorithm involved in the embodiment needs to eliminate nodes in G that do not contain any query attribute word, and the remaining nodes constitute subgraph G', which is identical to the process and principle of the Exact algorithm for processing nodes irrelevant to the query in lines 2-4, and thus for the sake of brevity of description, the step is not described in subsequent algorithms, and in subsequent algorithms, subgraph G' is directly referred to as graph G.

[0099] Specifically, the embodiment will explain the principle of community search with scale constraint on attribute graph in combination with the above SACH algorithm: the SACH algorithm adopts a greedy strategy, and after determining constraint information Q=(v q , W, [l, h]), the query node v q is added to set C, and the subgraph constituted by nodes in C represents the current optimal solution, and the value of AS is initialized to (line 1);

[0100] When the number of nodes is less than h, the algorithm repeatedly adds new nodes (line 2), and specifically, the algorithm puts the neighbor nodes of nodes in C into set R as a candidate node set, and sorts the candidate nodes according to certain rules: count W (v) is counted as count C (v) in R, and score {v} (v) is counted as score C (v) in C after v is added to C, the sorting rule is to sort in descending order of score {v} (v), and if the same, sort in descending order of count W (v), and if still the same, sort in ascending order of neighbor node number;

[0101] After sorting, the algorithm selects the node with the highest score to add to C (lines 4-5), and calculates AS(C∪{v})=s, if the update C=C∪{v}, otherwise, v is discarded; then continue the loop (lines 9-12); it is to be noted that when |V(C)|≥l, the algorithm applies pruning rule 1 to determine whether to discard v, so as to avoid unnecessary calculation (lines 6-8); finally, the C with the largest s value (i.e., the target subgraph) is output as the optimal solution (line 13).

[0102] count W(v) can be understood as follows: assuming W = {zoo, park, museum}, if the attributes of node v are {zoo, park, museum}, then for node v, since all its attributes are the same as the attributes in W, its count W (v) = 3; and if the attributes of node v are {museum, shopping mall}, then for node v, since only the attribute museum is the same as the attribute museum in W, its count W (v) = 1.

[0103] The algorithm complexity of the SACH algorithm will be analyzed as follows: the algorithm loops to add new nodes, and the maximum number of loops is h. The bucket sort is used to realize sorting, and the time complexity of the bucket sort is O (|R|), where |R| is the number of elements to be sorted. A bucket is created for each possible score C∪{v} (v) value, and nodes with the same score C∪{v} (v) are put into the same bucket; then, for each non-empty bucket, the nodes are sorted according to count W (v), and finally, all the nodes in all the buckets are taken out in turn, and all the nodes sorted according to score C∪{v} (v) and count W (v) can be obtained. Since the applicable conditions of the bucket sort are relatively strict, the value range of the elements to be sorted needs to be small and the distribution needs to be uniform, that is, the bucket sort is suitable for the case where the G density is relatively uniform. In general, the time complexity of the sorting method such as the merge sort is O (|R|log|R|). The nodes in R are traversed to determine whether to add them to C, and the cost is O (d), where d is the average degree of each node. In addition, the algorithm applies the pruning rule 1, and the time complexity is O (d).

[0104] The algorithm also needs to add the node with the highest score to the current optimal solution and calculate the AS value. First, for any triangle, the endpoints of its three sides can be regarded as a triple (u, v, w), where u, v, w are three distinct nodes, and (u, v), (u, w), (v, w) are all edges in graph G. Therefore, each edge (u, v) can be enumerated. Then, the nodes adjacent to u and v are traversed to determine whether there exists an edge (v, w) and an edge (u, w) such that (u, v, w) form a triangle. If such a node w exists, the attribute score of this triangle is added to the AS value. The algorithm can store the edge and node information of graph G using an adjacency list. Each edge (u, v) is then enumerated in ascending order of node number. Therefore, for each node u, a list of its adjacent nodes, adj[u], can be preprocessed. Next, nodes v ∈ adj[u] are traversed. For each v, nodes w ∈ adj[v] and w > u are traversed, checking if edges (v, w) and (u, w) exist. If they do, the attribute scores of triangle (u, v, w) are added to the value of AS. Since each triangle is enumerated 3 times, the total time complexity is O(3m) = O(m), where m is the number of edges in graph G. Therefore, the overall time complexity of the algorithm is O(h|R|log|R|m).

[0105] Furthermore, after the step of performing a heuristic community search on the preset attribute graph based on the subgraph constraint information and the preset first pruning rule to obtain the target subgraph with the highest graph attribute score, the method further includes:

[0106] When the target current optimal solution set corresponding to the target subgraph cannot be expanded further, and the difference between the upper limit of the scale limit range and the number of nodes in the target current optimal solution set is not less than the preset value (it should be noted that the specific value of the preset value can be determined according to actual needs, and is not limited here, for example, the preset value can be set to 3), the neighbor nodes of the nodes in the target current optimal solution set are used as new query nodes, and the scale limit range is updated according to the preset value and the difference to obtain a new scale limit range;

[0107] Based on the new query nodes and the new scale limit range, a new heuristic community search is performed on the unsearched parts of the preset attribute graph to obtain the heuristic subgraph and its corresponding graph attribute score.

[0108] The current heuristic subgraph is pruned based on the preset second pruning rule;

[0109] When the graph attribute score corresponding to the merged optimal solution set is greater than the graph attribute score corresponding to the target current optimal solution set, the subgraph corresponding to the merged optimal solution set is taken as a new target subgraph, the merged optimal solution set being a set obtained by merging the set corresponding to the current heuristic subgraph which is not pruned and the target current optimal solution set;

[0110] The second pruning rule comprises pruning the current heuristic subgraph if the current heuristic subgraph satisfies the following formula:

[0111] |V(C')|[AS(C',W)-AS(C,W)]+αΔ≤0

[0112] In the formula, C' represents the set corresponding to the current heuristic subgraph, C represents the target current optimal solution set, W represents the attribute set, V(C') represents the number of nodes in the current heuristic subgraph, AS(C',W) represents the graph attribute score of the current heuristic subgraph, AS(C,W) represents the graph attribute score of the subgraph corresponding to the target current optimal solution set, Δ represents the edge attribute score of the edge connecting the two subgraphs, and α represents a weight value parameter.

[0113] In the embodiment, the neighbor nodes of the nodes in the target current optimal solution set are taken as new query nodes, and specifically comprising:

[0114] The neighbor nodes of all the nodes in the target current optimal solution set are sorted in descending order according to the degree to obtain a degree sorting set;

[0115] The node with the largest degree is taken from the degree sorting set as a new query node.

[0116] The SACH algorithm can find an optimal solution in a reasonable time, but in some cases, it can fall into a local solution and thus cannot continue to expand. Since the AS value is not monotonic, that is, the addition of some nodes can reduce the AS value, if the size of C has reached l, the algorithm can stop expanding and output the current C as an optimal solution. However, there can be more compact structures in the nodes that have not been traversed, and the combination of the structures and C can obtain a larger AS value. Therefore, the embodiment proposes an optimization algorithm (i.e., the SACH+ algorithm) to jump out of the local solution, that is, when further expansion is not possible, if the current optimal solution C satisfies Lemma 2, the algorithm will select a new heuristic starting point to continue heuristic search, and thus expand the size of the optimal solution to a certain extent, so as to obtain an optimal solution with a larger AS value. The following will first describe Lemma 2.

[0117] Lemma 2: The current optimal solution is C, and further expansion is not possible, if h-|V(C)|≥3, and a new heuristic starting point can be selected for expansion. The understanding that further expansion is not possible can be that: assuming that the graph G is as shown inFigure 5 As shown, one query Q = (v0, W, [4, 8]) and W = {zoo, park, museum}, if the current optimal solution C = {v0, v1, v2, v3} and AS(C, W) = 9, at this time, continue to expand, that is, add v4, resulting in a decrease in the AS value; since the AS value decreases, v4 needs to be removed from the candidate node set R, at this time, the selected node set R is empty, so the current optimal solution C cannot be expanded.

[0118] Proof: if AS(C U {v}, W) > AS(C, W), that is, Tri(C U {v}) > Tri(C), the addition of v will definitely increase the number of triangles of C U {v}, if h - |V(C)| < 3, the untraversed nodes cannot form a triangle, that is, there is no need to continue to expand.

[0119] The pruning strategy involved in the SACH+ algorithm will be described below.

[0120] Lemma 3: if |V(C')|[AS(C', W) - AS(C, W)] + aD > 0, C' can be merged with C to obtain a larger scale solution.

[0121] Proof: after C and C' are merged, the AS value of the graph can be expressed as Expansion can obtain: where D represents the edge attribute score of the edge connecting the two subgraphs (for example, the edge attribute score of the edge (v3, v4) in Figure 5 ); assuming that the AS value of the merged subgraph is larger, it should satisfy: AS(C U C', W) > AS(C, W), that is, AS(C U C', W) - AS(C, W) > 0, substituting the known term can obtain: (|V(C)| - |V(C')|)AS(C, W) + |V(C')|AS(C', W) + aD > 0, which can be simplified to: |V(C')|[AS(C', W) - AS(C, W)] + aD > 0.

[0122] Pruning rule 2 (that is, the second pruning rule): if |V(C')|[AS(C', W) - AS(C, W)] + aD < 0, C' can be pruned.

[0123] For example, as shown in Figure 5The social network graph G is shown, the query Q = (v0, W, [4, 8]) and W = {zoo, park, museum}, assuming the current optimal solution C = {v0, v1, v2, v3}, AS(C, W) = 9, and cannot be further expanded, then v4 is selected as a new heuristic starting point, the SACH algorithm is called to heuristically search for a subgraph C' consisting of at most 4 nodes, for example, C' = {v4, v5, v8, v9}, Δ = ES((v3, v4), W), the current optimal solution Φ = {v0, v1, v2, v3, v4, v5, v8, v9} and AS(Φ, W) = 10.438, then it is obvious that AS(Φ, W) > AS(C, W), at this time C' will be retained without pruning.

[0124] The optimization algorithm SACH+ is as follows:

[0125]

[0126]

[0127] Specifically, the embodiment will explain the principle of community search with a scale constraint on an attribute graph in combination with the above SACH+ algorithm: the algorithm first calls the SACH algorithm to obtain an optimal solution C that cannot be further expanded, if the number of untraversed nodes is greater than or equal to 3, then a new heuristic starting point is searched for to perform heuristic search (lines 1-2); all neighbor nodes of the nodes in C are sorted in descending order according to degrees (line 3) to obtain a degree sorting set R'; then a node with the largest degree is taken out of R' as a new heuristic starting point v q '(line 4); before re-heuristic search, G and Q are updated, that is, C that has become an optimal solution is removed from G (that is, only the unsearched part is left), and the lower and upper limit values of the scale are changed (line 5); then the SACH algorithm is called to perform new heuristic search (line 6); the pruning strategy 2 is used to judge the new heuristic result C' (that is, whether the current heuristic result C' is to be retained is judged), and whether the AS value obtained by adding C' to C is increased is judged, if both conditions are met, the new heuristic result C' is retained, and is combined with the optimal solution C obtained by calling the SACH algorithm at the beginning of the algorithm to obtain a larger-scale optimal solution Φ (lines 7-10), that is, a larger-scale new target subgraph is obtained.

[0128] The algorithm complexity of SACH+ will be analyzed as follows: The time complexity of SACH+ mainly depends on the number of re- heuristic searches. In each heuristic search, the nodes in the remaining untraversed R' are sorted, and the time complexity of this step is O(|R'|log|R'|). Since multiple searches may be needed, the total time complexity is O(|R'|log|R'|+|R'|h|R|log|R|m).

[0129] Step S30: output the target subgraph as the optimal community.

[0130] In this embodiment, the target subgraph with the maximum AS value is output, i.e., the optimal community is output. In summary, for the community search on the attribute graph with a limited size, the optimal community is determined by the graph attribute score in this embodiment, i.e., a parameter-free community model is used to measure the tightness of the community, thereby avoiding the difficulty of specifying parameters, and a pruning rule is introduced for community search to quickly and effectively find a subgraph meeting the requirements, thereby effectively improving the accuracy and efficiency of the community search on the attribute graph with a limited size.

[0131] The heuristic algorithm and the optimization algorithm are also experimentally verified in this embodiment.

[0132] Real and synthetic datasets are used in the experiment, and the details are shown in Table 2. These datasets are commonly used to evaluate existing methods for solving community discovery, attribute community search, and keyword search problems. Facebook is a dataset with real community nodes and attributes. DBLP and Dbpedia have attributes but no real community structure. In addition, synthetic datasets are generated in this paper, and the attributes are synthetic. The dataset Amazon has a real community structure but does not include attribute information in the vertices. We first generate a keyword pool, and then randomly select 3 keywords from the keyword pool to assign to each community. Then, we assign 1-3 keywords related to the community containing the vertex to each vertex. For community members, 80% must contain at least one selected keyword.

[0133] Table 2: Examples of datasets

[0134] Dataset name Number of vertices Number of edges Number of attribute words Average number of triangles Facebook 1.9K 8.9K 3064 43 DBLP 977K 3.5M 34213 121 DBpedia 8M 72M 45328 79 Amazon 335K 926K 1674 19

[0135] Model Comparison: To verify the performance of the algorithm and community model provided in this embodiment, the model used in this embodiment (i.e., the SAC model) is compared with other models (such as the ATC model and the DLAM model). Attributed truss community (ATC) refers to finding a (k, d)-truss that satisfies the following constraints given a set of query nodes, a set of query attribute words, and two integers k and d: (1) each edge in the (k, d)-truss has at least (k-2) common neighbors; (2) the maximum shortest path in the (k, d)-truss is no greater than d. The Discrepancy maximisation model (DLAM) implements an exact algorithm for finding the most dissimilar subgraph, i.e., given a query vertex set Q, finding a subgraph C that maximizes α|Q∩V(C)|-|V(C)\Q|.

[0136] Evaluation metrics: This embodiment uses the following evaluation metrics to verify the effectiveness of the community model by simulating different query scenarios: (1) F1 score: If the dataset has real communities, the F1 score is used to evaluate the quality of the resulting communities; (2) Minimum degree: The degree of the node with the minimum degree in a graph is the minimum degree of the graph; (3) Edge density: It is usually used to evaluate the structural cohesion of a community H, defined as...

[0137] Query Testing: For each dataset, 200 keyword queries were randomly selected and tested for each experiment. Each keyword query Q could contain 1-6 keywords, while the default keyword query contained only 3 keywords per query. This embodiment uses the average performance of running 200 keyword queries as the result of the experimental evaluation.

[0138] Datasets with real-world community structure and node attributes: randomly selected deg in graph G. G Nodes with (v) ≥ 5 are used as query nodes. This experiment was conducted on the Facebook dataset, which contains 5 real-world communities and attribute information, such as... Figure 6 As shown, different models are displayed ( Figure 6 The four rectangles corresponding to Facebook_1, from left to right, represent the F1 scores of the ATC model, DLAMONE model, DLAMALL model, and SAC model on this dataset.

[0139] from Figure 6The results show that the SAC model significantly outperforms other models, generally achieving higher accuracy. The ATC model scored lower than SAC, primarily because ATC's structural cohesion metric might discard many edges contained in real-world communities but not satisfying the minimum common neighbor constraint. DLAMONE and DLAMALL, on the other hand, failed to find communities closer to real-world cohesion. This is because SAC and ATC consider both structural and attribute cohesion, while DLAMONE and DLAMALL do not. In real-world datasets, cohesion is determined by both structural and attribute considerations.

[0140] Change the number of query attributes: Change the number of query attributes from 1 to 6; Figure 7 This indicates that the F1 score of the SAC model is sensitive to the size of |W|, meaning the F1 score increases with increasing |W|, then decreases after a certain threshold. Too small a |W| will fail to accurately describe the community, while too large a |W| will introduce noise that interferes with the search. When the query attribute set W contains 4 to 5 attribute terms, the algorithm in this embodiment can find results that closely approximate real communities across all datasets.

[0141] Changing the size limit: For each h, this embodiment sets the upper limit to 15 and sets l to h-3, where Figure 8 and Figure 9 The algorithm displays the community sizes returned by the GreedyF, GreedyD, SACH, and SACH+ algorithms, where the size constraint [l, h] varies from [3, 6] to [12, 15]. It can be seen that the result sizes of the GreedyF algorithm, the SACH algorithm, and the SACH+ algorithm provided in this embodiment are all within the range of [l, h]. However, the GreedyD algorithm results in a community with more than h vertices. This is because the GreedyF algorithm and the algorithms in this embodiment have size constraints, while the GreedyD algorithm does not.

[0142] To evaluate the quality of the results, this embodiment also experimentally extracted the minimum degree and edge density of the result communities. With variations in [l, h], the minimum degree and edge density of the result communities on the Amazon dataset are as follows: Figure 10 and Figure 11 As shown ( Figure 10 and Figure 11 The four rectangles corresponding to [3, 6] are, from left to right, the GreedyD algorithm, the GreedyF algorithm, the SACH algorithm, and the SACH+ algorithm. It can be seen that the result quality of the GreedyD algorithm is slightly higher than that of the GreedyF algorithm, while the result quality of the SACH algorithm and the SACH+ algorithm in this embodiment is higher than that of the other two algorithms, with the SACH+ algorithm obtaining the highest result quality.

[0143] Changing the graph size: In order to verify the expansibility of the algorithm, the embodiment also changes the percentage of vertices in the data set to study the scalability of the algorithm. 20%, 40%, 60%, 80% and 100% of edges are randomly selected from the two data sets of DBpedia and Amazon to form new graphs, and different algorithms are run based on the new graphs. The results of the running time required by different algorithms are shown in FIGS. 8 and 9, respectively. It can be seen that the SACH algorithm is the fastest in the medium-sized graph of the data set Dbpedia, and the SACH algorithm is also the fastest in the data set Amazon. Figure 12 Figure 13

[0144] In summary, the embodiment studies the community search problem with size constraints on attributed graphs, aims to maximize the graph attribute score of the returned subgraph, and specifically proposes a heuristic algorithm SACH for solving this problem on large real graphs, and efficiently outputs the optimal result through the optimized SACH+ algorithm. The efficiency of the SACH+ algorithm is derived from the newly developed heuristic strategy and pruning rules. Extensive experiments on large real graphs show that SACH and SACH+ significantly improve the result quality of existing algorithms, and the experimental results of the data set show that the search algorithm provided in the embodiment has high effectiveness in the case of different query sets and different query sizes.

[0145] It should be noted that the step numbers of the steps in the embodiments of the present application do not limit the front and back order of the operations in the technical solutions of the present application.

[0146] The present application also provides an attributed graph community search device with size constraints, comprising:

[0147] An acquisition unit is configured to acquire preset subgraph constraint information, wherein the subgraph constraint information comprises query nodes, an attribute set and a size limit range.

[0148] A search unit is configured to perform heuristic community search on a preset attributed graph based on the subgraph constraint information and a preset first pruning rule to obtain a target subgraph with the highest graph attribute score, wherein the first pruning rule comprises discarding candidate nodes that cannot form a triangle with any two nodes in a current optimal solution set obtained by the search, and the candidate nodes are neighbor nodes of the query nodes; and the target subgraph is taken as an optimal community.

[0149] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described device and each unit can refer to the corresponding processes in the foregoing attributed graph community search method with size constraints, which will not be described herein.

[0150] ​​The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement all steps or part of steps of the preceding attribute graph scale-restricted community search method.

[0151] The embodiment of the present application implements all or part of the preceding processes, and can also be completed by a computer program instructing related hardware. The computer program can be stored in a computer readable storage medium, and the computer program can implement the steps of the above methods when executed by a processor. The computer program includes computer program code, which can be in a source code form, an object code form, an executable file or some intermediate form. The computer readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a ROM (Read-Only memory), a RAM (Random Access memory), an electric carrier wave signal, a telecommunication signal and a software distribution medium, etc. It should be noted that the computer readable medium can include or exclude contents according to the requirements of legislation and patent practice in a jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer readable medium does not include electric carrier wave signals and telecommunication signals.

[0152] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, a server or a computer program product. Therefore, the present application can adopt a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present application can adopt a computer program product implemented on one or more computer readable storage media containing computer usable program code (including but not limited to disk storage and optical storage, etc.).

[0153] The present application is described with reference to flowcharts and / or block diagrams according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general purpose computer, a special purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the computer or other programmable data processing device produce a device for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 The device for implementing the functions specified in one flow or multiple flows and / or blocks Figure 1 The device for implementing the functions specified in one flow or multiple flows and / or blocks

[0154] It has to be noted that, as used herein, the terms "includes", "including", "has", "having" or "has" are intended to be open-ended terms that specifically permit the inclusion of one or more elements, steps, features, components, or the like. As used herein, the term "exemplary" is used to mean "serving as an example, instance, or illustration." Any implementation described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other implementations. The terms "comprises", "comprising", "includes", "including", "has", "having", "contains", "containing" or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises, has, contains or includes, but does not consist of, one or more elements, steps, features, components, or the like, is and is not limited to those elements, steps, features, components, or the like. Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted in an overly literal or restricted way unless expressly so defined herein.

[0155] The foregoing detailed description has set forth various embodiments of the devices and / or methods via the use of specific terminology. However, embodiments thereof should not be construed as limited to the foregoing aspects, and the terminology used herein should not be read to limit the descriptive scope of the application. The description is intended to cover any and all modifications and equivalents, and is limited only by the claims.

Claims

1. A method for a community search on an attributed graph with size constraint, characterized in that, The method comprises the following steps: obtaining preset subgraph constraint information, the subgraph constraint information comprising a query node, an attribute set and a size limit range, a node in the subgraph representing an entity object, an edge representing a social relationship between the entity objects, and an attribute representing a visiting place of interest of the entity object; performing heuristic community search on a preset attribute graph based on the subgraph constraint information and a preset first pruning rule to obtain a target subgraph with a highest graph attribute score, the first pruning rule comprising discarding a candidate node that cannot form a triangle with any two nodes in a current optimal solution set obtained by the search, the candidate node being a neighbor node of the query node, and the graph attribute score representing a score of the subgraph with respect to the attribute set; taking the target subgraph as an optimal community; wherein the heuristic community search on the preset attribute graph based on the subgraph constraint information and the preset first pruning rule to obtain the target subgraph with the highest graph attribute score comprises: initializing the current optimal solution set and a corresponding graph attribute score thereof, and adding the query node to the current optimal solution set; adding a plurality of neighbor nodes of the query node as candidate nodes to a candidate node set, the candidate nodes belonging to nodes on the preset attribute graph; sorting the candidate nodes in the candidate node set based on a preset sorting rule to obtain a sorting result; adding the candidate nodes to the current optimal solution set in sequence according to the sorting result to form a new current optimal solution set and calculate a corresponding graph attribute score thereof; taking a subgraph corresponding to a target current optimal solution set with the highest graph attribute score as the target subgraph; wherein when the number of nodes in the current optimal solution set is greater than or equal to a lower limit value of the size limit range, the candidate node set is discarded, and the candidate node that cannot form a triangle with any two nodes in the current optimal solution set is discarded; the calculation formula of the graph attribute score is: In the formula, AS denotes a graph attribute score, H denotes a subgraph, W denotes an attribute set, Tri(H) denotes the number of triangles in a subgraph, denotes the number of nodes in a subgraph, denotes a weight value parameter, denotes a triangle, denotes the sum of edge attribute scores of three edges of a triangle, e denotes an edge, E(H) denotes the number of edges in a subgraph, denotes an edge attribute score, which represents the sum of the number of the same attribute words of two nodes on each edge and in the attribute set.

2. The method of claim 1, wherein, the sorting of the candidate nodes in the candidate node set based on the preset sorting rule comprises: determining the number of objects that are the same as the attributes in the attribute set among a plurality of attribute objects corresponding to each candidate node, and determining the number of newly added triangles corresponding to each candidate node after the candidate node is added to the current optimal solution set; sorting the candidate nodes in the candidate node set in a descending order of the number of newly added triangles; if the number of newly added triangles of two candidate nodes is the same, sorting the two candidate nodes in a descending order of the number of objects; if the number of newly added triangles and the number of objects of two candidate nodes are the same, sorting the two candidate nodes in an ascending order of node numbers.

3. The method of claim 1, wherein, the adding of the candidate nodes to the current optimal solution set in sequence according to the sorting result to form the new current optimal solution set and calculate the corresponding graph attribute score thereof comprises: adding a first candidate node with the highest sorting to the current optimal solution set to obtain a new current optimal solution set, and calculating a first graph attribute score corresponding to the new current optimal solution set; if the first graph attribute score is less than or equal to the graph attribute score corresponding to the current optimal solution set, discarding the first candidate node. performing the step of adding the highest-ranked first candidate node into the current optimal solution set based on the next candidate node adjacent to the first candidate node and the new current optimal solution set if the first graph attribute score is greater than a graph attribute score corresponding to the current optimal solution set. performing the step of adding the highest-ranked first candidate node into the current optimal solution set based on the next candidate node adjacent to the first candidate node and the new current optimal solution set if the first graph attribute score is greater than a graph attribute score corresponding to the current optimal solution set.

4. The method of claim 1, wherein, After the step of performing heuristic community search on the preset attribute graph based on the subgraph constraint information and a preset first pruning rule to obtain a target subgraph with a highest graph attribute score, the method further includes: When the target current optimal solution set corresponding to the target subgraph cannot be continuously expanded, and a difference between an upper limit value of the scale limit range and a number of nodes of the target current optimal solution set is not less than a preset value, a neighbor node of a node in the target current optimal solution set is taken as a new query node, and the scale limit range is updated according to the preset value and the difference to obtain a new scale limit range; performing new heuristic community search on an unsearched part of the preset attribute graph based on the new query node and the new scale limit range to obtain a heuristic subgraph and a graph attribute score corresponding to the heuristic subgraph; performing pruning processing on the current heuristic subgraph based on a preset second pruning rule; When a graph attribute score corresponding to the merged optimal solution set is greater than a graph attribute score corresponding to the target current optimal solution set, a subgraph corresponding to the merged optimal solution set is taken as a new target subgraph, the merged optimal solution set being a set corresponding to the current heuristic subgraph after pruning and the target current optimal solution set after merging; The second pruning rule includes that if the current heuristic subgraph satisfies the following formula, the current heuristic subgraph is pruned: + 0 wherein, denotes the set corresponding to the current heuristic subgraph, denotes the target current optimal solution set, denotes the attribute set, denotes the number of nodes in the current heuristic subgraph, denotes the graph attribute score of the current heuristic subgraph, denotes the graph attribute score of the subgraph corresponding to the target current optimal solution set, denotes the edge attribute score of the edge connecting the two subgraphs, the edge attribute score representing the sum of the number of the same attribute words of the attribute words of the two nodes on each edge and the attribute words in the attribute set, denotes the weight value parameter.

5. The method of claim 4, wherein, The step of taking the neighbor node of the node in the target current optimal solution set as the new query node includes: performing descending order sorting on neighbor nodes of all nodes in the target current optimal solution set according to degrees to obtain a degree sorting set; cyclically taking a node with a maximum degree from the degree sorting set as the new query node.

6. An apparatus for a size-limited community search on an attributed graph, characterized in that, The method includes: an acquisition unit configured to acquire preset subgraph constraint information, the subgraph constraint information including a query node, an attribute set and a scale limit range, a node in a subgraph representing an entity object, an edge representing a social relationship between entity objects, and an attribute representing a visiting place of interest of an entity object; a search unit configured to perform heuristic community search on a preset attribute graph based on the subgraph constraint information and a preset first pruning rule to obtain a target subgraph with a highest graph attribute score, the first pruning rule including discarding a candidate node that cannot form a triangle with any two nodes in a current optimal solution set obtained through the search, the candidate node being a neighbor node of the query node, and the graph attribute score representing a score of the subgraph with respect to the attribute set; and taking the target subgraph as an optimal community. The search unit is specifically configured to: initialize the current optimal solution set and a graph attribute score corresponding to the current optimal solution set, and add the query node into the current optimal solution set. The plurality of neighbor nodes of the query node are added to the candidate node set as candidate nodes, and the candidate nodes belong to nodes on a preset attribute graph; The candidate nodes in the candidate node set are sorted based on a preset sorting rule to obtain a sorting result; The candidate nodes are sequentially added to the current optimal solution set according to the sorting result, to form a new current optimal solution set and calculate a graph attribute score corresponding to the new current optimal solution set; A subgraph corresponding to a target current optimal solution set with the highest graph attribute score is taken as a target subgraph; When the number of nodes in the current optimal solution set is greater than or equal to a lower limit value of the scale limit range, candidate nodes in the candidate node set that cannot form a triangle with any two nodes in the current optimal solution set are discarded; The calculation formula of the graph attribute score is: wherein, AS denotes a graph attribute score, H denotes a subgraph, W denotes a set of attributes, Tri(H) denotes the number of triangles in a subgraph, denotes the number of nodes in a subgraph, denotes a weight value parameter, denotes a triangle, denotes the sum of edge attribute scores of three edges of a triangle, e denotes an edge, E(H) denotes a set of edges in a subgraph, denotes an edge attribute score, which denotes the sum of the number of identical attribute words of two nodes on each edge and in the set of attributes.

7. The property graph on-scale community search apparatus of claim 6, wherein, The search unit is further configured to: When the target current optimal solution set corresponding to the target subgraph cannot be further expanded, and a difference between the upper limit value of the scale limit range and the number of nodes in the target current optimal solution set is not less than a preset value, neighbor nodes of the nodes in the target current optimal solution set are taken as new query nodes, and the scale limit range is updated based on the preset value and the difference to obtain a new scale limit range; Based on the new query nodes and the new scale limit range, a new heuristic community search is performed on an unsearched part of the preset attribute graph to obtain a heuristic subgraph and a graph attribute score corresponding to the heuristic subgraph; The current heuristic subgraph is pruned based on a preset second pruning rule; When the graph attribute score corresponding to the merged optimal solution set is greater than the graph attribute score corresponding to the target current optimal solution set, a subgraph corresponding to the merged optimal solution set is taken as a new target subgraph, and the merged optimal solution set is a set corresponding to the unpruned current heuristic subgraph and a set obtained by merging the target current optimal solution set; The second pruning rule includes that if the current heuristic subgraph satisfies the following formula, the current heuristic subgraph is pruned: + 0 wherein, denotes the set of current heuristic sub-graphs, denotes the target current optimal solution set, denotes the attribute set, denotes the number of nodes in the current heuristic sub-graph, denotes the graph attribute score of the current heuristic sub-graph, denotes the graph attribute score of the sub-graph corresponding to the target current optimal solution set, denotes the edge attribute score of the edge connecting the two sub-graphs, the edge attribute score representing the sum of the number of the same attribute words of the attribute words of the two nodes on each edge and the attribute words in the attribute set, denotes the weight value parameter.

8. A computer-readable storage medium, characterized in that: The computer readable storage medium stores a computer program, and when the computer program is executed by the processor, the attribute graph scale-limited community search method in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Influence community search method and system based on community retrieval

    CN110162716A

  • Attribute graph community search method and system based on representation learning

    CN113626723A