Common neighbor count measures neighborhood overlap for a pair of nodes: count the distinct nodes connected to both. As a link-prediction feature, a larger count suggests a greater chance that the pair will form a future connection. section 10.3.3 section 10.1
The measure fits situations where shared contacts create opportunities to meet. Two people with many mutual friends are more likely to encounter one another; likewise, Twitch streams with overlapping audiences through an intermediate stream may develop a direct audience-overlap link. section 10.0 section 10.3.3
To prepare common neighbor count for a link-prediction model:
- Start with node pairs marked by TEST_TRAIN or NEGATIVE_TEST_TRAIN relationships, where the pair has no direct connection. section 10.3.3
- Match neighbors shared by both endpoints and count distinct shared nodes. section 10.3.3
- Use OPTIONAL MATCH so pairs with no shared neighbors remain in the results. section 10.3.3
- Store the count as the commonNeighbor property on the pair relationship for model training or testing. section 10.3.3
Mutual friends as a prediction signal
If Luke and Rajiv are closer in a friendship network because they share friends, they are a stronger future-link candidate than Jose and Alice. The count is not a guarantee; it is one feature describing how much two nodes' neighborhoods overlap. section 10.0 section 10.1
Use the diagram to inspect the intermediate nodes that belong to both endpoints' neighborhoods before counting them. section 10.3.3
Common neighbor count can be evaluated alongside other pair features. In one trained model, it was among the relevant features, behind the Adamic-Adar index and ahead of network distance in feature importance. section 10.4.3
