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 ) and divide by the geometric mean of the degrees of i and k:
where 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.