Given a directed graph G=⟨V,E⟩, the SimRank score s(i,j) for each i,j∈V measures the similarity between vertices i and j, defined as thus
s(i,j)={1,∣I(i)∣∣I(j)∣c∑a∈I(i),b∈I(j)s(a,b), if i=jotherwise
where I(i) is the set of in-neighbors of i∈V, and c∈(0,1).
Interpretations
First Meeting Time of Non-Stop Random Walks
s(i,j) can be interpreted as the value of
E[cTi,j],
where Ti,j is the random variable of the first time that a reverse random walk (a random walk that travel along the incoming edges of a vertex uniformly at random) from i and a reverse random walk from j meets. Note that
Ti,j={0,∣I(i)∣∣I(j)∣1∑a∈I(i),b∈I(j)Ta,b, if i=jotherwise.
There is another random walk interpretation fo SimRank:
First, notice that when i=j, [TX16] rewrites the SimRank as
s(i,j)=∣I(i)∣∣I(j)∣cca∈I(i),b∈I(j)∑s(a,b)
Second, [TX16] defines the c-random walk as
In any step, the walk stops with probability 1−c.
With the other c probability, the walk chose the in-neighbors of the current vertex uniformly at random.
Finally s(i,j) is interpreted as
The probability of two c random walks ever meet, such that one of the random walks starts at vertex i and the other starts at j.
Computation
Monte Carlo
A straightforward solution is to perform Monte Carlo simulation to calculate s(i,j)--we initialize two c-random walks from i and j respectively, and simulate the two walks until they meet, or either walk stops.
We need not to worry about that this process continues forever.
Since the expected number of steps of a c random walk is given by
c+c2+c3+......=1−cc
which is a constant.
Chernoff Bound
We repeat this process t times.
Let Xk be indicate for the event that the two walks meet in the k-th trial.
It is easy to see that Xk,k∈[t] is a sequence of i.i.d random variables with E[Xk]=s(i,j).
Let Xˉ≐(1/t)⋅∑k∈[t]Xk and μ≐s(i,j).
By Chernoff Bound,
Pr[∣Xˉ−μ∣>(1+λ)μ]≤2exp(−3tμλ2)=δ,
where λ is relative error ratio and δ the error probability we would like to achieve.
Time Complexity
The previous section implies t=μλ23logδ2. By setting ϵ=(1+λ)μ⇔λ=μϵ−1, we get
t=μ(μϵ2−2μϵ+1)3logδ2=O(ϵ2μlogδ1).
Notice that when ϵ is small, say 0.01, ϵ21 is large thus can not be neglected. The problem remains whether we could reduce the number of random walks.
Index
Another acute observation from [TX16] is that if two walks reach the same vertex, their following behavior follows the same probability distribution (since the walks are memoryless).
Motivated by this, define hiℓ(k) as the hitting probability such that a walk begins at vertex i and reaches vertex j at the ℓ-th step. hiℓ(k) can be updated iteratively using
hiℓ(k)=∣I(i)∣cj∈I(i)∑hjℓ−1(k)
SimRank and Hitting Probability
Now we consider about bridging the gap between SimRank score and hitting probability.
For each i,j∈V, define the indicator I(i,j) for the event that two c-random walks starting from i and j respectively ever meet.
E[I(i,j)]=s(i,j).
I(i,j,k,ℓ) the indicator the event that two random walks, starting from i and j respectively, meet at ℓ-th step at k and this is the last time they meet.
In other word, these two walk never meet again after ℓ-th step at k.
It is easy to see that for different k and ℓ, the events indicated by the I(i,j,k,ℓ)'s are mutually disjoint.
Therefore,
I(i,j)=k∑ℓ∑I(i,j,k,ℓ).
Let dk be the probability that two walks from k never meet except for the first step.
Then
Notice that for a given i, there infinity many hiℓ(k)'s we need to kept, which is unfeasible.
To get around this, we only keep the hiℓ(k)'s greater than ϵh, where ϵh=O(ϵ).
The probability that the c-random walk does not to stop before ℓ-th step is cℓ, i.e.,
k=1∑nhiℓ(k)=cℓ.
For a fixed ℓ, at most cℓ/ϵh number of hiℓ(k)'s are kept.
So the total number of hiℓ(k)'s kept is bounded by
ϵh1(c+c2+c3+......)=O(ϵh1)=O(ϵ1).
On the other hand, estimation of dk could be done by monte carlo simulation. By Chernoff bound, we can show that with
O(ϵd21logδd1)
samples, dk could be estimated by dkˉ such that ∣dkˉ−dk∣<ϵd holds with at least 1−δd probability, where ϵd=O(ϵ).
Reference
[TX16] Boyu. Tian and Xiaokui. Xiao SLING: A Near-Optimal Index Structure for SimRank. SIGMOD'16