Module org.jgrapht.core
Package org.jgrapht.alg.linkprediction
Class LeichtHolmeNewmanIndexLinkPrediction<V,E>
java.lang.Object
org.jgrapht.alg.linkprediction.LeichtHolmeNewmanIndexLinkPrediction<V,E>
- Type Parameters:
V
- the graph vertex typeE
- the graph edge type
- All Implemented Interfaces:
LinkPredictionAlgorithm<V,
E>
public class LeichtHolmeNewmanIndexLinkPrediction<V,E>
extends Object
implements LinkPredictionAlgorithm<V,E>
Predict links using the Leicht-Holme-Newman Index.
This is a local method which computes $s_{xy} = \frac{|\Gamma(u)\cap\Gamma(v))|}{k(u) \cdot 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 paper:- E.A. Leicht, P. Holme, M.E.J. Newman, Phys. Rev. E 73, 026120 (2006)
- Author:
- Dimitrios Michail
-
Constructor Summary
ConstructorDescriptionLeichtHolmeNewmanIndexLinkPrediction
(Graph<V, E> graph) Create a new prediction -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jgrapht.alg.interfaces.LinkPredictionAlgorithm
predict
-
Constructor Details
-
LeichtHolmeNewmanIndexLinkPrediction
Create a new prediction- Parameters:
graph
- the input graph
-
-
Method Details
-
predict
Description copied from interface:LinkPredictionAlgorithm
Predict an edge between two vertices. The magnitude and the interpretation of the returned score depend solely on the algorithm.- Specified by:
predict
in interfaceLinkPredictionAlgorithm<V,
E> - Parameters:
u
- first vertexv
- second vertex- Returns:
- a prediction score
-