• Type Parameters:
V - the graph vertex type
E - the graph edge type
All Known Implementing Classes:
AdamicAdarIndexLinkPrediction, CommonNeighborsLinkPrediction, HubDepressedIndexLinkPrediction, HubPromotedIndexLinkPrediction, JaccardCoefficientLinkPrediction, LeichtHolmeNewmanIndexLinkPrediction, PreferentialAttachmentLinkPrediction, ResourceAllocationIndexLinkPrediction, SaltonIndexLinkPrediction, SørensenIndexLinkPrediction

public interface LinkPredictionAlgorithm<V,​E>

A link prediction algorithm provides a score $s_{uv}$ for any pair of vertices $u,v \in V$ in the graph such that $e=(u,v) \notin E$. The nature, the magnitude and possible interpretation of such a score depends solely on the actual algorithm, meaning that it might be a similarity score, a distance metric, a probability, or even something completely unrelated. Depending on the particular algorithm, a possible interpretation of the scores might be that they measure similarity between vertices $u$ and $v$. Thus, given such scores one could sort the edges in decreasing order and pick the top-k as links (edges) which are likely to exist.

Author:
Dimitrios Michail
• ### Method Summary

All Methods
Modifier and Type Method Description
default java.util.List<Triple<V,​V,​java.lang.Double>> predict​(java.util.List<Pair<V,​V>> queries)
Predict an edge between a set of vertex pairs.
double predict​(V u, V v)
Predict an edge between two vertices.
• ### Method Detail

• #### predict

default java.util.List<Triple<V,​V,​java.lang.Double>> predict​(java.util.List<Pair<V,​V>> queries)
Predict an edge between a set of vertex pairs. The magnitude and the interpretation of the returned scores depend solely on the algorithm.
Parameters:
queries - a list of vertex pairs
Returns:
a list of vertex triples where the last component is an edge prediction score
• #### predict

double predict​(V u,
V v)
Predict an edge between two vertices. The magnitude and the interpretation of the returned score depend solely on the algorithm.
Parameters:
u - first vertex
v - second vertex
Returns:
a prediction score