I'm trying to solve a link prediction problem using jgraphT. I'm calculating similarity between two nodes based on the neighbours of the two nodes. Each node has some properties. The calculation is getting too much as some of the nodes have around 700 neighbors and I have 4500 such nodes. I have 700K edges for whose pairs, I calculate similarity.
Now, instead of using all the neighbours of a node, I want to use only k-nearest neighbours of each node for calculating similarity between a pair of nodes. I can add some weight on all edges in graph, based on the no. of properties the two nodes of the edge share, or no. of shortest paths of length-n between the nodes etc.
Can any one tell me if there is an option to get nearest neighbors in jGraphT ?