# The Algorithm of Link Prediction on Social Network

Authors: Liyan Dong; Yongli Li; Han Yin; Huang Le; Mao Rui
Journal: Mathematical Problems in Engineering
 (2013)

---

## Abstract

At present, most link prediction algorithms are based on the similarity between two entities. Social network topology information is one of the main sources to design the similarity function between entities. But the existing link prediction algorithms do not apply the network topology information sufficiently. For lack of traditional link prediction algorithms, we propose two improved algorithms: CNGF algorithm based on local information and KatzGF algorithm based on global information network. For the defect of the stationary of social network, we also provide the link prediction algorithm based on nodes multiple attributes information. Finally, we verified these algorithms on DBLP data set, and the experimental results show that the performance of the improved algorithm is superior to that of the traditional link prediction algorithm.


---

## Body

## 1. Introduction

Currently with the rapid development, online social network has been a part of people’s life. A lot of sociology, biology, and information systems can use the network to describe, in which nodes represent individual and edges represent the relationships between individuals or the interaction between individuals. Therefore, the study of complex networks has been the important branch of many scientific fields. Link prediction is an important task in link mining. Link prediction is to predict whether there will be links between two nodes based on the attribute information and the observed existing link information. Link prediction not only can be used in the field of social network but can also be applied in other fields. As in bioinformatics, link prediction can be used to discover interactions between proteins [1]; in the field of electronic commerce, link prediction can be used to create the recommendation system [2]; and in the security field, link prediction can help to find the hidden terrorist criminal gangs [3]. Link prediction is closely related to many areas. Therefore, in recent years there are a lot of correlation algorithms proposed to solve the problem of link prediction.


## 2. The Summary of Social Network

In real life, the individuals are not independent of each other. They are mutually contacted and affected. If we only pay attention to individual attributes, while ignoring the relationships between individuals, this is bound to affect the accuracy and comprehensiveness of analysis. Social network represents the relationship between social entities (such as each person, social group). Social network analysis focuses on explaining the hidden patterns and the effects of these relationships. It is based on such an assumption, namely, the individuals in social groups are interdependent, not independent autonomous units. Social network includes a set of objects and relationships between them [4]. These relationships can be any type of social relationships, such as friendship, the purchase of relationship. Social networks can be represented by graph. Graph G contains nodes set V and edges set E. We can use G=〈V,E〉 to represent the graph G. In this paper, the nodes set represents objects, and the edges set represents the relationships between objects.The properties of social network are small world effect, scale-free effect, and cluster effect. Small world effect is produced by American psychologist Stanley Milgram in 1969 [5]. He found that assign the name of the recipient randomly, and send a message to his own people, and so on, this message can reach the hands of the recipient in a relatively short path (about 6 people). The result was that the famous “six degrees of separation” theory was generated. Social network, internet network, and simulation network have small world properties. In the network, small world effect refers to that the average distance in the network is very small compared to the size of the network. That is to say, each pair of nodes can be connected through a short path in a network [6]. The scale-free effect refers to that most nodes’ links are very small in the network; only a few nodes have lots of links. In this network, nodes with high degree are called hubs (hinge node). The hub node dominates the network operation. Scale-free effect displays that node degree distribution is seriously uneven in large-scale network. Clustering effect of social network refers to that there is a circle of friends, acquaintances, rings, and other small groups in social network. Each member of the small group knows each other. This phenomenon can be described by graph; namely, there is many fully connected subgraphs in social network.


## 3. The Traditional Link Prediction Algorithms

The link prediction is an important research field in data mining. It has a wide range of scenarios. Many data mining tasks involve the relationship between the objects. Link prediction can be used for recommendation systems, social networks, information retrieval, and many other fields.Given a snapshot graph of the social network at a momentG=〈V,E〉 and the node vi and the node vj, link prediction is to predict the probability of the link between the node vi and the node vj. It can be seen through the definition of link prediction that the link prediction task is divided into two categories. The first category is to predict that the new link will appear in future time. The second category is to forecast hidden unknown link in the space.The easiest framework of link prediction algorithm is based on the similarity of the algorithm. Any pair of nodex and node y, we have assigned to this node is a function Similarity  (x,y), this function is defined as the similarity function between nodes x and y. Then sorting the nodes pair in accordance with the function values from the largest to smallest, the greater the value of the similarity function, the greater the probability of the link in the nodes.Here we introduce some simple link prediction similarity indexes.


### 3.1. Local Similarity Index

#### 3.1.1. Common Neighbors

Assume that the nodev∈V; then the neighbors of the node set Γ(v):={t∣(t,v)∈E∨(v,t)∈E∧t≠v}; that is, Γ(v) is the set of all the neighbors of node v. The common neighbors of node u and node v refer to the jointly owned neighbors by node u and node v. For the undirected graph, the common neighbors can use the following definition:
(1)Similarity(u,v)=|Γ(u)∩Γ(v)|.Kossinets and Watts analysis of the large-scale social network, found that two students who have more mutual friends will have greater possibility to become friends [7].


#### 3.1.2. Preferential Attachment

Preferential attachment mechanism can be used to generate scale-free network evolution model. The probability of generating a new link of nodeu is directly proportional to the degree of the node [8]. This is the same as the truth “the rich are getting richer” in economics. Therefore, the probability of the link between node u and node v is directly proportional to du×dv. Inspired by this mechanism, the PA similarity index can be defined as follows:
(2)Similarity(u,v)=du×dv.It may be noted that the similarity index does not require any node neighbor information; therefore, this similarity index has the lowest computational complexity.


#### 3.1.3. Adamic-Adar [9]

This similarity index assigns a higher similarity function value to a small degree node. Adamic-Adar algorithm believes that an affair owned by less objects, compared to owned by more objects, has greater effect on link prediction. Its definition is as follows:(3)Similarity(u,v)=∑z∈Γ(u)∩Γ(v)1logdz.


#### 3.1.4. Resource Allocation

This similarity index is inspired by the ideas of complex network resources dynamically allocated [10]. In pair of nodes u, v that have no direct link, node u can allocate some resources to the node v through their common neighbor. Their common neighbors assume the role of passers. In the simplest case, we assume that each passer has a unit of resources; it assigns these resources to its neighbors evenly. Therefore, the similarity of node u and node v can be defined as the number of resources that node u get from node v; namely,
(4)Similarity(u,v)=∑z∈Γ(u)∩Γ(v)1dz.


### 3.2. Overall Similarity Index

#### 3.2.1. Katz [11]

In 1953, Katz described the similarity using the global path. The idea of the method is that the more paths between two nodes are, the greater the similarity between two nodes is. Katz measure is defined as follows:(5)Similarity(u,v)=∑l=1lmax=∞βl·|pathu,vl|Similarity(u,v)=βAuv+β2(A2)uv+β3(A3)uv+⋯,where|pathu,vl| is the number of paths between node u and node v and the length of the path is l. β is a parameter between 0 and 1. This parameter is used to control the contribution of path to the similarity; the longer the path is, the less contribution the path made to the similarity. The computational complexity of Katz measure is n3, so the measure is not suitable for large-scale network.


#### 3.2.2. Random Walk with Restart (RWR) [12]

This indicator is a direct application of the PageRank algorithm. A random walker starting from nodeu will reach its random neighbor with probability c repeatedly and return the node u with the probability 1-c. quv represents the probability of the random walker reaching node v in the steady state condition. Therefore, we have qu→=cPTqu→+(1-c)eu→, where P is the transfer matrix. If the node u is connected with node v, then Puv=1/d(u); else Puv=0. So the solution is simple; namely, qu→=(1-c)(I-cPT)-1eu→. RWR coefficient can be defined as
(6)Similarity(u,v)=quv+qvu.Compared to the local similarity index, the global similarity index needs more overall network topology information. Although the performance of the overall similarity index is better than the local similarity index, it has two fatal flaws: first, the global similarity index calculation is very time consuming, and when the network is huge, this calculation program of the global similarity index does not work. Second, sometimes the global topology information is not available, especially when we use a decentralized approach to implement the algorithm. Therefore, how to design a similarity index is particularly important, which is easy to calculate and its accuracy is high.Although the traditional link prediction algorithms have made some prediction effect, they do not make full use of the topology information. Common neighbor algorithm treats all the common neighbors equally; it does not distinguish the different neighbors’ different effects on the link prediction. Katz algorithm distinguishes the different path’s influences which have different lengths, but it does not distinguish the influence of the paths with the same length on link prediction. These algorithms only consider the topology characteristics of the network, treat the social networking static, and ignore the time attributes and node attribute of social network. How to integrate the topology characteristics, time characteristics, and node attributes of social network reasonably is an enormous challenge for link prediction facing.


## 3.1. Local Similarity Index

### 3.1.1. Common Neighbors

Assume that the nodev∈V; then the neighbors of the node set Γ(v):={t∣(t,v)∈E∨(v,t)∈E∧t≠v}; that is, Γ(v) is the set of all the neighbors of node v. The common neighbors of node u and node v refer to the jointly owned neighbors by node u and node v. For the undirected graph, the common neighbors can use the following definition:
(1)Similarity(u,v)=|Γ(u)∩Γ(v)|.Kossinets and Watts analysis of the large-scale social network, found that two students who have more mutual friends will have greater possibility to become friends [7].


### 3.1.2. Preferential Attachment

Preferential attachment mechanism can be used to generate scale-free network evolution model. The probability of generating a new link of nodeu is directly proportional to the degree of the node [8]. This is the same as the truth “the rich are getting richer” in economics. Therefore, the probability of the link between node u and node v is directly proportional to du×dv. Inspired by this mechanism, the PA similarity index can be defined as follows:
(2)Similarity(u,v)=du×dv.It may be noted that the similarity index does not require any node neighbor information; therefore, this similarity index has the lowest computational complexity.


### 3.1.3. Adamic-Adar [9]

This similarity index assigns a higher similarity function value to a small degree node. Adamic-Adar algorithm believes that an affair owned by less objects, compared to owned by more objects, has greater effect on link prediction. Its definition is as follows:(3)Similarity(u,v)=∑z∈Γ(u)∩Γ(v)1logdz.


### 3.1.4. Resource Allocation

This similarity index is inspired by the ideas of complex network resources dynamically allocated [10]. In pair of nodes u, v that have no direct link, node u can allocate some resources to the node v through their common neighbor. Their common neighbors assume the role of passers. In the simplest case, we assume that each passer has a unit of resources; it assigns these resources to its neighbors evenly. Therefore, the similarity of node u and node v can be defined as the number of resources that node u get from node v; namely,
(4)Similarity(u,v)=∑z∈Γ(u)∩Γ(v)1dz.


## 3.1.1. Common Neighbors

Assume that the nodev∈V; then the neighbors of the node set Γ(v):={t∣(t,v)∈E∨(v,t)∈E∧t≠v}; that is, Γ(v) is the set of all the neighbors of node v. The common neighbors of node u and node v refer to the jointly owned neighbors by node u and node v. For the undirected graph, the common neighbors can use the following definition:
(1)Similarity(u,v)=|Γ(u)∩Γ(v)|.Kossinets and Watts analysis of the large-scale social network, found that two students who have more mutual friends will have greater possibility to become friends [7].


## 3.1.2. Preferential Attachment

Preferential attachment mechanism can be used to generate scale-free network evolution model. The probability of generating a new link of nodeu is directly proportional to the degree of the node [8]. This is the same as the truth “the rich are getting richer” in economics. Therefore, the probability of the link between node u and node v is directly proportional to du×dv. Inspired by this mechanism, the PA similarity index can be defined as follows:
(2)Similarity(u,v)=du×dv.It may be noted that the similarity index does not require any node neighbor information; therefore, this similarity index has the lowest computational complexity.


## 3.1.3. Adamic-Adar [9]

This similarity index assigns a higher similarity function value to a small degree node. Adamic-Adar algorithm believes that an affair owned by less objects, compared to owned by more objects, has greater effect on link prediction. Its definition is as follows:(3)Similarity(u,v)=∑z∈Γ(u)∩Γ(v)1logdz.


## 3.1.4. Resource Allocation

This similarity index is inspired by the ideas of complex network resources dynamically allocated [10]. In pair of nodes u, v that have no direct link, node u can allocate some resources to the node v through their common neighbor. Their common neighbors assume the role of passers. In the simplest case, we assume that each passer has a unit of resources; it assigns these resources to its neighbors evenly. Therefore, the similarity of node u and node v can be defined as the number of resources that node u get from node v; namely,
(4)Similarity(u,v)=∑z∈Γ(u)∩Γ(v)1dz.


## 3.2. Overall Similarity Index

### 3.2.1. Katz [11]

In 1953, Katz described the similarity using the global path. The idea of the method is that the more paths between two nodes are, the greater the similarity between two nodes is. Katz measure is defined as follows:(5)Similarity(u,v)=∑l=1lmax=∞βl·|pathu,vl|Similarity(u,v)=βAuv+β2(A2)uv+β3(A3)uv+⋯,where|pathu,vl| is the number of paths between node u and node v and the length of the path is l. β is a parameter between 0 and 1. This parameter is used to control the contribution of path to the similarity; the longer the path is, the less contribution the path made to the similarity. The computational complexity of Katz measure is n3, so the measure is not suitable for large-scale network.


### 3.2.2. Random Walk with Restart (RWR) [12]

This indicator is a direct application of the PageRank algorithm. A random walker starting from nodeu will reach its random neighbor with probability c repeatedly and return the node u with the probability 1-c. quv represents the probability of the random walker reaching node v in the steady state condition. Therefore, we have qu→=cPTqu→+(1-c)eu→, where P is the transfer matrix. If the node u is connected with node v, then Puv=1/d(u); else Puv=0. So the solution is simple; namely, qu→=(1-c)(I-cPT)-1eu→. RWR coefficient can be defined as
(6)Similarity(u,v)=quv+qvu.Compared to the local similarity index, the global similarity index needs more overall network topology information. Although the performance of the overall similarity index is better than the local similarity index, it has two fatal flaws: first, the global similarity index calculation is very time consuming, and when the network is huge, this calculation program of the global similarity index does not work. Second, sometimes the global topology information is not available, especially when we use a decentralized approach to implement the algorithm. Therefore, how to design a similarity index is particularly important, which is easy to calculate and its accuracy is high.Although the traditional link prediction algorithms have made some prediction effect, they do not make full use of the topology information. Common neighbor algorithm treats all the common neighbors equally; it does not distinguish the different neighbors’ different effects on the link prediction. Katz algorithm distinguishes the different path’s influences which have different lengths, but it does not distinguish the influence of the paths with the same length on link prediction. These algorithms only consider the topology characteristics of the network, treat the social networking static, and ignore the time attributes and node attribute of social network. How to integrate the topology characteristics, time characteristics, and node attributes of social network reasonably is an enormous challenge for link prediction facing.


## 3.2.1. Katz [11]

In 1953, Katz described the similarity using the global path. The idea of the method is that the more paths between two nodes are, the greater the similarity between two nodes is. Katz measure is defined as follows:(5)Similarity(u,v)=∑l=1lmax=∞βl·|pathu,vl|Similarity(u,v)=βAuv+β2(A2)uv+β3(A3)uv+⋯,where|pathu,vl| is the number of paths between node u and node v and the length of the path is l. β is a parameter between 0 and 1. This parameter is used to control the contribution of path to the similarity; the longer the path is, the less contribution the path made to the similarity. The computational complexity of Katz measure is n3, so the measure is not suitable for large-scale network.


## 3.2.2. Random Walk with Restart (RWR) [12]

This indicator is a direct application of the PageRank algorithm. A random walker starting from nodeu will reach its random neighbor with probability c repeatedly and return the node u with the probability 1-c. quv represents the probability of the random walker reaching node v in the steady state condition. Therefore, we have qu→=cPTqu→+(1-c)eu→, where P is the transfer matrix. If the node u is connected with node v, then Puv=1/d(u); else Puv=0. So the solution is simple; namely, qu→=(1-c)(I-cPT)-1eu→. RWR coefficient can be defined as
(6)Similarity(u,v)=quv+qvu.Compared to the local similarity index, the global similarity index needs more overall network topology information. Although the performance of the overall similarity index is better than the local similarity index, it has two fatal flaws: first, the global similarity index calculation is very time consuming, and when the network is huge, this calculation program of the global similarity index does not work. Second, sometimes the global topology information is not available, especially when we use a decentralized approach to implement the algorithm. Therefore, how to design a similarity index is particularly important, which is easy to calculate and its accuracy is high.Although the traditional link prediction algorithms have made some prediction effect, they do not make full use of the topology information. Common neighbor algorithm treats all the common neighbors equally; it does not distinguish the different neighbors’ different effects on the link prediction. Katz algorithm distinguishes the different path’s influences which have different lengths, but it does not distinguish the influence of the paths with the same length on link prediction. These algorithms only consider the topology characteristics of the network, treat the social networking static, and ignore the time attributes and node attribute of social network. How to integrate the topology characteristics, time characteristics, and node attributes of social network reasonably is an enormous challenge for link prediction facing.


## 4. Link Prediction Algorithms Based on Node Guidance Capability

If there is the case in Figure1, the traditional link prediction algorithm think the degree of similarity calculated between node A and node B is the same as the similarity between node X and node Y. However, when we extracted the subgraph that contained the node A, node B, and their common neighbors, the node X, node Y, and their common neighbors, as shown in Figure 2, we can see that the paths between node A and node B are more than the paths between the node X and the node Y. According to Katz algorithm the similarity of node A and node B is higher than the similarity of node X and node Y.Figure 1
Two social network graphs with the same node degree.Figure 2
The extracted subgraph contains the prediction nodes and their common neighbor.Observing the density of the extracted common neighbor subgraph, if the common neighbors subgraph is denser, the nodes in the subgraph made more contribution to link prediction. Assigning the dense of the subgraph to each node, we can see that if the common neighbor occupied the greater the proportion in the neighbor of the node, it has greater ability to generate new link between the nodeA and node B. Therefore, we designed the following formula to measure the guiding force of the node:
(7)Guidance-force(z)=|ϕ(z)|logdz,wheredz is the degree of node z and |ϕ(z)| is the degree of node z in the extracted subgraph.


### 4.1. CNGF Algorithm

By introducing the definition of node guidance capability, we know that the guidance capabilities of the different nodes are different. The similarity between the two nodes can be represented by the sum of each node’s guidance capability. The guidance capability of the common neighbors is greater and the likelihood of the new link between the two nodes is greater. On this basis, we define the formula of the similarity degree of two nodes:(8)SimilarityCNGF(u,v)=∑z∈Γ(u)∩Γ(v)|ϕ(z)|logdz,
where |ϕ(z)| is the number of links that the node connected with the common neighbors.With the previous formula, we can give the pseudocode of CNGF algorithm based on node guidance capability (see Algorithm1).Algorithm 1:CNGF algorithm.
Input: social network graphG=〈V,E〉, node x, node y
Output: the similarity of nodex and node y
The description of the algorithm:
(1) Find the common neighbor setxy.common_neighbor of the node pair.
(2) Extract the sub-graph which contains the tested node pair and their common neighbors.
(3) While (the common neighbor ser is not null){
(4)Calculate the degree of node v, and get v.degree. Node v is one node of the
common neighbor set.
(5)Calculate the degree of node v in the sub-graph extracted in the Step 2, get
v.common_degree.
(6)Calculate the guidance capability of node v, Guidance (v)=v.common_degree/log(v.degree)
(7)The similarity of node x and node y is Similarity.xy+ = Guidance (v)}The computational complexity of CNGF algorithm isO(N2); N is the maximum of all the nodes’ degree. This computational complexity is also acceptable in large-scale network.


### 4.2. KatzGF Algorithm

The idea of Katz algorithm is that if there are more paths between two nodes, the possibility of a new link existing in the two nodes is greater. Katz algorithm did not distinguish the contribution of the paths with the same path length. The node guidance capability proposed in this paper can distinguish the contribution of different nodes effectively. We can make use of the node guidance capability in Katz algorithm. Because of different nodes, the contribution of the paths with the same path length is different. Based on the previous ideas, we designed the KatzGF algorithm. The KatzGF algorithms integrated the local node information and the global social network information reasonably.The most important part of the KatzGF algorithm is how to design the formula for the degree of similarity between two nodes. Taking into account the contribution of the different nodes on the same path length is different, we can design the similarity formula of KatzGF:(9)SimilarityKatzGF(u,v)=∑l=1l=∞βl(∑z∈Pathuvl|ϕ(z)|logdz),whereβ is a parameter between 0 and 1. This parameter is used to control the contribution of path to the similarity; the longer the path is, the less contribution the path made to the similarity. |ϕ(z)| is the degree of node z in the subgraph containing the test nodes and all the path nodes between the test nodes. dz is the degree of node z. The formula first calculated the guidance capability of each node on the path between node pairs and then put the sum of all path nodes’ guidance capability as the contribution of the path to link prediction.With the previous formula, we can give the pseudocode of KatzGF algorithm (see Algorithm2).Algorithm 2:KatzGF algorithm.
Input: social network graphG=〈V,E〉, node x, node y
Output: the similarity of nodex and node y
The description of the algorithm:
(1) Find all paths between nodex and node y which length are less then 6. Put all the
nodes in the paths into the setxy.path_nodes. Record the length of each path.
(2) Extract the sub-graph which contains the tested node pair and all the nodes in their paths.
(3) for (from the first path to the last path){
(4)   while (the nodes set of the path is not null){
(5) Calculate the degree of node v, and get v.degree. Calculate the degree of node v
in the extracted sub-graph in the Step 2, get v.path_degree.
Calculate the guidance capability of this node
Guidance-capability.v=v.path_degree/log(v.degree).
(6) Calculate the weight of this path Guidance_capability.path+ = Guidance_capability.v}.
(7) Calculate the similarity of nodex and node y Similarity.xy+ = βl Guidance_capability.path}The computational complexity of KatzGF algorithm isO(Kn); K is the number of nodes in social network. It can be seen that when the network size is large, the time complexity degree of the KatzGF algorithm is very high. And KatzGF algorithm needs to know the global information of social networks. This is also difficult to achieve in real life, so KatzGF algorithm is not suitable for large-scale network.


## 4.1. CNGF Algorithm

By introducing the definition of node guidance capability, we know that the guidance capabilities of the different nodes are different. The similarity between the two nodes can be represented by the sum of each node’s guidance capability. The guidance capability of the common neighbors is greater and the likelihood of the new link between the two nodes is greater. On this basis, we define the formula of the similarity degree of two nodes:(8)SimilarityCNGF(u,v)=∑z∈Γ(u)∩Γ(v)|ϕ(z)|logdz,
where |ϕ(z)| is the number of links that the node connected with the common neighbors.With the previous formula, we can give the pseudocode of CNGF algorithm based on node guidance capability (see Algorithm1).Algorithm 1:CNGF algorithm.
Input: social network graphG=〈V,E〉, node x, node y
Output: the similarity of nodex and node y
The description of the algorithm:
(1) Find the common neighbor setxy.common_neighbor of the node pair.
(2) Extract the sub-graph which contains the tested node pair and their common neighbors.
(3) While (the common neighbor ser is not null){
(4)Calculate the degree of node v, and get v.degree. Node v is one node of the
common neighbor set.
(5)Calculate the degree of node v in the sub-graph extracted in the Step 2, get
v.common_degree.
(6)Calculate the guidance capability of node v, Guidance (v)=v.common_degree/log(v.degree)
(7)The similarity of node x and node y is Similarity.xy+ = Guidance (v)}The computational complexity of CNGF algorithm isO(N2); N is the maximum of all the nodes’ degree. This computational complexity is also acceptable in large-scale network.


## 4.2. KatzGF Algorithm

The idea of Katz algorithm is that if there are more paths between two nodes, the possibility of a new link existing in the two nodes is greater. Katz algorithm did not distinguish the contribution of the paths with the same path length. The node guidance capability proposed in this paper can distinguish the contribution of different nodes effectively. We can make use of the node guidance capability in Katz algorithm. Because of different nodes, the contribution of the paths with the same path length is different. Based on the previous ideas, we designed the KatzGF algorithm. The KatzGF algorithms integrated the local node information and the global social network information reasonably.The most important part of the KatzGF algorithm is how to design the formula for the degree of similarity between two nodes. Taking into account the contribution of the different nodes on the same path length is different, we can design the similarity formula of KatzGF:(9)SimilarityKatzGF(u,v)=∑l=1l=∞βl(∑z∈Pathuvl|ϕ(z)|logdz),whereβ is a parameter between 0 and 1. This parameter is used to control the contribution of path to the similarity; the longer the path is, the less contribution the path made to the similarity. |ϕ(z)| is the degree of node z in the subgraph containing the test nodes and all the path nodes between the test nodes. dz is the degree of node z. The formula first calculated the guidance capability of each node on the path between node pairs and then put the sum of all path nodes’ guidance capability as the contribution of the path to link prediction.With the previous formula, we can give the pseudocode of KatzGF algorithm (see Algorithm2).Algorithm 2:KatzGF algorithm.
Input: social network graphG=〈V,E〉, node x, node y
Output: the similarity of nodex and node y
The description of the algorithm:
(1) Find all paths between nodex and node y which length are less then 6. Put all the
nodes in the paths into the setxy.path_nodes. Record the length of each path.
(2) Extract the sub-graph which contains the tested node pair and all the nodes in their paths.
(3) for (from the first path to the last path){
(4)   while (the nodes set of the path is not null){
(5) Calculate the degree of node v, and get v.degree. Calculate the degree of node v
in the extracted sub-graph in the Step 2, get v.path_degree.
Calculate the guidance capability of this node
Guidance-capability.v=v.path_degree/log(v.degree).
(6) Calculate the weight of this path Guidance_capability.path+ = Guidance_capability.v}.
(7) Calculate the similarity of nodex and node y Similarity.xy+ = βl Guidance_capability.path}The computational complexity of KatzGF algorithm isO(Kn); K is the number of nodes in social network. It can be seen that when the network size is large, the time complexity degree of the KatzGF algorithm is very high. And KatzGF algorithm needs to know the global information of social networks. This is also difficult to achieve in real life, so KatzGF algorithm is not suitable for large-scale network.


## 5. Link Prediction Algorithms Based on Node Multiple Attributes

Traditional link prediction algorithm only intercepts a time snapshot of the social network, ignoring the time characteristics of the network. In fact, social network changes constantly over time; it is not static.Considering the time characteristics of the network, social network graph can be divided into different graph sequences in accordance with a certain time stepG=〈GΔt1,GΔt2,…,GΔtn〉. These snapshots graphs are disjoint. And {Δt1,Δt2,…,Δtn} is a set of disjoint time. For all i, j, 1≤i≤j≤n, Δti is earlier than Δtj. The selection of time step depends on the application. The time step can be set to a month or a year.In order to illustrate the role of the node time statistics on link prediction better, we can make an analogy of the moving average line of finance. We use the moving average line (moving averages) to extract long-term development trends from the short-term noise data in finance. The moving average is the average of an index value in a certain period time. For example, we consider the average degree value of nodevi within 50 time steps; the average node degree is ∑t=1t=50degreet(vi)/50. In social networks, we can remove some noise data using the node attribute average value and get a stable long-term trend.Combining the node guidance capability and the average of node’s degree, we propose a link prediction based on node topology attributes and network time attributes. In this section, we make some modifications of the node guidance capability’s definition and add the time attributes into the definition of node guidance capability. We get a graph sequencesG=〈GΔt1,GΔt2,…,GΔtn〉 from the social network graph G=(V,E), where each snapshot graph is an undirected graph. In each snapshot graph, we calculate |ϕ(z)Δtn| and dz-Δtn, respectively. Then use the idea of nodes moving average and compute the average degree of node in the entire network and the extracted subgraph. The node’s average degree in the extracted subgraph is |ϕ(z)|avg=∑i=1i=n|ϕ(z)Δti|/n. The node’s average degree in the entire graph is dz-avg=∑i=1i=n|dz-Δti|/n. Finally, putting |ϕ(z)avg| and dz-avg into the definition formula of node guidance capability, we can get a new formula that combines the time attributes:
(10)Guidance-force(z)time=|ϕ(z)|avglog(dz-avg).With the previous new definition, we can modify the CNGF algorithm and KatzGF algorithm. We combine CNGF algorithm with social network topology attributes and time attributes and then get CNGF_T algorithm. The new similarity formula is(11)SimilarityCNGF_T(u,v)=∑z∈Γ(u)∩Γ(v)|ϕ(z)|avglog(dz-avg).We also can get the new similarity formula in KatzGF_T:(12)SimilarityKatzGF_T(u,v)=∑l=1l=∞βl(∑z∈Pathuvl|ϕ(z)|avglog(dz-avg)).


## 6. The Algorithm Implementation and Verification

In this experiment, we used DBLP (Digital Bibliography and Library Project) experimental data sets to verify the performance of the link prediction algorithm. This data set is real. It covers 28 international conferences records related to data mining, machine learning, and so on.We use AUC indicators to evaluate the experimental results. The AUC index refers to the area under ROC curve. ROC curve puts false positive rate asx-axis and puts true positive rate as cases y-axis. The point in the curve corresponds to the performance of the algorithm under each threshold. The greater the AUC value is the better performance the predictors have.


### 6.1. Data Preprocessing

The real conetwork is particularly sparse. In order to achieve the best performance of the algorithm, we need to preprocess the data set. The preprocessing of the data set can be divided into the following steps to complete.Step 1.
Intercept the data from 2000 to 2006.Step 2.
Delete the independent writings node.Step 3.
Remove the high degree of complete graphs.Step 4.
Construct the known network. Using the data from 2000 to 2004, we can construct the known conetwork. Put the topology structure attributes and the time attributes as the training set. And put the data from 2005 to 2006 as the unknown network.Step 5.
Screen less the known network. We did not select all the nodes of the data, so we should screen less the appropriate link. If a node is deleted, then all the links on the node should be removed.


### 6.2. The Experimental Results

By setting different thresholds, we calculate the true positive rate and the false positive rate, respectively. Then we draw the corresponding ROC curve. Firstly, we give the ROC curve of the local algorithm common neighbor and the ROC curve of the improved algorithms CNGF and CNGF_T, as shown in Figure3. The ROC curve shows the overall impact of different thresholds for link prediction. It can be seen from the figure that the performance of three algorithms is very similar in the beginning; however, with the increase of false positive rate, the true positive rate of CNGF_T is larger than CNGF algorithm and common neighbor algorithm. This shows that the prediction performance of the CNGF_T algorithm is the best of the three algorithms.Figure 3
The ROC curves of common neighbor algorithm, CNGF algorithm, and CNGF_T algorithm.The ROC curves of Katz algorithm, KatzGF, and KatzGF_T are shown in Figure4. From the figure, we can see that KatzGF algorithm is better than Katz algorithm, but it is not very obvious in the overall performance. But the ROC curve of KatzGF_T algorithm is significantly closer to the upper left corner than those of the first two algorithms. KatzGF_T algorithm takes into account the time attribute information and the global topology information of social network, so it has the best prediction performance.Figure 4
The ROC curves of Katz algorithm, KatzGF algorithm, and KatzGF_T algorithm.


## 6.1. Data Preprocessing

The real conetwork is particularly sparse. In order to achieve the best performance of the algorithm, we need to preprocess the data set. The preprocessing of the data set can be divided into the following steps to complete.Step 1.
Intercept the data from 2000 to 2006.Step 2.
Delete the independent writings node.Step 3.
Remove the high degree of complete graphs.Step 4.
Construct the known network. Using the data from 2000 to 2004, we can construct the known conetwork. Put the topology structure attributes and the time attributes as the training set. And put the data from 2005 to 2006 as the unknown network.Step 5.
Screen less the known network. We did not select all the nodes of the data, so we should screen less the appropriate link. If a node is deleted, then all the links on the node should be removed.


## 6.2. The Experimental Results

By setting different thresholds, we calculate the true positive rate and the false positive rate, respectively. Then we draw the corresponding ROC curve. Firstly, we give the ROC curve of the local algorithm common neighbor and the ROC curve of the improved algorithms CNGF and CNGF_T, as shown in Figure3. The ROC curve shows the overall impact of different thresholds for link prediction. It can be seen from the figure that the performance of three algorithms is very similar in the beginning; however, with the increase of false positive rate, the true positive rate of CNGF_T is larger than CNGF algorithm and common neighbor algorithm. This shows that the prediction performance of the CNGF_T algorithm is the best of the three algorithms.Figure 3
The ROC curves of common neighbor algorithm, CNGF algorithm, and CNGF_T algorithm.The ROC curves of Katz algorithm, KatzGF, and KatzGF_T are shown in Figure4. From the figure, we can see that KatzGF algorithm is better than Katz algorithm, but it is not very obvious in the overall performance. But the ROC curve of KatzGF_T algorithm is significantly closer to the upper left corner than those of the first two algorithms. KatzGF_T algorithm takes into account the time attribute information and the global topology information of social network, so it has the best prediction performance.Figure 4
The ROC curves of Katz algorithm, KatzGF algorithm, and KatzGF_T algorithm.


## 7. Conclusion

Firstly, we introduce the concept of social networks and describe the basic nature of social networks: small world, scaling, and clustering features. Then we introduce the link prediction definition and link prediction algorithms. Comparing these link prediction algorithms, we analyse the existing problems of the traditional link prediction. For the problems in traditional link prediction on social networks, we proposed the improved CNGF algorithm KatzGF algorithm. And for the lack of static social network, we gave the link prediction algorithm based on multiple attributes. The experimental results show that the prediction performance of the improved algorithm is superior to that of the traditional link prediction algorithm.



---

*Source: 125123-2013-09-17.xml*