Sitemap
Data Science Collective

Advice, insights, and ideas from the Medium data science community

Image created with Dall E by the author.

Member-only story

Graph Neural Networks Part 4: Teaching Models to Connect the Dots

Heuristic and GNN-based approaches to Link Prediction

11 min readJun 5, 2025

--

Have you ever wondered how it’s possible that Facebook knows who you might know? Or why it sometimes suggests a total stranger? This problem is called link prediction. In a social network graph, people are nodes and friendships are edges, the goal is to predict if a connection should exist between two nodes.

Link prediction is a very popular topic! It can be used to recommend friends in social networks, suggest products on e-commerce sites or movies on Netflix, or predict protein interactions in biology. In this post, you will explore how link prediction works. First you will learn simple heuristics, and we end with powerful GNN-based methods like SEAL.

The previous posts explained GCNs, GATs, and GraphSage. They mainly covered predicting node properties, so you can read this article standalone, because this time we shift focus to predicting edges. If you want to dive a bit deeper into node representations, I recommend to revisit the previous posts. The code setup can be found here.

What is Link Prediction?

Link prediction is the task of forecasting missing or future connections (edges) between nodes in a graph. Given a graph G

--

--

Data Science Collective
Data Science Collective

Published in Data Science Collective

Advice, insights, and ideas from the Medium data science community

Hennie de Harder
Hennie de Harder

Written by Hennie de Harder

📈 Data Scientist & ML Engineer 💡 Simplifying complex topics ✨ Sharing fun side projects 💻 Working at IKEA and BigData Republic 🐈 Love math, cats, & running

No responses yet