This section presents our algorithm TSWSWalker (Web Services Walker based on Trust Similarity) by improving the random walk algorithm [17, 18]. All notations used in our algorithm are listed in Table 1.
1. A Single Random Walk
For the to-be-recommended service s0, the random walk starts from the source user u0. At each step k, a certain user u is reached. If u already rated s0, then the random walk stops and return ru,0 as the result. If not, there are two options as follows:
(1) The random walk will stop at uc with a certain probability 𝜑u,k. Then, the service si is selected from RSu based on the selection probability SPu(si). The rating of si given by u is returned as a result.
The probability 𝜑u,k is affected by the similarity of the service of RSu. A bigger similarity between the selected service si and s0 incurs the greater probability to stop.
A Novel Service Recommendation Approach 431
To get more trust users, the probability of keeping random walk 𝜑u,k should increase by considering the walk distance k. The following equation is adopted as [18, 19].
𝜑u,k =max
si∈RSu
Sim( si,s0)
× 1 1+e−
k 2
(3) When this walk stops at the user u, the method needs to select a service from RSu. The probability SPu(
si)
is computed according to the following equation:
SPu(si) = simS(si,s0)
∑
sj∈RSu
simS(sj,s0) (4)
Once one service si is selected, the rating of si given by u is returned as the result.
(2) Another possibility is that the walk continues with a probability 1−𝜑u,k. A user is selected from the set of direct trust neighbors for the next walk. Meanwhile this user is the most trusted by the source user u0.
In the trust network, It is proved that choosing a user randomly will decrease the predication accuracy in [18], different from which we consider the trust similarity and rating similarity between the source user S0 and to-be-selected user comprehensively instead of the single similarity of the current uc and to-be-selected user.
① We propose that the trust similarity which is employed in the users’ selection phase is computed by Jaccard similarity. The equation is as follows:
Ja,b= ||Ta∩Tb||
||Ta∪Tb|| (5)
Table 1. All notations in our algorithm Symbols Description
ru,s The rating of service s given by user u
r′u,s The predicted rating of service s given by user u uc The current user u
𝜑u,k The probability that the random walk stops at user u in the kth step RSu The set of services which user u rated
SPu(si) The probability that si is selected from RSu to gain the u’s rating for si
TSu The set of users which user u give trust value directly in the dataset UPu(ua) The probability that ua is selected from TSu to gain ru,s
simS(si,sj) The similarity of services si and sj simS(ua,ub) The similarity of users ua and ub
432 G. Li et al.
where Ta and Tb denote the set of trusted users of user a and user b.
② For the condition that there are two users, who have the same number of trust users between source user. To differentiate from them, we design an improved Jaccard similarity equation as follows:
J+a,b=
∑
u∈Ta∩Tb
1∗ 1 du
0,u
||Ta∪Tb|| (6)
where du
0,u denotes the minimum distance between the source user u0 and the user u who is in the intersection of users a and b. It is obviously, Eq. (6) is a general forma‐
tion of Eq. (5) when the common users come from the direct trust users intersection of two users a and b.
③ Another condition is that there are no users who are commonly trusted by two users.
The user is selected by the bigger similarity between simS(ua,ug) and simS(ua,uh). All in all, the user selection similarity is decided as follows:
UPu(Ua) =
⎧⎪
⎨⎪
⎩
∑
a∈TSu
max (
J+u
0,a
)
Tu
0∩Ta≠∅
∑
a∈TSu
max(
simS(ua,uu
0)) Tu
0∩Ta= ∅ (7)
The random walk is likely to run and never stop. Here three cases to stop it are listed as follows:
(1) Stopping at a user who has rated the service s0.
(2) A user node is stayed and a service is selected to return its rating.
(3) To avoid walking forever, the maximum depth is set to 6 to terminate the walk according to the “six-degrees of separation” in the social networks.
2. Ratings predication
The final predicated ratings can be gained via the results returned from multiple walks. The equation is:
ru′
0,s= 1
n
∑n i=1
ri (8)
where ri is the returned result of each walk, n is the number of total walks. To decide the number of random walks, the variance of the predicted values is employed. Let rj denotes the returned value of the jth random walk and r denotes the average value returned by n random walks. The calculation equation of variance 𝜎2 of i iterations is as follows:
A Novel Service Recommendation Approach 433
𝜎i2= 1 i
∑i j=1
(rj−r)2
(9) We also set a tunable parameter 𝜀 to guide the termination of walk satisfying the condition |||𝜎i+12 −𝜎i2|||≤𝜀. In our experiments, this parameter is set to be 0.0001.
4 Experiments and Evaluation