Method for establishing key relationship in social network based on k truss
1. A method for establishing a key relationship in a social network based on a k truss is characterized in that the k truss needs to satisfy two conditions: any one of the edges is contained in at least (k-2) triangles; is extremely large, i.e., any of its hypergraphs is not a k-truss; the method comprises the following steps:
unnecessary points and edges in the graph G are filtered through three pruning strategies, including:
introduction 1: defining H (k) as a set of stripped edges, i.e., H (k) is equal to the edge of k truss except the edge of (k +1) truss; given graph G, if the established key relationship, i.e., candidate edge e, has at least one follower, then the condition needs to be satisfied: 1) in FIG. G, the edge e is contained at least in (k-2) triangles; 2) at least one triangle containing edge e can be found such that the other two edges except e belong to the (k-1) truss and at least one of the two edges is in H (k-1); the follower is an edge which does not satisfy the k truss originally and is left in the k truss due to the establishment of a key relation;
2, leading: according to the sequence of deleting the edges which do not meet the k truss in the H (k-1), recursively dividing the edges in the H (k-1) into different layers, recording the deletion as the ith deletion when deleting the edge which does not meet the requirement, and recording the deleted edge set as L (i) until all the edges in the H (k-1) are added into the corresponding layers; if the deletion frequency is s, L (s +1) is the edge of the k truss; all deleted edges constitute the release layer structure L, i.e., L ═ H (k-1), from the beginning of the first deletion to the end of the last deletion; meanwhile, l (e) is used to represent the layer index of the edge e, i.e., l (e) ═ i;
by using Ge to represent graph G containing all the edges from the layer L (i) where the edge e is located to the last layer L (S +1) and the points where these edges are connected, S+(e) Represents the number of triangles including the side e in Ge;
given FIG. G, if there is a triangle containing edge e, the other two edges of the triangle are e1 and e2, respectively, such that the tier indices of e1 and e2 satisfy l (e 1). ltoreq.l (e2), and S+(e1) If k-3, the edge e is a candidate edge;
and 3, introduction: giving two candidate edges e 'and e', wherein the first layer follower obtained after adding e 'in the k truss belongs to the follower obtained after adding e' in the k truss, skipping e ', and only calculating the candidate edge e';
through a maximum k truss greedy heuristic algorithm, B-round iteration greedy is performed to obtain a key edge set B, so that the contact of a key user is quickly found in a social network, and the method comprises the following steps:
step one, obtaining a candidate edge set M of a graph G according to the lemma 1;
step two, calculating a stripping layer structure L;
filtering partial edges in the candidate edge set M by using the lemma 2 to obtain a candidate edge set M';
filtering partial edges in the candidate edge set M 'by using the lemma 3 to obtain a candidate edge set M';
and step five, selecting the edge with the largest number of followers from the candidate edge set M' and recording the edge as u, putting u into the key edge set B, returning to the step one until B rounds of iteration are completed to find out preset B key edges, and outputting the key edge set B.
2. The method for establishing key relationships in a social network based on a k-truss according to claim 1, wherein the first step comprises: obtaining a truss (k-1) and a k truss according to the k value, and obtaining H (k-1) according to the theorem 1; and traversing any two points which are different and have no edge in the graph G, supposing that the edge between the two points is e, judging whether e is a candidate edge according to the theorem 1, and adding the candidate edge into the candidate edge set M if the condition is met.
3. The method for establishing key relationships in a social network based on a k-truss according to claim 1, wherein the second step comprises: recording the iteration number i as 1, if the edge e still exists in H (k-1), judging whether the number of triangles containing the edge e in the (k-1) truss is less than k-2, if so, adding e into L (i), removing e from the (k-1) truss, and simultaneously adding 1 to the iteration number i; if no edges are present in H (k-1), the edges in all k trusses are placed in L (i) and returned to the peel ply structure L.
4. The method for establishing key relationships in a social network based on k trusses as claimed in claim 1, wherein said step four comprises: and for the candidate edge set M ' and the candidate edge set M ' needing to be returned, for the edge e ' in the M ' and the edge e ' in the M ', if the followers of the first layer obtained after adding the e ' in the k truss belong to the followers obtained after adding the e ' in the k truss, continuously searching the edges in the candidate edge set M ', otherwise, calculating the number of the followers of the e ', putting the e ' into the M ', and returning the candidate edge set M until all the edges in the M ' are traversed.
5. A computer device comprising a memory and a processor, the memory having stored therein computer-readable instructions that, when executed by the processor, cause the processor to perform the steps of the method of any one of claims 1-4.
6. A storage medium storing computer-readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the method of any one of claims 1-4.
Background
In recent years, researchers have attracted a great deal of interest in the user's participation in social networks. In real life, people's lives are not separated from social networks, and social networks such as microblogs, facebooks, twitter and the like play a vital role in our lives. In social networking research, user relationship strength is generally viewed as the most fundamental and important network feature in social networking. Many social networking models have been proposed in prior studies, such as k-kernels, k-trusses, and k-cliques. While k-trusses not only emphasize users participating in an activity (i.e., the number of friends), but also require strong connections between users (i.e., common friends). Therefore, we can find the most valuable key edges without connection establishment through the k-truss, make it establish connection through encouraging policy, thereby maintaining stability of the network, and we can also evaluate participation of the social network. Through the k-truss we can also find closely related elements in many other complex networks, including the internet, world wide web, cellular networks, and brain networks, among others. The number of edges in the k-truss can be used to measure the stability of the network structure, and potential key links in the k-truss are found, and the increase of the links can greatly stabilize the social network based on the k-truss. However, in existing studies, the efficiency of potential key connections in k-truss based social networks was not found to be high.
Disclosure of Invention
In a social network, the strength of the relationship between users can significantly affect the stability of the social network. The invention enhances the stability of the social network by using a k truss, which satisfies two conditions: any one of the edges is contained in at least (k-2) triangles; is extremely large, i.e., any of its supergraphs is not a k-truss.
Considering the properties of k trusses, the present invention proposes a new pruning strategy to more effectively reduce the size of the candidate set. Meanwhile, the invention develops an efficient KTA algorithm by combining a new pruning strategy, thereby being capable of quickly finding the most key user relationship on a large k-truss social network.
The purpose of the invention is realized by the following technical scheme: a method for establishing key relationships in a social network based on a k-truss comprises the following steps:
unnecessary points and edges in the graph G are filtered through three pruning strategies, including:
introduction 1: defining H (k) as a set of stripped edges, i.e., H (k) is equal to the edge of k truss except the edge of (k +1) truss; given graph G, if the established key relationship, i.e., candidate edge e, has at least one follower, then the condition needs to be satisfied: 1) in FIG. G, the edge e is contained at least in (k-2) triangles; 2) at least one triangle containing edge e can be found such that the other two edges except e belong to the (k-1) truss and at least one of the two edges is in H (k-1); the follower is an edge which does not satisfy the k truss originally and is left in the k truss due to the establishment of a key relation;
2, leading: according to the sequence of deleting the edges which do not meet the k truss in the H (k-1), recursively dividing the edges in the H (k-1) into different layers, recording the deletion as the ith deletion when deleting the edge which does not meet the requirement, and recording the deleted edge set as L (i) until all the edges in the H (k-1) are added into the corresponding layers; if the deletion frequency is s, L (s +1) is the edge of the k truss; all deleted edges constitute the release layer structure L, i.e., L ═ H (k-1), from the beginning of the first deletion to the end of the last deletion; meanwhile, l (e) is used to represent the layer index of the edge e, i.e., l (e) ═ i;
by using Ge to represent graph G containing all the edges from the layer L (i) where the edge e is located to the last layer L (S +1) and the points where these edges are connected, S+(e) Represents the number of triangles including the side e in Ge;
given FIG. G, if there is a triangle containing edge e, the other two edges of the triangle are e1 and e2, respectively, such that the tier indices of e1 and e2 satisfy l (e 1). ltoreq.l (e2), and S+(e1) If k-3, the edge e is a candidate edge;
and 3, introduction: giving two candidate edges e 'and e', wherein the first layer follower obtained after adding e 'in the k truss belongs to the follower obtained after adding e' in the k truss, skipping e ', and only calculating the candidate edge e';
through a maximum k truss greedy heuristic algorithm, B-round iteration greedy is performed to obtain a key edge set B, so that the contact of a key user is quickly found in a social network, and the method comprises the following steps:
step one, obtaining a candidate edge set M of a graph G according to the lemma 1;
step two, calculating a stripping layer structure L;
filtering partial edges in the candidate edge set M by using the lemma 2 to obtain a candidate edge set M';
filtering partial edges in the candidate edge set M 'by using the lemma 3 to obtain a candidate edge set M';
and step five, selecting the edge with the largest number of followers from the candidate edge set M' and recording the edge as u, putting u into the key edge set B, returning to the step one until B rounds of iteration are completed to find out preset B key edges, and outputting the key edge set B.
Further, the first step comprises: obtaining a truss (k-1) and a k truss according to the k value, and obtaining H (k-1) according to the theorem 1; and traversing any two points which are different and have no edge in the graph G, supposing that the edge between the two points is e, judging whether e is a candidate edge according to the theorem 1, and adding the candidate edge into the candidate edge set M if the condition is met.
Further, the second step comprises: recording the iteration number i as 1, if the edge e still exists in H (k-1), judging whether the number of triangles containing the edge e in the (k-1) truss is less than k-2, if so, adding e into L (i), removing e from the (k-1) truss, and simultaneously adding 1 to the iteration number i; if no edges are present in H (k-1), the edges in all k trusses are placed in L (i) and returned to the peel ply structure L.
Further, the fourth step includes: and for the candidate edge set M ' and the candidate edge set M ' needing to be returned, for the edge e ' in the M ' and the edge e ' in the M ', if the followers of the first layer obtained after adding the e ' in the k truss belong to the followers obtained after adding the e ' in the k truss, continuously searching the edges in the candidate edge set M ', otherwise, calculating the number of the followers of the e ', putting the e ' into the M ', and returning the candidate edge set M until all the edges in the M ' are traversed.
The invention also provides computer equipment which comprises a memory and a processor, wherein the memory stores computer readable instructions, and the computer readable instructions, when executed by the processor, cause the processor to execute the steps of the method for establishing the key relationship in the social network based on the k truss.
The present invention also provides a storage medium storing computer-readable instructions, which when executed by one or more processors, cause the one or more processors to perform the steps of the above method for establishing key relationships in a social network based on k-trusses.
The invention has the beneficial effects that: in a social network, the strength of the relationship between users can significantly affect the stability of the social network. The invention enhances the stability of the social network by using a k truss, which satisfies two conditions: any one of the edges is contained in at least (k-2) triangles; is extremely large, i.e., any of its supergraphs is not a k-truss. Considering the properties of k trusses, the present invention proposes a new pruning strategy to more effectively reduce the size of the candidate set. Meanwhile, the invention develops an efficient KTA algorithm by combining a new pruning strategy, thereby being capable of quickly finding the most key user relationship on a large-scale social network. The application of the method disclosed by the invention has great benefits for searching the most critical user relationship of the social network and is greatly helpful for enhancing the stability of the social network in real life.
Drawings
FIG. 1 is a flowchart of a method for establishing key relationships in a social network based on a k-truss according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an original social network provided by an embodiment of the present invention;
FIG. 3 is a schematic diagram of a k-truss in an original social network provided by an embodiment of the present invention;
FIG. 4 is a schematic diagram of a social network with added key relationships provided by an embodiment of the invention;
fig. 5 is a schematic diagram of a k-truss in a social network after adding a key relationship according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced in other ways than those specifically described and will be readily apparent to those of ordinary skill in the art without departing from the spirit of the present invention, and therefore the present invention is not limited to the specific embodiments disclosed below.
The method for establishing the key relationship in the social network based on the k truss comprises three novel pruning strategies and an algorithm (KTA algorithm) for efficiently establishing the key relationship in the k truss social network. The implementation of each part is described in detail below.
Three novel pruning strategies, which are directed to filtering unnecessary points and edges in the graph G, thereby significantly reducing the search space, specifically include the following:
introduction 1: defining H (k) as a set of stripped edges, i.e., H (k) is equal to the edge of k truss except the edge of (k +1) truss; given graph G, if the established key relationship, i.e., candidate edge e, has at least one follower, then the condition needs to be satisfied: 1) in FIG. G, the edge e is contained at least in (k-2) triangles; 2) at least one triangle containing edge e can be found such that the other two edges except e belong to the (k-1) truss and at least one of the two edges is in H (k-1); the follower is an edge which does not satisfy the k truss originally and is left in the k truss due to the establishment of a key relation;
and (3) proving that: the degree of truss of edge e represents the maximum integer k where e belongs to k trusses but not to (k +1) trusses. We demonstrate lemnism by demonstrating that if the condition is not met, edge e will not have a follower. For the first condition, it is assumed that after adding edge e in graph G, when the number of triangles including edge e is less than k-2, it does not affect k-truss or contribute to the support of other edges according to the definition of k-truss. Thus, edge e will not have any followers. For the second condition, if in the triangle containing edge e, the other two edges except e are both in the k-truss but not in H (k-1), which means they are already in the k-truss initially, then they are not the followers of e. If one of the other two sides of the triangle containing edge e is not in the k-1 truss, then that edge is not in the k-truss because the degree of truss for each side changes by at most 1 after the insertion of one edge. Then edge e also has no follower. Therefore, in the triangle including e, at least one of the two sides excluding e is in H (k-1). The theory is led to obtain the evidence.
2, leading: according to the sequence of deleting the edges which do not meet the k truss in the H (k-1), recursively dividing the edges in the H (k-1) into different layers, recording the deletion as the ith deletion when deleting the edge which does not meet the requirement, and recording the deleted edge set as L (i) until all the edges in the H (k-1) are added into the corresponding layers; if the deletion frequency is s, L (s +1) is the edge of the k truss; all deleted edges constitute the release layer structure L, i.e., L ═ H (k-1), from the beginning of the first deletion to the end of the last deletion; meanwhile, l (e) is used to represent the layer index of the edge e, i.e., l (e) ═ i;
by using Ge to represent graph G containing all the edges from the layer L (i) where the edge e is located to the last layer L (S +1) and the points where these edges are connected, S+(e) Represents the number of triangles including the side e in Ge;
given FIG. G, if there is a triangle containing edge e, the other two edges of the triangle are e1 and e2, respectively, such that the tier indices of e1 and e2 satisfy l (e 1). ltoreq.l (e2), and S+(e1) If k-3, the edge e is a candidate edge;
and (3) proving that: due to S+(e1) K-3 and l (e1) ≦ l (e2), which means that when the edge of the k-1 truss is deleted, the added edge e may provide support for e 1. Then e1 will become the follower of e. The theory is led to obtain the evidence.
And 3, introduction: giving two candidate edges e 'and e', wherein the first layer follower obtained after adding e 'in the k truss belongs to the follower obtained after adding e' in the k truss, skipping e ', and only calculating the candidate edge e';
and (3) proving that: when adding an edge, support is first provided for an edge that can form a new triangle with that edge. The edges of the new triangle will then further influence the other edges of the cascade. Thus, if the edges of the first layer found after adding e 'to the k truss all belong to the edges found after adding e "to the k truss, it means that adding e" can provide the same support for the edges found after adding e'. That is, the edges found after adding e' to the k truss are a subset of the edges found after adding e "to the k truss. The theory is led to obtain the evidence.
An algorithm (KTA algorithm) for efficiently establishing key relationships in a k-truss social network is based on the three novel pruning strategies, as shown in fig. 1, and specifically includes the following steps:
step one, obtaining a candidate edge set M of a graph G according to the lemma 1; the method specifically comprises the following steps: obtaining a truss (k-1) and a k truss according to the k value, and obtaining H (k-1) according to the theorem 1; and traversing any two points which are different and have no edge in the graph G, supposing that the edge between the two points is e, judging whether e is a candidate edge according to the theorem 1, and adding the candidate edge into the candidate edge set M if the condition is met.
Step two, calculating a stripping layer structure L; the method specifically comprises the following steps: recording the iteration number i as 1, if the edge e still exists in H (k-1), judging whether the number of triangles containing the edge e in the (k-1) truss is less than k-2, if so, adding e into L (i), removing e from the (k-1) truss, and simultaneously adding 1 to the iteration number i; if no edges are present in H (k-1), the edges in all k trusses are placed in L (i) and returned to the peel ply structure L.
And step three, filtering partial edges in the candidate edge set M by using the theorem 2 to obtain a candidate edge set M'.
Filtering partial edges in the candidate edge set M 'by using the lemma 3 to obtain a candidate edge set M'; the method specifically comprises the following steps: and for the candidate edge set M ' and the candidate edge set M ' needing to be returned, for the edge e ' in the M ' and the edge e ' in the M ', if the followers of the first layer obtained after adding the e ' in the k truss belong to the followers obtained after adding the e ' in the k truss, continuously searching the edges in the candidate edge set M ', otherwise, calculating the number of the followers of the e ', putting the e ' into the M ', and returning the candidate edge set M until all the edges in the M ' are traversed.
And step five, selecting the edge with the largest number of followers from the candidate edge set M' and recording the edge as u, putting u into the key edge set B, returning to the step one until B rounds of iteration are completed to find out preset B key edges, and outputting the key edge set B.
Fig. 2 is a schematic diagram of the original social network provided by the embodiment of the present invention, where if the input k value is 4 and the b value is 1, the obtained 4-truss is composed of { u4, u5, u6, u7, u9}, that is, as shown in fig. 3. Fig. 4 is a schematic diagram of the social network after increasing the key relationship in the embodiment of the present invention, where the key edge set B is { (u3, u9) }, and fig. 5 is a newly obtained 4-truss after increasing the edges (u3, u9) (i.e., dashed lines), and the 4-truss is composed of { u1, u2, u3, u4, u5, u6, u7, u8, u9 }.
Furthermore, the present invention performed extensive experiments on nine real-world social networks to evaluate the effectiveness and efficiency of the proposed method. To evaluate the performance of the proposed method, we performed experiments by varying the parameters k and b. The invention uses the time consumed by the algorithm to measure the high efficiency of the proposed method. For each setting, the invention was run 10 times and averaged. All procedures were implemented in standard c + +, and all experiments were performed on a PC equipped with an Intel i5-9600KF 3.7GHz CPU and 64GB RAM main memory. Experiments show that the method is 2 orders of magnitude faster than the basic greedy algorithm.
In one embodiment, a computer device is provided, which includes a memory and a processor, where the memory stores computer readable instructions, and the computer readable instructions, when executed by the processor, cause the processor to perform the steps of the method for establishing key relationships in a social network based on k trusses in the above embodiments.
In one embodiment, a storage medium storing computer-readable instructions is provided, and the computer-readable instructions, when executed by one or more processors, cause the one or more processors to perform the steps of the method for establishing key relationships in a social network based on k-trusses in the embodiments. The storage medium may be a nonvolatile storage medium.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
The foregoing is only a preferred embodiment of the present invention, and although the present invention has been disclosed in the preferred embodiments, it is not intended to limit the present invention. Those skilled in the art can make numerous possible variations and modifications to the present teachings, or modify equivalent embodiments to equivalent variations, without departing from the scope of the present teachings, using the methods and techniques disclosed above. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention are still within the scope of the protection of the technical solution of the present invention, unless the contents of the technical solution of the present invention are departed.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:一种挖掘符号网络中最大有符号θ团的方法