SimRank

From HandWiki

SimRank is a general similarity measure, based on a simple and intuitive graph-theoretic model. SimRank is applicable in any domain with object-to-object relationships, that measures similarity of the structural context in which objects occur, based on their relationships with other objects. Effectively, SimRank is a measure that says "two objects are considered to be similar if they are referenced by similar objects." Although SimRank is widely adopted, it may output unreasonable similarity scores which are influenced by different factors, and can be solved in several ways, such as introducing an evidence weight factor,[1] inserting additional terms that are neglected by SimRank[2] or using PageRank-based alternatives.[3]

Introduction

Many applications require a measure of "similarity" between objects. One obvious example is the "find-similar-document" query, on traditional text corpora or the World-Wide Web. More generally, a similarity measure can be used to cluster objects, such as for collaborative filtering in a recommender system, in which “similar” users and items are grouped based on the users’ preferences.

Various aspects of objects can be used to determine similarity, usually depending on the domain and the appropriate definition of similarity for that domain. In a document corpus, matching text may be used, and for collaborative filtering, similar users may be identified by common preferences. SimRank is a general approach that exploits the object-to-object relationships found in many domains of interest. On the Web, for example, two pages are related if there are hyperlinks between them. A similar approach can be applied to scientific papers and their citations, or to any other document corpus with cross-reference information. In the case of recommender systems, a user’s preference for an item constitutes a relationship between the user and the item. Such domains are naturally modeled as graphs, with nodes representing objects and edges representing relationships.

The intuition behind the SimRank algorithm is that, in many domains, similar objects are referenced by similar objects. More precisely, objects [math]\displaystyle{ a }[/math] and [math]\displaystyle{ b }[/math] are considered to be similar if they are pointed from objects [math]\displaystyle{ c }[/math] and [math]\displaystyle{ d }[/math], respectively, and [math]\displaystyle{ c }[/math] and [math]\displaystyle{ d }[/math] are themselves similar. The base case is that objects are maximally similar to themselves .[4]

It is important to note that SimRank is a general algorithm that determines only the similarity of structural context. SimRank applies to any domain where there are enough relevant relationships between objects to base at least some notion of similarity on relationships. Obviously, similarity of other domain-specific aspects are important as well; these can — and should be combined with relational structural-context similarity for an overall similarity measure. For example, for Web pages SimRank can be combined with traditional textual similarity; the same idea applies to scientific papers or other document corpora. For recommendation systems, there may be built-in known similarities between items (e.g., both computers, both clothing, etc.), as well as similarities between users (e.g., same gender, same spending level). Again, these similarities can be combined with the similarity scores that are computed based on preference patterns, in order to produce an overall similarity measure.

Basic SimRank equation

For a node [math]\displaystyle{ v }[/math] in a directed graph, we denote by [math]\displaystyle{ I(v) }[/math] and [math]\displaystyle{ O(v) }[/math] the set of in-neighbors and out-neighbors of [math]\displaystyle{ v }[/math], respectively. Individual in-neighbors are denoted as [math]\displaystyle{ I_i(v) }[/math], for [math]\displaystyle{ 1 \le i \le \left|I(v)\right| }[/math], and individual out-neighbors are denoted as [math]\displaystyle{ O_i(v) }[/math], for [math]\displaystyle{ 1 \le i \le \left|O(v)\right| }[/math].

Let us denote the similarity between objects [math]\displaystyle{ a }[/math] and [math]\displaystyle{ b }[/math] by [math]\displaystyle{ s(a, b) \in [0, 1] }[/math]. Following the earlier motivation, a recursive equation is written for [math]\displaystyle{ s(a, b) }[/math]. If [math]\displaystyle{ a = b }[/math] then [math]\displaystyle{ s(a, b) }[/math] is defined to be [math]\displaystyle{ 1 }[/math]. Otherwise,

[math]\displaystyle{ s(a, b) = \frac{C}{\left|I(a)\right| \left|I(b)\right|} \sum_{i=1}^{\left|I(a)\right|}\sum_{j=1}^{\left|I(b)\right|} s(I_i(a), I_j(b)) }[/math]

where [math]\displaystyle{ C }[/math] is a constant between [math]\displaystyle{ 0 }[/math] and [math]\displaystyle{ 1 }[/math]. A slight technicality here is that either [math]\displaystyle{ a }[/math] or [math]\displaystyle{ b }[/math] may not have any in-neighbors. Since there is no way to infer any similarity between [math]\displaystyle{ a }[/math] and [math]\displaystyle{ b }[/math] in this case, similarity is set to [math]\displaystyle{ s(a, b) = 0 }[/math], so the summation in the above equation is defined to be [math]\displaystyle{ 0 }[/math] when [math]\displaystyle{ I(a) = \emptyset }[/math] or [math]\displaystyle{ I(b) = \emptyset }[/math].

Matrix representation of SimRank

Given an arbitrary constant [math]\displaystyle{ C }[/math] between [math]\displaystyle{ 0 }[/math] and [math]\displaystyle{ 1 }[/math], let [math]\displaystyle{ \mathbf{S} }[/math] be the similarity matrix whose entry [math]\displaystyle{ [\mathbf{S}]_{a,b} }[/math] denotes the similarity score [math]\displaystyle{ s(a,b) }[/math], and [math]\displaystyle{ \mathbf{A} }[/math] be the column normalized adjacency matrix whose entry [math]\displaystyle{ [\mathbf{A}]_{a,b}=\tfrac{1}{|\mathcal{I}(b)|} }[/math] if there is an edge from [math]\displaystyle{ a }[/math] to [math]\displaystyle{ b }[/math], and 0 otherwise. Then, in matrix notations, SimRank can be formulated as

[math]\displaystyle{ {{\mathbf{S}}}= \max\{C\cdot (\mathbf{A}^{T} \cdot {{\mathbf{S}}}\cdot {{\mathbf{A}}} ) , {{\mathbf{I}}}\}, }[/math]

where [math]\displaystyle{ \mathbf{I} }[/math] is an identity matrix.

Computing SimRank

A solution to the SimRank equations for a graph [math]\displaystyle{ G }[/math] can be reached by iteration to a fixed-point. Let [math]\displaystyle{ n }[/math] be the number of nodes in [math]\displaystyle{ G }[/math]. For each iteration [math]\displaystyle{ k }[/math], we can keep [math]\displaystyle{ n^2 }[/math] entries [math]\displaystyle{ s_k(*, *) }[/math], where [math]\displaystyle{ s_k(a, b) }[/math] gives the score between [math]\displaystyle{ a }[/math] and [math]\displaystyle{ b }[/math] on iteration [math]\displaystyle{ k }[/math]. We successively compute [math]\displaystyle{ s_{k+1}(*, *) }[/math] based on [math]\displaystyle{ s_k(*, *) }[/math]. We start with [math]\displaystyle{ s_0(*, *) }[/math] where each [math]\displaystyle{ s_0(a, b) }[/math] is a lower bound on the actual SimRank score [math]\displaystyle{ s(a, b) }[/math]:

[math]\displaystyle{ s_0(a, b) = \begin{cases} 1 \mbox{ } , \mbox{ } \mbox{if } a = b \mbox{ } , \\ 0 \mbox{ } , \mbox{ } \mbox{if } a \neq b \mbox{ } . \end{cases} }[/math]

To compute [math]\displaystyle{ s_{k+1}(a, b) }[/math] from [math]\displaystyle{ s_k(*, *) }[/math], we use the basic SimRank equation to get:

[math]\displaystyle{ s_{k + 1}(a, b) = \frac{C}{\left|I(a)\right| \left|I(b)\right|} \sum_{i=1}^{\left|I(a)\right|}\sum_{j=1}^{\left|I(b)\right|} s_k(I_i(a), I_j(b)) }[/math]

for [math]\displaystyle{ a \ne b }[/math], and [math]\displaystyle{ s_{k+1}(a, b) = 1 }[/math] for [math]\displaystyle{ a = b }[/math]. That is, on each iteration [math]\displaystyle{ k + 1 }[/math], we update the similarity of [math]\displaystyle{ (a, b) }[/math] using the similarity scores of the neighbours of [math]\displaystyle{ (a, b) }[/math] from the previous iteration [math]\displaystyle{ k }[/math] according to the basic SimRank equation. The values [math]\displaystyle{ s_k(*, *) }[/math] are nondecreasing as [math]\displaystyle{ k }[/math] increases. It was shown in [4] that the values converge to limits satisfying the basic SimRank equation, the SimRank scores [math]\displaystyle{ s(*, *) }[/math], i.e., for all [math]\displaystyle{ a, b \in V }[/math], [math]\displaystyle{ \lim_{k \to \infty} s_k(a, b) = s(a, b) }[/math].

The original SimRank proposal suggested choosing the decay factor [math]\displaystyle{ C = 0.8 }[/math] and a fixed number [math]\displaystyle{ K = 5 }[/math] of iterations to perform. However, the recent research [5] showed that the given values for [math]\displaystyle{ C }[/math] and [math]\displaystyle{ K }[/math] generally imply relatively low accuracy of iteratively computed SimRank scores. For guaranteeing more accurate computation results, the latter paper suggests either using a smaller decay factor (in particular, [math]\displaystyle{ C = 0.6 }[/math]) or taking more iterations.

CoSimRank

CoSimRank is a variant of SimRank with the advantage of also having a local formulation, i.e. CoSimRank can be computed for a single node pair.[6] Let [math]\displaystyle{ \mathbf{S} }[/math] be the similarity matrix whose entry [math]\displaystyle{ [\mathbf{S}]_{a,b} }[/math] denotes the similarity score [math]\displaystyle{ s(a,b) }[/math], and [math]\displaystyle{ \mathbf{A} }[/math] be the column normalized adjacency matrix. Then, in matrix notations, CoSimRank can be formulated as:

[math]\displaystyle{ {{\mathbf{S}}}= C\cdot (\mathbf{A}^{T} \cdot {{\mathbf{S}}}\cdot {{\mathbf{A}}} ) + {{\mathbf{I}}}, }[/math]

where [math]\displaystyle{ \mathbf{I} }[/math] is an identity matrix. To compute the similarity score of only a single node pair, let [math]\displaystyle{ p^{(0)}(i) = e_i }[/math], with [math]\displaystyle{ e_i }[/math] being a vector of the standard basis, i.e., the [math]\displaystyle{ i }[/math]-th entry is 1 and all other entries are 0. Then, CoSimRank can be computed in two steps:

  1. [math]\displaystyle{ p^{(k)} = A p^{(k-1)} }[/math]
  2. [math]\displaystyle{ s(i,j) = \sum_{k=0}^{\infty} C^k \langle p^{(k)}(i), p^{(k)}(j) \rangle }[/math]

Step one can be seen a simplified version of Personalized PageRank. Step two sums up the vector similarity of each iteration. Both, matrix and local representation, compute the same similarity score. CoSimRank can also be used to compute the similarity of sets of nodes, by modifying [math]\displaystyle{ p^{(0)}(i) }[/math].

Further research on SimRank

  • Fogaras and Racz [7] suggested speeding up SimRank computation through probabilistic computation using the Monte Carlo method.
  • Antonellis et al.[8] extended SimRank equations to take into consideration (i) evidence factor for incident nodes and (ii) link weights.
  • Yu et al.[9] further improved SimRank computation via a fine-grained memoization method to share small common parts among different partial sums.
  • Chen and Giles discussed the limitations and proper use cases of SimRank.[3]

Partial Sums Memoization

Lizorkin et al.[5] proposed three optimization techniques for speeding up the computation of SimRank:

  1. Essential nodes selection may eliminate the computation of a fraction of node pairs with a-priori zero scores.
  2. Partial sums memoization can effectively reduce repeated calculations of the similarity among different node pairs by caching part of similarity summations for later reuse.
  3. A threshold setting on the similarity enables a further reduction in the number of node pairs to be computed.

In particular, the second observation of partial sums memoization plays a paramount role in greatly speeding up the computation of SimRank from [math]\displaystyle{ \mathcal{O}(Kd^2n^2) }[/math] to [math]\displaystyle{ \mathcal{O}(Kdn^2) }[/math], where [math]\displaystyle{ K }[/math] is the number of iterations, [math]\displaystyle{ d }[/math] is average degree of a graph, and [math]\displaystyle{ n }[/math] is the number of nodes in a graph. The central idea of partial sums memoization consists of two steps:

First, the partial sums over [math]\displaystyle{ I(a) }[/math] are memoized as

[math]\displaystyle{ \text{Partial}_{I(a)}^{s_{k}}(j)=\sum_{i \in I(a)}s_{k}(i,j), \qquad (\forall j \in I(b)) }[/math]

and then [math]\displaystyle{ s_{k+1} (a,b) }[/math] is iteratively computed from [math]\displaystyle{ \text{Partial}_{I(a)}^{s_{k}}(j) }[/math] as

[math]\displaystyle{ s_{k+1}( a,b )=\frac{C}{| I(a) | | I(b) |}\sum_{j \in I(b) } \text{Partial}_{I(a)}^{s_{k}}(j). }[/math]

Consequently, the results of [math]\displaystyle{ \text{Partial}_{I(a)}^{s_{k}}(j) }[/math], [math]\displaystyle{ \forall j \in I(b) }[/math], can be reused later when we compute the similarities [math]\displaystyle{ s_{k+1}(a,*) }[/math] for a given vertex [math]\displaystyle{ a }[/math] as the first argument.

See also

Citations

  1. I. Antonellis, H. Garcia-Molina and C.-C. Chang. Simrank++: Query Rewriting through Link Analysis of the Click Graph. In VLDB '08: Proceedings of the 34th International Conference on Very Large Data Bases, pages 408--421. [1]
  2. W. Yu, X. Lin, W. Zhang, L. Chang, and J. Pei. More is Simpler: Effectively and Efficiently Assessing Node-Pair Similarities Based on Hyperlinks. In VLDB '13: Proceedings of the 39th International Conference on Very Large Data Bases, pages 13--24. [2]
  3. 3.0 3.1 H. Chen, and C. L. Giles. "ASCOS++: An Asymmetric Similarity Measure for Weighted Networks to Address the Problem of SimRank." ACM Transactions on Knowledge Discovery from Data (TKDD) 10.2 2015.[3]
  4. 4.0 4.1 G. Jeh and J. Widom. SimRank: A Measure of Structural-Context Similarity. In KDD'02: Proceedings of the eighth ACM SIGKDD international conference on Knowledge discovery and data mining, pages 538-543. ACM Press, 2002. "Archived copy". Archived from the original on 2008-05-12. https://web.archive.org/web/20080512152518/http://www-cs-students.stanford.edu/~glenj/simrank.pdf. Retrieved 2008-10-02. 
  5. 5.0 5.1 D. Lizorkin, P. Velikhov, M. Grinev and D. Turdakov. Accuracy Estimate and Optimization Techniques for SimRank Computation. In VLDB '08: Proceedings of the 34th International Conference on Very Large Data Bases, pages 422--433. "Archived copy". Archived from the original on 2009-04-07. https://web.archive.org/web/20090407093025/http://modis.ispras.ru/Lizorkin/Publications/simrank_accuracy.pdf. Retrieved 2008-10-25. 
  6. S. Rothe and H. Schütze. CoSimRank: A Flexible & Efficient Graph-Theoretic Similarity Measure. In ACL '14: Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1392-1402 . [4]
  7. D. Fogaras and B. Racz. Scaling link-based similarity search. In WWW '05: Proceedings of the 14th international conference on World Wide Web, pages 641--650, New York, NY, USA, 2005. ACM. [5]
  8. Antonellis, Ioannis, Hector Garcia Molina, and Chi Chao Chang. "Simrank++: query rewriting through link analysis of the click graph." Proceedings of the VLDB Endowment 1.1 (2008): 408-421. arXiv:0712.0499
  9. W. Yu, X. Lin, W. Zhang. Towards Efficient SimRank Computation on Large Networks. In ICDE '13: Proceedings of the 29th IEEE International Conference on Data Engineering, pages 601--612. "Archived copy". Archived from the original on 2014-05-12. https://web.archive.org/web/20140512220118/http://www.cse.unsw.edu.au/~weirenyu/pubs/icde13.pdf. Retrieved 2014-05-09. 

Sources