Course contentsShow
← Machine Learning and Deep Learning
Lesson 2521 of 3,53854. Graph Neural NetworksFree lesson

Temporal and Dynamic GNNs

Handling evolving graphs with temporal edges, snapshots, and continuous-time message passing.

Temporal and Dynamic GNNs

What you'll learn: How to apply GNNs to graphs that change over time, with edges and nodes appearing, disappearing, or updating.

The Core Problem

Real-world graphs aren't static—social networks gain and lose connections, traffic patterns shift throughout the day, and molecules reconfigure during reactions. Temporal and Dynamic GNNs extend standard GNNs to handle graphs that evolve over time, capturing both structural patterns and temporal dynamics.

Three Main Approaches

1. Discrete Snapshots

Treat the evolving graph as a sequence of static snapshots (G₀, G₁, G₂, ...). Apply GNN layers to each snapshot independently, then use recurrent layers (GRU/LSTM) or temporal convolutions across snapshots to model evolution:

Snapshot t=0 → GCN → h₀
Snapshot t=1 → GCN → h₁  → RNN/LSTM → predictions
Snapshot t=2 → GCN → h₂

This builds on your knowledge of message passing across spatial neighbors, now adding temporal connections between time steps.

2. Temporal Edges

Augment edges with timestamps. Each edge (u, v, t) records when an interaction occurred. GNNs aggregate messages only from temporal neighbors within relevant time windows—like a sliding attention mechanism over time.

3. Continuous-Time Message Passing

Model graphs where events happen at arbitrary continuous times. Use temporal point processes or learned time encodings. Messages are weighted by how recently they occurred, with older interactions decaying in influence.

The Analogy

Think of modeling a city's transportation network: the snapshot approach takes photos every hour, temporal edges track each individual trip with its timestamp, and continuous-time methods model the smooth flow of traffic moment-by-moment.

Key Takeaway: Temporal and Dynamic GNNs extend neighborhood aggregation across time by treating evolving graphs as snapshot sequences, adding temporal edge information, or using continuous-time message passing to capture how graph structure and signals change.