- Year
- 2003
- Type
- Network inference task
What does it do?
Link prediction is a network-analysis task that estimates which edges are missing from an observed graph or which edges are likely to form later.
Liben-Nowell and Kleinberg formalised it in a 2007 article, and the field now spans simple structural similarity indices (Common Neighbors, Jaccard coefficient, Adamic-Adar), matrix factorisation, and graph neural network (GNN) methods. Because real networks contain far more unconnected pairs than edges, results are usually compared with AUC-ROC and Average Precision (AP) computed on held-out edges.
The intuition behind the method
In any real-world network, the recorded edges represent only a fraction of the true connections: friendship platforms miss undisclosed ties, citation databases omit unindexed papers, and protein-interaction assays leave many pairs untested. Link prediction asks: given the connections we can see, which unobserved pairs are most likely to be connected? The core intuition is that two nodes sharing many common neighbours, or sitting close to each other in a learned embedding space, are more likely to be linked than two structurally distant nodes. Similarity-based indices make this explicit with a single formula; GNN-based approaches learn which structural patterns best predict connectivity from labelled examples.
History
Liben-Nowell and Kleinberg formalised the task in a 2007 article in the Journal of the American Society for Information Science and Technology. In that article they measured node proximity on large coauthorship networks and found that information about future interactions could be extracted from network topology alone. Later work extended the task to matrix factorisation and probabilistic generative models. More recent graph neural network approaches, such as the Seal framework, which extracts local enclosing subgraphs and classifies them with a GNN, represent a further line of development.
When to use it
Choose link prediction when the network is incomplete or evolving and the goal is to recover unobserved edges or anticipate new ones, for example recommending connections, predicting future collaborations or citations, or completing a knowledge graph. A minimum of 50 nodes is recommended, and the observed graph must contain enough edges for structural patterns to be learnable. Graphs with fewer than 50 nodes fall below this recommended minimum; results from them should be treated as provisional and checked against a simpler baseline, and for very small graphs centrality analysis may be a more suitable starting point. Avoid the method when the observed graph comes from a heavily biased sampling mechanism, because the inferred edges may then reflect the sampling rather than the underlying structure.
Limitations and considerations
- Performance depends on the negative-sampling strategy; different strategies can lead to different conclusions about which model performs better on the same network.
- GNN-based methods need a sufficiently large set of labelled edges and more computation than the structural indices.
- Structural indices assume that similarity in observed topology implies future connectivity, an assumption that may fail in networks with heterophilic structure, where linked nodes are dissimilar.
- Temporal train-test splitting requires reliable timestamps; without them, information leakage from the test edges can inflate apparent performance.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Similarity indices such as Common Neighbors, Jaccard and Adamic-Adar need no training and score pairs directly from the observed topology, which makes them a transparent baseline.
- Because simple indices and GNN methods can be run on the same train-test split, the two can be compared directly on one network before choosing a more complex model.
- The Seal-style approach classifies local enclosing subgraphs, so it can use higher-order patterns that a single neighbourhood count does not capture.
- AUC-ROC and AP evaluate the ranking of held-out positive and negative pairs rather than a single decision threshold, so no cut-off has to be chosen before evaluation.
Applications
- Friend or connection recommendation in social networks (Facebook People You May Know, LinkedIn).
- Predicting future research collaborations or citation relationships in academic networks.
- Inferring missing protein-protein interactions in biological networks from partial experimental data.
- Completing knowledge graphs by predicting relations between entities.
- Drug-target interaction prediction in pharmacological networks.
How it works
How it works
The network is built from observed edges and split into training and test sets, by timestamp where available and at random otherwise. Temporal splitting is preferred whenever timestamps exist because it prevents future edges from informing predictions about past ones. The training graph is the only graph the scoring method may observe.
Most node pairs are unconnected, so scoring every absent pair is usually impractical. A negative-sampling strategy (random, hard-negative or degree-balanced) selects non-existing pairs to serve as negative examples. The size and strategy of this sample can change measured performance substantially, so they must be reported alongside the results.
Each candidate pair receives a likelihood score. Structural indices compute it from observed topology: Common Neighbors counts shared neighbours, Jaccard divides that count by the union of the two neighbourhoods, and Adamic-Adar weights shared neighbours by the inverse log of their degree. The Katz measure extends this idea to paths of every length between two nodes, weighting longer paths less through a decay parameter beta. Beta must be smaller than the inverse of the largest eigenvalue of the matrix A for the infinite sum to converge, and a weighted version is obtained by replacing A with the weight matrix of the graph. Katz is often reported to give prediction results of excellent quality. Random-walk measures define proximity differently: personalised PageRank of node j with restarts at node i is asymmetric and, for undirected graphs, can be averaged over both directions, and SimRank is a further option in this family. Matrix-factorisation methods score pairs by the dot product of latent factors, and GNN methods such as Seal classify local subgraphs around each pair to capture higher-order structural patterns.
Predictions are ranked by score and compared against held-out positive and negative edges. AUC-ROC measures the probability that a random positive pair is ranked above a random negative pair. Average Precision summarises precision across the full ranking and is more informative when positive examples are rare. Both metrics should be reported, since accuracy alone is misleading under severe class imbalance.
Common pitfalls
- Leaking future edges into the training graph. Use a temporal or strictly random split and verify that no test edge appears in the training adjacency matrix.
- Reporting only accuracy. Because non-edges vastly outnumber true edges, a model that predicts 'no edge' everywhere scores highly on accuracy, so AUC-ROC and AP should always be reported.
- Ignoring the negative-sampling strategy when comparing methods. Changing the sampling can change which model appears better.
- Applying link prediction to very small graphs. Graphs with fewer than 50 nodes fall below the recommended minimum, where structural patterns are often too sparse for reliable scores; check their results against a baseline or a centrality analysis.
- Treating a biased observed graph as a representative sample. If observed edges systematically miss certain node types, predictions will inherit that bias.
Frequently asked questions
Which approach should I choose: a similarity index or a GNN?
Similarity indices (Common Neighbors, Jaccard, Adamic-Adar) are a sensible starting point: they require no training, are easy to interpret, and give a baseline to compare against. GNN-based methods such as Seal can capture more complex structure but need a sufficient number of labelled edges and more computation. When data are limited or interpretability matters, start with indices.
How do I split the graph for evaluation without leaking information?
If your edges carry timestamps, use a temporal split: train on edges observed before a cutoff time and test on edges formed after it. Without timestamps, hold out a random fraction of edges as positives and sample an equal or fixed number of non-edges as negatives, ensuring no held-out edge appears in the training adjacency matrix.
Why is AUC preferred over accuracy?
In most real networks the number of absent edges greatly exceeds the number of present ones. A model that predicts 'no edge' for every pair achieves high accuracy while predicting nothing useful. AUC-ROC is rank-based and does not depend on the class ratio, so it is a more meaningful summary here. AP is also rank-based, but its values depend on how rare positive pairs are, so it should be compared only across methods evaluated on the same test set.
Can link prediction be applied to directed or weighted graphs?
Possibly, but the index definitions described on this page are stated for undirected, unweighted graphs. Directed or weighted variants of similarity indices, and GNN frameworks that handle edge direction or edge features, must be checked against their own definitions before they are used on such data.
Related methods
Sources
Liben-Nowell, D. & Kleinberg, J. (2007). The Link-Prediction Problem for Social Networks. Journal of the American Society for Information Science and Technology, 58(7), 1019-1031.
Open DOI referenceZhang, M. & Chen, Y. (2018). Link Prediction Based on Graph Neural Networks. Advances in Neural Information Processing Systems (NeurIPS), 31.
Open publication reference2015_Book_DataMining, p. 653