cancel
Showing results forΒ
Did you mean:Β

## Question on Node Similarity Algorithm: how many orders of neighbour are used for calculation

Hi there,

This is my first time trying to use Data Science Algorithm, and I want to use node similarity for finding similarity between users of my system.

My question is, for node similarity algorithm, does it calculate the similarity based on only the first order neighbours or all the way to the end of the path of one node?

It'd be really great if i can get this clear up. Thank you very much in advance.

1 ACCEPTED SOLUTION
Neo4j

NodeSimilarity uses only the immediate neighbors in the calculation.

If you want to use the topology of the whole graph, we'd recommend using a node embedding (like FastRP) and combining that with cosine similarity or KNN.

From a computational perspective, comparing nodes baed on their one degree neighbors is expensive - using the same methodology at various depths would be prohibitively slow. What FastRP will do is encode the graph topology around each node into a numerical representation, and then KNN intelligently compares nodes to find the most similar ones based on properties.

2 REPLIES 2
Neo4j

NodeSimilarity uses only the immediate neighbors in the calculation.

If you want to use the topology of the whole graph, we'd recommend using a node embedding (like FastRP) and combining that with cosine similarity or KNN.

From a computational perspective, comparing nodes baed on their one degree neighbors is expensive - using the same methodology at various depths would be prohibitively slow. What FastRP will do is encode the graph topology around each node into a numerical representation, and then KNN intelligently compares nodes to find the most similar ones based on properties.