# SignRank: A Novel Random Walking Based Ranking Algorithm in Signed Networks

Authors: Cong Wan; Yanhui Fang; Cong Wang; Yanxia Lv; Zejie Tian; Yun Wang
Journal: Wireless Communications and Mobile Computing
 (2019)

---

## Abstract

Social networks have become an indispensable part of modern life. Signed networks, a class of social network with positive and negative edges, are becoming increasingly important. Many social networks have adopted the use of signed networks to model like (trust) or dislike (distrust) relationships. Consequently, how to rank nodes from positive and negative views has become an open issue of social network data mining. Traditional ranking algorithms usually separate the signed network into positive and negative graphs so as to rank positive and negative scores separately. However, much global information of signed network gets lost during the use of such methods, e.g., the influence of a friend’s enemy. In this paper, we propose a novel ranking algorithm that computes a positive score and a negative score for each node in a signed network. We introduce a random walking model for signed network which considers the walker has a negative or positive emotion. The steady state probability of the walker visiting a node with negative or positive emotion represents the positive score or negative score. In order to evaluate our algorithm, we use it to solve sign prediction problem, and the result shows that our algorithm has a higher prediction accuracy compared with some well-known ranking algorithms.


---

## Body

## 1. Introduction

Signed network [1] is a kind of social network that consists of edges with positive and negative signs. Positive edges denote friendship, trust, or agreement, while negative edges can be enmity, distrust, or disagreement. Online social network websites have become a favorite place for many people to share their opinions. Signed networks are very useful to understand the relationships between online social network users.How to measure the importance of nodes in a social network has always been an important issue in many data mining fields such as collaborative filtering [2], community detection [3], and link prediction [4]. Signed networks make the node ranking problem more complex because signs associated with edges suggest further information of nodes, but this is significant in many scenarios. For example, internet celebrities (famous in the network) of online social network can gain a lot from word-of-mouth marketing. However, a person can become famous either because many people like him or because a lot of people dislike him. An unwelcome celebrity will make the marketing fail. Therefore, it is crucial to recognize the difference between positive influence and negative influence. Furthermore, it is hard to say if the different influences might cancel each other out. For example, people with a lot of supporters and the same number of opponents will be more influential than ordinary people. So, it is attractive to rank nodes from both positive and negative views.A classical node ranking method is known as PageRank [5], which measures a node from a global view. If there is a path from node A to node B, it can be viewed as A supporting B. Hits [6] is another classical ranking algorithm, which measures the authority of websites by external links. These methods assume the network only contains positive edges. It means a node that has many friends is not different from a node that has many enemies because the signs on the edges are not considered. In the wake of the development of signed networks, a growing interest goes to the trustability of a person by computing ranking nodes based on a criterion evaluating the trust worthiness. Some modified ranking algorithms [7, 8] separate signed network into positive subgraph and negative subgraph and then compute the corresponding ranks using PageRank or Hits. Some important global information may be lost in those modified methods. For example, node A has a friend B, and B has an enemy C. Methods [7] and [8] ignore the relationship between A and C. SRWR [9] could compute positive and negative scores of nodes in signed network, but these scores are from a personal view.In this paper, we propose a novel ranking method for signed network. Our contributions are as follows:(
1
) A novel random walking model for signed network: this model can simulate human activity of visiting an online social network website. A walker visits nodes with positive or negative emotion which denotes the walker likes (trust) or dislikes (distrust) this node. When the walker visits a node and turns to negative, he leaves with probability just like you will close an unpleasant website. The steady state probabilities of the walker visiting a node with negative or positive emotion represent the positive score or negative score.(
2
) A ranking algorithm referred as SignRank: we propose an iterative algorithm to rank the nodes and prove our algorithm converges.(
3
) Experiment: we compare our method with some well-known classical algorithms. It is difficult to show whether our method is better directly, so we apply these methods to a classic problem, i.e., sign prediction problem in signed network. The experiment shows our method has a higher accuracy than other methods.This paper is organized as follows. Section2 is about the related works. Section 3 discusses methods for the SignRank in signed networks. Section 4 presents the experiments and Section 5 gives conclusions.


## 2. Related Works

In recent years, signed networks have attracted more and more attention for its ability to specify trust or distrust relationships between nodes. Network modeling and network topology analysis are important foundations for the study of signed networks. BSCL [10] is a signed network generative model which could learn parameters automatically and generate signed networks from a given real network. The generated network keeps some key properties unchanged, especially balance/unbalanced triangle distribution. M. Ludwig et al. [11] proposed a balance theory [12, 13] based evolutionary model, which adds or removes edges to a social network until it reaches a steady state. IB [14] is inspired by balance theory and ant behavior, which considers interactions between individuals could cause edges to be changed. Measuring node relevance on signed networks is becoming an important and attractive issue. Tyler Derr et al. [15] have proposed a series of methods from both local and global perspectives such as signed common neighbors (SCN) and Signed Jaccard Index (SJI).PageRank [5] and HITS [6] are the most popular ranking algorithms for unsigned network (positive edges only). They focus is on the global topology of social network. Personalized ranking is another kind of ranking research area, which ranks nodes from a specified node’s view, such as Personalized PageRank [16] and Bayesian Personalized Ranking [17].In order to make traditional methods applicable to negative edges, researchers have proposed some new methods. Modified PageRank [7] separates signed network into positive and negative subgraphs and then computes PageRank score separately. This method ignores much information of global topology. PageTrust [18] is also extended from PageRank. It uses random walk model and considers the walker choose negative edge with a lower probability, so it could rank how trustable nodes are. Another trustable ranking algorithm is TrollTrust [19] which scores the nodes with probability of trustworthiness. Prestige [20] subtracts the number of positive edges by the number of negative edges and normalizes the result. According to these methods, positive or trust score can be counteracted by negative or distrust score. However, positive and negative scores cannot cancel each other out in some case. For example, a famous rock star has a lot of supporters and the same number opponents, but we do not think he has the same influence as an ordinary person. SRWR [9] is a random walk with restart model based ranking method, which could rank nodes from a personal view in the signed network, but it cannot be applied to large-scale networks. SWR [21] is another good random walk based method, which considers the walker will choose negative edge with smaller probability than positive edge.


## 3. Ranking Method

### 3.1. Random Walking Model for Signed Network

At first, a signed network is denoted by a weighted graphG
=
(
V
,
A
+
,
A
-
). A
i
j
+ and A
i
j
- are defined as follows:(1)
A
i
j
+
=
1
,
i
f
t
h
e
r
e
i
s
a
p
o
s
i
t
i
v
e
l
i
n
k
f
r
o
m
i
t
o
j
0
,
i
f
t
h
e
r
e
i
s
n
o
a
p
o
s
i
t
i
v
e
l
i
n
k
f
r
o
m
i
t
o
j
(2)
A
i
j
-
=
1
,
i
f
t
h
e
r
e
i
s
a
n
e
g
a
t
i
v
e
l
i
n
k
f
r
o
m
i
t
o
j
0
,
i
f
t
h
e
r
e
i
s
n
o
a
n
e
g
a
t
i
v
e
l
i
n
k
f
r
o
m
i
t
o
jWe will introduce a novel random walk model for signed network (RWSN for short) and simulate the behavior of users accessing online social network sites. RWSN supposes a walker randomly visits a user’s home page. After that, the walker will visit one of the neighbors of this page.The walker could have a positive or negative emotion when accessing social networks, and the edges of social networks have positive or negative signs. The reasons why the walker has positive emotion may be the following ones:(
1
) The walker trusts the visited node.(
2
) The walker agrees with the visited node’s political views.(
3
) Some external factors are the reason.In contrast, the walker gets into negative emotion because of the following:(
1
) The walker distrusts the visited node.(
2
) The walker disagrees with the visited node’s political views.(
3
) Some external factors are the reason.In our model, if a walker travels through a negative link, he/she will flip his/her sign, whereas the walker will keep the sign unchanged if he/she travels through a positive link. We define such rules according to structure balance theory of sign network [13].For example, Figure1 shows a walker named Alice visits an online social network with emotion. At first Alice visits node A with positive emotion; then she has two choices denoted by actions 1 and 2. In the case of action 1, she visits A’s friend B through a positive edge and keeps positive emotion. In action 2, she visits A’s enemy C through a negative edge and turns to negative emotion.Figure 1
An example of RWSN. Alice starts walking with positive emotion.Figure2 shows another example, in which Alice starts walking with negative emotion, and she has three choices. In action 1, she visits A’s friend B and remains unhappy. In action 2, she visits A’s enemy C and becomes happy. In action 3, Alice is tired of them and leaves; then she will visit a node in the network randomly with random emotion.Figure 2
An example of RWSN. Alice starts walking with negative emotion.We say thatπ
i
+
(
t
) is the probability of Alice visiting node i with positive emotion at time t. In contrast, we use π
i
-
(
t
) to represent the probability of Alice visiting this node with negative emotion. Therefore, the probability of Alice visiting the nodei with positive emotion at time (
t
+
1
) can be calculated as(3)
π
i
+
t
+
1
=
∑
j
ϵ
I
N
i
+
π
j
+
t
p
j
i
+
1
-
λ
∑
j
ϵ
I
N
i
-
π
j
-
t
p
j
i
+
λ
2
N
∑
j
=
1
N
π
j
-
tWe say that the subscriptsi and j denote the nodes in the signed network. j belongs to the set I
N
(
i
)
+ under the condition that there is a positive link going from j to i. Similarly, j belongs to I
N
(
i
)
- under the condition that there is a negative link going from j to i. Here p
i
j is the probability of Alice accessing the node i after accessing the node j without taking Alice’s emotion into account, and N is the number of the nodes, and λ is the probability of random jump due to a bad mood of Alice. We name λ as tiredness probability. p
i
j is computed as(4)
p
i
j
=
0
,
i
f
t
h
e
r
e
i
s
n
o
l
i
n
k
f
r
o
m
j
t
o
i
1
O
U
T
j
,
i
f
t
h
e
r
e
i
s
a
l
i
n
k
f
r
o
m
j
t
o
iwhere O
U
T
(
j
) is the number of out-degree of node j. The probability of Alice visiting the node i with negative emotion at time (
t
+
1
) is as follows:(5)
π
i
-
t
+
1
=
∑
j
ϵ
I
N
i
-
π
j
+
t
p
j
i
+
1
-
λ
∑
j
ϵ
I
N
i
+
π
j
-
t
p
j
i
+
λ
2
N
∑
j
=
1
N
π
j
-
tFigure3 is an example of trap. It shows that B only treats C as a friend, and vice versa. If Alice visits B with a positive emotion, she will only circulate between B and C forever. So we must solve such trap problem.Figure 3
An example of trap.We use hopping probabilityα to solve the trap problem. After visiting a node, Alice will jump to a random node with probability α no matter what emotion she has. The correction equations for updating π
+ and π
- are as follows:(6)
π
i
+
t
+
1
=
α
∑
j
ϵ
I
N
i
+
π
j
+
t
p
j
i
+
1
-
λ
∑
j
ϵ
I
N
i
-
π
j
-
t
p
j
i
+
λ
2
N
∑
j
=
1
N
π
j
-
t
+
1
-
α
2
N
(7)
π
i
-
t
+
1
=
α
∑
j
ϵ
I
N
i
-
π
j
+
t
p
j
i
+
1
-
λ
∑
j
ϵ
I
N
i
+
π
j
-
t
p
j
i
+
λ
2
N
∑
j
=
1
N
π
j
-
t
+
1
-
α
2
NThen we can use an iterative approach to updateπ
+ and π
- until they converge.


### 3.2. Convergence Proof

In this section, we will prove the convergence of (6) and (7). They can be rewritten as follows:(8)
π
t
+
1
=
π
t
Pwhereπ
t is a vector expressed as π
t
=
〈
π
1
+
(
t
)
,
π
2
+
(
t
)
·
·
·
π
N
+
(
t
)
,
π
1
-
(
t
)
,
π
2
-
(
t
)
·
·
·
π
N
-
(
t
)
〉. In the above equation,P is a probability matrix, and the calculation method ofP is provided as follows:(9)
P
=
α
P
0
+
1
-
α
2
N
(10)
P
0
=
P
1
P
2
P
3
P
4
(11)
P
1
=
A
i
j
+
A
i
+
+
A
i
-
(12)
P
2
=
1
-
λ
A
i
j
-
A
i
+
+
A
i
-
+
λ
2
N
(13)
P
3
=
A
i
j
-
A
i
+
+
A
i
-
(14)
P
4
=
1
-
λ
A
i
j
+
A
i
+
+
A
i
-
+
λ
2
NwhereA
i
+ represents the sum of row i in A
+ and A
i
- represents the sum of row i in A
-. We can figure out that the sum of each row in P is 1.According to Markoff’s convergence theorem [22], π is convergent.


### 3.3. SignRank Algorithm

We can calculateπ by adjacency matrix operation according to previous equations. But it will cost a lot of time and memory to process the sparse matrices. So we will introduce a fast ranking algorithm referred to as SignRank. The input of SignRank includes the following: the positive edges set E
+, the negative edges set E
-, tiredness probability λ, the hopping probability α, the max iteration time I
t
a
M
a
x, and the stop threshold t
o
l.First, we initializeπ
+
(
0
) and π
-
(
0
) with equal value (line 1-3). Then, during each iteration, we do the following operations.(
1
) Each positive edge is accessed, and scores of source node are added to destination node (lines 5-8).(
2
) Each negative edge is accessed, and scores of source node are added to destination node. It is worth noting that the positive score of source node is added to the negative score of destination node or vice versa (lines 9-12).(
3
)
π
+
(
t
+
1
) and π
-
(
t
+
1
) are updated according to (6) and (7) (lines 13-19).(
4
) Finally, we calculate the error tolerance e
r
r. If e
r
r is less than t
o
l, the algorithm is finished.


## 3.1. Random Walking Model for Signed Network

At first, a signed network is denoted by a weighted graphG
=
(
V
,
A
+
,
A
-
). A
i
j
+ and A
i
j
- are defined as follows:(1)
A
i
j
+
=
1
,
i
f
t
h
e
r
e
i
s
a
p
o
s
i
t
i
v
e
l
i
n
k
f
r
o
m
i
t
o
j
0
,
i
f
t
h
e
r
e
i
s
n
o
a
p
o
s
i
t
i
v
e
l
i
n
k
f
r
o
m
i
t
o
j
(2)
A
i
j
-
=
1
,
i
f
t
h
e
r
e
i
s
a
n
e
g
a
t
i
v
e
l
i
n
k
f
r
o
m
i
t
o
j
0
,
i
f
t
h
e
r
e
i
s
n
o
a
n
e
g
a
t
i
v
e
l
i
n
k
f
r
o
m
i
t
o
jWe will introduce a novel random walk model for signed network (RWSN for short) and simulate the behavior of users accessing online social network sites. RWSN supposes a walker randomly visits a user’s home page. After that, the walker will visit one of the neighbors of this page.The walker could have a positive or negative emotion when accessing social networks, and the edges of social networks have positive or negative signs. The reasons why the walker has positive emotion may be the following ones:(
1
) The walker trusts the visited node.(
2
) The walker agrees with the visited node’s political views.(
3
) Some external factors are the reason.In contrast, the walker gets into negative emotion because of the following:(
1
) The walker distrusts the visited node.(
2
) The walker disagrees with the visited node’s political views.(
3
) Some external factors are the reason.In our model, if a walker travels through a negative link, he/she will flip his/her sign, whereas the walker will keep the sign unchanged if he/she travels through a positive link. We define such rules according to structure balance theory of sign network [13].For example, Figure1 shows a walker named Alice visits an online social network with emotion. At first Alice visits node A with positive emotion; then she has two choices denoted by actions 1 and 2. In the case of action 1, she visits A’s friend B through a positive edge and keeps positive emotion. In action 2, she visits A’s enemy C through a negative edge and turns to negative emotion.Figure 1
An example of RWSN. Alice starts walking with positive emotion.Figure2 shows another example, in which Alice starts walking with negative emotion, and she has three choices. In action 1, she visits A’s friend B and remains unhappy. In action 2, she visits A’s enemy C and becomes happy. In action 3, Alice is tired of them and leaves; then she will visit a node in the network randomly with random emotion.Figure 2
An example of RWSN. Alice starts walking with negative emotion.We say thatπ
i
+
(
t
) is the probability of Alice visiting node i with positive emotion at time t. In contrast, we use π
i
-
(
t
) to represent the probability of Alice visiting this node with negative emotion. Therefore, the probability of Alice visiting the nodei with positive emotion at time (
t
+
1
) can be calculated as(3)
π
i
+
t
+
1
=
∑
j
ϵ
I
N
i
+
π
j
+
t
p
j
i
+
1
-
λ
∑
j
ϵ
I
N
i
-
π
j
-
t
p
j
i
+
λ
2
N
∑
j
=
1
N
π
j
-
tWe say that the subscriptsi and j denote the nodes in the signed network. j belongs to the set I
N
(
i
)
+ under the condition that there is a positive link going from j to i. Similarly, j belongs to I
N
(
i
)
- under the condition that there is a negative link going from j to i. Here p
i
j is the probability of Alice accessing the node i after accessing the node j without taking Alice’s emotion into account, and N is the number of the nodes, and λ is the probability of random jump due to a bad mood of Alice. We name λ as tiredness probability. p
i
j is computed as(4)
p
i
j
=
0
,
i
f
t
h
e
r
e
i
s
n
o
l
i
n
k
f
r
o
m
j
t
o
i
1
O
U
T
j
,
i
f
t
h
e
r
e
i
s
a
l
i
n
k
f
r
o
m
j
t
o
iwhere O
U
T
(
j
) is the number of out-degree of node j. The probability of Alice visiting the node i with negative emotion at time (
t
+
1
) is as follows:(5)
π
i
-
t
+
1
=
∑
j
ϵ
I
N
i
-
π
j
+
t
p
j
i
+
1
-
λ
∑
j
ϵ
I
N
i
+
π
j
-
t
p
j
i
+
λ
2
N
∑
j
=
1
N
π
j
-
tFigure3 is an example of trap. It shows that B only treats C as a friend, and vice versa. If Alice visits B with a positive emotion, she will only circulate between B and C forever. So we must solve such trap problem.Figure 3
An example of trap.We use hopping probabilityα to solve the trap problem. After visiting a node, Alice will jump to a random node with probability α no matter what emotion she has. The correction equations for updating π
+ and π
- are as follows:(6)
π
i
+
t
+
1
=
α
∑
j
ϵ
I
N
i
+
π
j
+
t
p
j
i
+
1
-
λ
∑
j
ϵ
I
N
i
-
π
j
-
t
p
j
i
+
λ
2
N
∑
j
=
1
N
π
j
-
t
+
1
-
α
2
N
(7)
π
i
-
t
+
1
=
α
∑
j
ϵ
I
N
i
-
π
j
+
t
p
j
i
+
1
-
λ
∑
j
ϵ
I
N
i
+
π
j
-
t
p
j
i
+
λ
2
N
∑
j
=
1
N
π
j
-
t
+
1
-
α
2
NThen we can use an iterative approach to updateπ
+ and π
- until they converge.


## 3.2. Convergence Proof

In this section, we will prove the convergence of (6) and (7). They can be rewritten as follows:(8)
π
t
+
1
=
π
t
Pwhereπ
t is a vector expressed as π
t
=
〈
π
1
+
(
t
)
,
π
2
+
(
t
)
·
·
·
π
N
+
(
t
)
,
π
1
-
(
t
)
,
π
2
-
(
t
)
·
·
·
π
N
-
(
t
)
〉. In the above equation,P is a probability matrix, and the calculation method ofP is provided as follows:(9)
P
=
α
P
0
+
1
-
α
2
N
(10)
P
0
=
P
1
P
2
P
3
P
4
(11)
P
1
=
A
i
j
+
A
i
+
+
A
i
-
(12)
P
2
=
1
-
λ
A
i
j
-
A
i
+
+
A
i
-
+
λ
2
N
(13)
P
3
=
A
i
j
-
A
i
+
+
A
i
-
(14)
P
4
=
1
-
λ
A
i
j
+
A
i
+
+
A
i
-
+
λ
2
NwhereA
i
+ represents the sum of row i in A
+ and A
i
- represents the sum of row i in A
-. We can figure out that the sum of each row in P is 1.According to Markoff’s convergence theorem [22], π is convergent.


## 3.3. SignRank Algorithm

We can calculateπ by adjacency matrix operation according to previous equations. But it will cost a lot of time and memory to process the sparse matrices. So we will introduce a fast ranking algorithm referred to as SignRank. The input of SignRank includes the following: the positive edges set E
+, the negative edges set E
-, tiredness probability λ, the hopping probability α, the max iteration time I
t
a
M
a
x, and the stop threshold t
o
l.First, we initializeπ
+
(
0
) and π
-
(
0
) with equal value (line 1-3). Then, during each iteration, we do the following operations.(
1
) Each positive edge is accessed, and scores of source node are added to destination node (lines 5-8).(
2
) Each negative edge is accessed, and scores of source node are added to destination node. It is worth noting that the positive score of source node is added to the negative score of destination node or vice versa (lines 9-12).(
3
)
π
+
(
t
+
1
) and π
-
(
t
+
1
) are updated according to (6) and (7) (lines 13-19).(
4
) Finally, we calculate the error tolerance e
r
r. If e
r
r is less than t
o
l, the algorithm is finished.


## 4. Experimental Results

### 4.1. Verifying

In the experiment, first we use a simple example to verify the effectiveness of the algorithm; then we compare our algorithm with some other ranking algorithms to prove that SignRank is better.An example of signed network is shown in Figure4. There are four nodes in the network, with node A being hostile to nodes B and C, which are also hostile to A. On the other hand, node D is friendly with B and C. Obviously, in the PageRank’s view, the four nodes are the same. The result of SignRank is shown in Figures 5, 6, and 7. In these three figures, the values of tiredness probability λ are 0.9, 0.5, and 0, respectively. Figures 5 and 6 reveal that the negative rank of node A is significantly higher than its positive rank. It should be noted that node A does not have any positive edge, but its positive rank is not 0, because people who hate B and C may bring a positive rank to A.Figure 4
An illustration of signed network. The positive relationships are marked with red plus, and negative relationships are marked with green minus sign.Figure 5
The positive and negative scores of four nodes according to SignRank. The tired probabilityλ is set to 0.9, which means the walker is very likely to leave the node when he is in negative emotion.Figure 6
The positive and negative scores of four nodes according to SignRank. The tired probabilityλ is set to 0.5.Figure 7
The positive and negative scores of four nodes according to SignRank. The tired probabilityλ is set to 0, which means the negative emotion will not affect the walker.In Figure7 we set λ
=
0, which means that the walker will never be tired and run away. In this case, our SignRank degenerates into a PageRank algorithm. Positive and negative signs will no longer have any influence on the ranking algorithm. As a result, positive scores and negative scores of all the nodes are equal.


### 4.2. Evaluation Method

It is very difficult to give a direct proof that our ranking algorithm is better than other algorithms, so we adopted an indirect method that has been used by many researchers to prove the superiority of their algorithm [7, 9, 19]. This method is to use the result of ranking algorithm for sign prediction, and the quality of which can be used to evaluate the ranking algorithm. Sign prediction is an important field of the research on signed networks. When there is an edge e
i
j with an unknown sign in a signed network, we predict the sign through the features of the edge. In order to implement sign prediction, we use ranking score to generate some features 〈
R
e
p
i
,
R
e
p
j
,
O
p
t
i
,
O
p
t
j
〉 [7] for edge e
i
j. R
e
p is the abbreviation of reputation, which represents the popularity of nodes in the network. R
e
p
i and R
e
p
j, respectively, denote the reputation of the two endpoints of edge e
i
j. O
p
t is the abbreviation of optimism, which quantifies the pattern of voting a node in the network. O
p
t
i and O
p
t
j, respectively, represent the optimism of nodes i and j. After extracting features for each edge, a classification model can be used for sign prediction.Reputation and optimism can be calculated through the ranking scoreπ
i of nodes.(15)
R
e
p
i
=
∑
j
ϵ
I
N
i
+
π
j
-
∑
j
ϵ
I
N
i
-
π
j
∑
j
ϵ
I
N
i
+
π
j
+
∑
j
ϵ
I
N
i
-
π
jI
N
(
i
)
+ represents a set of nodes that have a positive edge pointing to i, and I
N
(
i
)
- represents a set of nodes that have a negative edge to i.(16)
O
p
t
i
=
∑
j
ϵ
O
U
T
i
+
π
j
-
∑
j
ϵ
O
U
T
i
-
π
j
∑
j
ϵ
O
U
T
i
+
π
j
+
∑
j
ϵ
O
U
T
i
-
π
jO
U
T
(
i
)
+ represents a set of nodes pointed fromi through positive edges.In this paper, we can measure a node with its positive and negative scores, so we can extendrep to R
e
p
+ and R
e
p
-. They can show popularity and unpopularity of the node. Their calculating methods are as follows:(17)
R
e
p
i
+
=
∑
j
ϵ
I
N
i
+
π
j
+
-
∑
j
ϵ
I
N
i
-
π
j
+
∑
j
ϵ
I
N
i
+
π
j
+
+
∑
j
ϵ
I
N
i
-
π
j
+
(18)
R
e
p
i
-
=
∑
j
ϵ
I
N
i
+
π
j
-
-
∑
j
ϵ
I
N
i
-
π
j
-
∑
j
ϵ
I
N
i
+
π
j
-
+
∑
j
ϵ
I
N
i
-
π
j
-Correspondingly,opt is extended to O
p
t
+ and O
p
t
-.(19)
O
p
t
i
+
=
∑
j
ϵ
O
U
T
i
+
π
j
+
-
∑
j
ϵ
O
U
T
i
-
π
j
+
∑
j
ϵ
O
U
T
i
+
π
j
+
+
∑
j
ϵ
O
U
T
i
-
π
j
+
(20)
O
p
t
i
-
=
∑
j
ϵ
O
U
T
i
+
π
j
-
-
∑
j
ϵ
O
U
T
i
-
π
j
-
∑
j
ϵ
O
U
T
i
+
π
j
-
+
∑
j
ϵ
O
U
T
i
-
π
j
-Therefore, in this paper, we generate eight features denoted by vector v for each edge and then use logistic regression for sign prediction.


### 4.3. Evaluation Metrics

We choose accuracy, recall, precision, and F1 to evaluate the quality of our method and comparative methods. And their definitions are as follows:(i)
Accuracy is the proportion of correctly predicted edges.
(ii)
Recall is the proportion of correctly predicted edges in actually positive edges.
(iii)
Precision is the proportion of correctly predicted edges in predicted positive edges.
(iv)
F1 is the harmonic mean of precision and recall.


### 4.4. Comparative Methods

To study the performance of our algorithm, we apply it in sign prediction and compare it with ranking algorithms as follows.(i)
PageRank [5] is a page scoring algorithm proposed by Google Larry Page. We calculate the PageRank value for each node and consider that π
i
+
=
π
i
-.
(ii)
Hits [6] is an algorithm for analyzing the link topology of a web page. We use the authority value as the score of a node and consider that π
i
+
=
π
i
-.
(iii)
Modified PageRank [7] divides the signed network into two subgraphs, G
+ and G
-. There are only positive edges in G
+ and only negative edges in G
-. It uses the PageRank algorithm to calculate the node scores for G
+ and G
-, respectively.
(iv)
TrollTrust [19] expresses the positive edge in the signed network as trust and the negative edge as distrust. The calculated π
i represents the reliability of node i.


### 4.5. Experimental Results

In the experiment, we used three signed network datasets described in Table1. They can be downloaded from http://snap.stanford.edu/data/.Table 1
Datasets statistics.
Datasets
Nodes
Edges
Edges+(%)
Edges-(%)
Epinions
131828
841372
85.3
14.7
Slashdot
81867
545671
77.4
22.6
Wiki-RFA
11258
178096
78.3
21.7Epinions: Epinions.com is a consumer review website where members present their opinions toward each other, and these opinions can be trusted or distrusted. Epinions records these trust or distrust relationships.Slashdot: slashdot.org is a technology-related news website where users could tag each other as friend or foe. Slashdot records these friend or foe relationships.Wiki-RFA: Wikipedia is a free online encyclopedia. If a Wikipedia editor wants to become an administrator, a request for adminship (RfA) must be submitted. Any Wikipedia member may cast a supporting, neutral, or opposing vote. Wiki-RFA records these supporting or opposing relationships.We execute SignRank and comparison methods (PageRank, Hits, MPR, and TrollTrust) on Slashdot, Epinions, and Wiki-RFA datasets. Then we calculate features according to (17), (18), (19), and (20) for each edge based on node scores. At last, we train classifiers for sign prediction. Our experiments use 10-fold cross-validation and all results are the average of 10 repeated calculations.Figures8, 9, and 10 show the performance comparison of five algorithms on Slashdot, Epinions, and Wiki-RFA, respectively. The prediction accuracies of SignRank on three datasets are 91%, 97%, and 90%. It can be observed that our algorithm has better accuracy on all datasets. At the same time, SignRank is also the top performer of prediction precision, which are 93%, 97%, and 90%, respectively. Our recalls are a little lower than the comparison algorithms; however, our f1 scores are better than them. When precision and recall are opposed, f1 score would be the most important measure. Therefore, SignRank performs better in the sign prediction.Figure 8
Accuracy, precision, recall, and f1 score of sign prediction on Slashdot.Figure 9
Accuracy, precision, recall, and f1 score of sign prediction on Epinions.Figure 10
Accuracy, precision, recall, and f1 score of sign prediction on Wiki-RFA.


## 4.1. Verifying

In the experiment, first we use a simple example to verify the effectiveness of the algorithm; then we compare our algorithm with some other ranking algorithms to prove that SignRank is better.An example of signed network is shown in Figure4. There are four nodes in the network, with node A being hostile to nodes B and C, which are also hostile to A. On the other hand, node D is friendly with B and C. Obviously, in the PageRank’s view, the four nodes are the same. The result of SignRank is shown in Figures 5, 6, and 7. In these three figures, the values of tiredness probability λ are 0.9, 0.5, and 0, respectively. Figures 5 and 6 reveal that the negative rank of node A is significantly higher than its positive rank. It should be noted that node A does not have any positive edge, but its positive rank is not 0, because people who hate B and C may bring a positive rank to A.Figure 4
An illustration of signed network. The positive relationships are marked with red plus, and negative relationships are marked with green minus sign.Figure 5
The positive and negative scores of four nodes according to SignRank. The tired probabilityλ is set to 0.9, which means the walker is very likely to leave the node when he is in negative emotion.Figure 6
The positive and negative scores of four nodes according to SignRank. The tired probabilityλ is set to 0.5.Figure 7
The positive and negative scores of four nodes according to SignRank. The tired probabilityλ is set to 0, which means the negative emotion will not affect the walker.In Figure7 we set λ
=
0, which means that the walker will never be tired and run away. In this case, our SignRank degenerates into a PageRank algorithm. Positive and negative signs will no longer have any influence on the ranking algorithm. As a result, positive scores and negative scores of all the nodes are equal.


## 4.2. Evaluation Method

It is very difficult to give a direct proof that our ranking algorithm is better than other algorithms, so we adopted an indirect method that has been used by many researchers to prove the superiority of their algorithm [7, 9, 19]. This method is to use the result of ranking algorithm for sign prediction, and the quality of which can be used to evaluate the ranking algorithm. Sign prediction is an important field of the research on signed networks. When there is an edge e
i
j with an unknown sign in a signed network, we predict the sign through the features of the edge. In order to implement sign prediction, we use ranking score to generate some features 〈
R
e
p
i
,
R
e
p
j
,
O
p
t
i
,
O
p
t
j
〉 [7] for edge e
i
j. R
e
p is the abbreviation of reputation, which represents the popularity of nodes in the network. R
e
p
i and R
e
p
j, respectively, denote the reputation of the two endpoints of edge e
i
j. O
p
t is the abbreviation of optimism, which quantifies the pattern of voting a node in the network. O
p
t
i and O
p
t
j, respectively, represent the optimism of nodes i and j. After extracting features for each edge, a classification model can be used for sign prediction.Reputation and optimism can be calculated through the ranking scoreπ
i of nodes.(15)
R
e
p
i
=
∑
j
ϵ
I
N
i
+
π
j
-
∑
j
ϵ
I
N
i
-
π
j
∑
j
ϵ
I
N
i
+
π
j
+
∑
j
ϵ
I
N
i
-
π
jI
N
(
i
)
+ represents a set of nodes that have a positive edge pointing to i, and I
N
(
i
)
- represents a set of nodes that have a negative edge to i.(16)
O
p
t
i
=
∑
j
ϵ
O
U
T
i
+
π
j
-
∑
j
ϵ
O
U
T
i
-
π
j
∑
j
ϵ
O
U
T
i
+
π
j
+
∑
j
ϵ
O
U
T
i
-
π
jO
U
T
(
i
)
+ represents a set of nodes pointed fromi through positive edges.In this paper, we can measure a node with its positive and negative scores, so we can extendrep to R
e
p
+ and R
e
p
-. They can show popularity and unpopularity of the node. Their calculating methods are as follows:(17)
R
e
p
i
+
=
∑
j
ϵ
I
N
i
+
π
j
+
-
∑
j
ϵ
I
N
i
-
π
j
+
∑
j
ϵ
I
N
i
+
π
j
+
+
∑
j
ϵ
I
N
i
-
π
j
+
(18)
R
e
p
i
-
=
∑
j
ϵ
I
N
i
+
π
j
-
-
∑
j
ϵ
I
N
i
-
π
j
-
∑
j
ϵ
I
N
i
+
π
j
-
+
∑
j
ϵ
I
N
i
-
π
j
-Correspondingly,opt is extended to O
p
t
+ and O
p
t
-.(19)
O
p
t
i
+
=
∑
j
ϵ
O
U
T
i
+
π
j
+
-
∑
j
ϵ
O
U
T
i
-
π
j
+
∑
j
ϵ
O
U
T
i
+
π
j
+
+
∑
j
ϵ
O
U
T
i
-
π
j
+
(20)
O
p
t
i
-
=
∑
j
ϵ
O
U
T
i
+
π
j
-
-
∑
j
ϵ
O
U
T
i
-
π
j
-
∑
j
ϵ
O
U
T
i
+
π
j
-
+
∑
j
ϵ
O
U
T
i
-
π
j
-Therefore, in this paper, we generate eight features denoted by vector v for each edge and then use logistic regression for sign prediction.


## 4.3. Evaluation Metrics

We choose accuracy, recall, precision, and F1 to evaluate the quality of our method and comparative methods. And their definitions are as follows:(i)
Accuracy is the proportion of correctly predicted edges.
(ii)
Recall is the proportion of correctly predicted edges in actually positive edges.
(iii)
Precision is the proportion of correctly predicted edges in predicted positive edges.
(iv)
F1 is the harmonic mean of precision and recall.


## 4.4. Comparative Methods

To study the performance of our algorithm, we apply it in sign prediction and compare it with ranking algorithms as follows.(i)
PageRank [5] is a page scoring algorithm proposed by Google Larry Page. We calculate the PageRank value for each node and consider that π
i
+
=
π
i
-.
(ii)
Hits [6] is an algorithm for analyzing the link topology of a web page. We use the authority value as the score of a node and consider that π
i
+
=
π
i
-.
(iii)
Modified PageRank [7] divides the signed network into two subgraphs, G
+ and G
-. There are only positive edges in G
+ and only negative edges in G
-. It uses the PageRank algorithm to calculate the node scores for G
+ and G
-, respectively.
(iv)
TrollTrust [19] expresses the positive edge in the signed network as trust and the negative edge as distrust. The calculated π
i represents the reliability of node i.


## 4.5. Experimental Results

In the experiment, we used three signed network datasets described in Table1. They can be downloaded from http://snap.stanford.edu/data/.Table 1
Datasets statistics.
Datasets
Nodes
Edges
Edges+(%)
Edges-(%)
Epinions
131828
841372
85.3
14.7
Slashdot
81867
545671
77.4
22.6
Wiki-RFA
11258
178096
78.3
21.7Epinions: Epinions.com is a consumer review website where members present their opinions toward each other, and these opinions can be trusted or distrusted. Epinions records these trust or distrust relationships.Slashdot: slashdot.org is a technology-related news website where users could tag each other as friend or foe. Slashdot records these friend or foe relationships.Wiki-RFA: Wikipedia is a free online encyclopedia. If a Wikipedia editor wants to become an administrator, a request for adminship (RfA) must be submitted. Any Wikipedia member may cast a supporting, neutral, or opposing vote. Wiki-RFA records these supporting or opposing relationships.We execute SignRank and comparison methods (PageRank, Hits, MPR, and TrollTrust) on Slashdot, Epinions, and Wiki-RFA datasets. Then we calculate features according to (17), (18), (19), and (20) for each edge based on node scores. At last, we train classifiers for sign prediction. Our experiments use 10-fold cross-validation and all results are the average of 10 repeated calculations.Figures8, 9, and 10 show the performance comparison of five algorithms on Slashdot, Epinions, and Wiki-RFA, respectively. The prediction accuracies of SignRank on three datasets are 91%, 97%, and 90%. It can be observed that our algorithm has better accuracy on all datasets. At the same time, SignRank is also the top performer of prediction precision, which are 93%, 97%, and 90%, respectively. Our recalls are a little lower than the comparison algorithms; however, our f1 scores are better than them. When precision and recall are opposed, f1 score would be the most important measure. Therefore, SignRank performs better in the sign prediction.Figure 8
Accuracy, precision, recall, and f1 score of sign prediction on Slashdot.Figure 9
Accuracy, precision, recall, and f1 score of sign prediction on Epinions.Figure 10
Accuracy, precision, recall, and f1 score of sign prediction on Wiki-RFA.


## 5. Conclusions and Summary

This paper presents a novel random walk model for signed network. It simulates the action of visiting online social network websites with emotion. When the visitor feels unhappy, he/she leaves. In this way, our model has a clear semantic interpretation of the ranking score, which is the steady probability of the walker visiting the node with emotion. Furthermore, this paper presents an iterative algorithm described in Algorithm1 named SignRank to calculate such probabilities for each node. We also apply our method on sign prediction, and the result shows our method performs better than compared methods.Algorithm 1:SignRank algorithm.
Input: E
+, E
-, λ, α, I
t
a
M
a
x, t
o
l
Output: π
+,π
-
1
π
+
(
0
)
←
1
2
N
1
×
N;
2
π
-
(
0
)
←
1
2
N
1
×
N;
3
t
←
0;
4 while
t
<
I
t
e
r
M
a
x
do
5  for
each
e
i
j
in
E
+
do
6   π
j
+
(
t
+
1
)
←
π
i
+
(
t
)
O
u
t
d
e
g
r
e
e
i;
7   π
j
-
(
t
+
1
)
←
π
i
-
(
t
)
O
u
t
d
e
g
r
e
e
i
∗
λ;
8  end
9  for
each
e
i
j
in
E
-
do
10   π
j
+
(
t
+
1
)
←
π
i
-
(
t
)
O
u
t
d
e
g
r
e
e
i
∗
λ;
11   π
j
-
(
t
+
1
)
←
π
i
+
(
t
)
O
u
t
d
e
g
r
e
e
i;
12  end
13
s
u
m
←
(
∑
i
=
1
N
‍
π
i
-
(
t
)
)
∗
λ
2
N;
14  for
each
π
i
+
(
t
+
1
)
in
π
+
(
t
+
1
)
do
15   π
i
+
(
t
+
1
)
←
(
π
i
+
(
t
+
1
)
+
s
u
m
)
∗
α
+
(
1
-
α
)
2
N;
16  end
17  for
each
π
i
-
(
t
+
1
)
in
π
-
(
t
+
1
)
do
18   π
i
-
(
t
+
1
)
←
(
π
i
-
(
t
+
1
)
+
s
u
m
)
∗
α
+
(
1
-
α
)
2
N;
19  end
20
e
r
r
←
∑
‍
π
+
(
t
+
1
)
+
∑
‍
π
-
(
t
+
1
)
-
∑
‍
π
+
(
t
)
-
∑
‍
π
-
(
t
);
21  if
e
r
r
<
N
∗
t
o
l
then
22   return
[
π
+
(
t
+
1
)
,
π
-
(
t
+
1
)
];
23  end
24 end
25 return
[
π
+
(
t
+
1
)
,
π
-
(
t
+
1
)
]



---

*Source: 4813717-2019-04-09.xml*