Cosine similarity (Network theory)

guillefix 4th November 2016 at 2:43pm

Cosine similarity (a.k.a. Salton's cosine) is a measure of structural similarity of two nodes in a network. It counts the number of common neighbours of nodes i and j (given by nij=kAikAkjn_{ij} = \sum_k A_{ik}A_{kj}) and divide by the geometric mean of the degrees of i and k:

σij=nijkikj\sigma_{ij}= \frac{n_{ij}}{\sqrt{k_i k_j}}

where σij\sigma_{ij} is the cosine similarity. The formula is the same as the cosine of the angle between the column of node i and row of node j considered as vectors, hence the name.