Temporal & Dynamic Graphs

Graphs that change over time - snapshots, continuous-time models, and temporal link prediction.

1. Three Types of Dynamic Graphs

TypeDescriptionExample
StaticGraph fixed in timeCora citations (snapshot)
Discrete-timeSequence of graph snapshots $G_1, G_2, \ldots$Monthly co-purchase networks
Continuous-timeEdges arrive with timestamps $(u, v, t)$Social interactions, payments
Why not ignore time? If you shuffle timestamps, you leak future into past. A model that sees tomorrow's edges will look great and fail in production.

2. Snapshot Methods

Run a GNN on each snapshot independently, then aggregate over time with RNN/Transformer/attention.

$$\mathbf{h}_i^{(t)} = \text{GNN}(G_t, \mathbf{X}_t)_i \quad \mathbf{z}_i = \text{TemporalAgg}(\{\mathbf{h}_i^{(t)}\}_{t=1}^T)$$

Simple but loses fine-grained event order within snapshots.

3. EvolveGCN & DySAT

EvolveGCN: GCN weights evolve over time via RNN - parameters at step $t$ depend on $t-1$.

DySAT: structural self-attention within each snapshot + temporal self-attention across snapshots.

4. Temporal Graph Networks (TGN)

TGN maintains a memory vector per node, updated when an interaction happens:

  1. Event $(u, v, t)$ arrives
  2. Fetch memory $\mathbf{s}_u, \mathbf{s}_v$
  3. Compute message from event + node states
  4. Update memories with GRU-like module
  5. Compute embedding for prediction

Handles streaming edges in real time - used for dynamic link prediction and recommendation.

6. When Temporal Modeling Matters