Module org.jgrapht.core
Package org.jgrapht.alg.linkprediction
Class SaltonIndexLinkPrediction<V,E>
java.lang.Object
org.jgrapht.alg.linkprediction.SaltonIndexLinkPrediction<V,E>
- Type Parameters:
- V- the graph vertex type
- E- the graph edge type
- All Implemented Interfaces:
- LinkPredictionAlgorithm<V,E>
public class SaltonIndexLinkPrediction<V,E> extends java.lang.Object implements LinkPredictionAlgorithm<V,E>
Predict links using the Salton Index, also called the cosine similarity.
 
 
This is a local method which computes $s_{xy} = \frac{|\Gamma(u)\cap\Gamma(v))|}{\sqrt{k(u) \times k(v)}}$ where for a node $v$, $\Gamma(v)$ denotes the set of neighbors of $v$ and $k(v) = |\Gamma(v)|$ denotes the degree of $v$.
See the following two papers:- Liben‐Nowell, David, and Jon Kleinberg. "The link‐prediction problem for social networks." Journal of the American society for information science and technology 58.7 (2007): 1019-1031.
- Zhou, Tao, Linyuan Lü, and Yi-Cheng Zhang. "Predicting missing links via local information." The European Physical Journal B 71.4 (2009): 623-630.
- Author:
- Dimitrios Michail
- 
Constructor SummaryConstructors Constructor Description SaltonIndexLinkPrediction(Graph<V,E> graph)Create a new prediction
- 
Method Summary
- 
Constructor Details- 
SaltonIndexLinkPredictionCreate a new prediction- Parameters:
- graph- the input graph
 
 
- 
- 
Method Details- 
predictDescription copied from interface:LinkPredictionAlgorithmPredict an edge between two vertices. The magnitude and the interpretation of the returned score depend solely on the algorithm.- Specified by:
- predictin interface- LinkPredictionAlgorithm<V,E>
- Parameters:
- u- first vertex
- v- second vertex
- Returns:
- a prediction score
 
 
-