Static vs Dynamic Graphs: When Structure Changes Over Time

5 minute read

Published:

TL;DR: A static graph has fixed topology throughout learning. A dynamic graph changes over time: edges form and dissolve, nodes arrive and depart, features drift. Dynamic graphs come in two forms โ€” discrete-time (snapshots) and continuous-time (event streams). Each requires different modelling assumptions.
Dynamic graph evolution
Continuous-time dynamic graph: event stream processed by TGN (Rossi et al., 2020)
Key Insight: A static GNN is like a map printed once โ€” it is accurate at print time but goes stale the moment a new road opens. A dynamic graph model is like a live navigation app โ€” it ingests new events continuously and always reflects the current state. The choice between snapshot (DTDG) and event-stream (CTDG) models is really a question of how finely you need to track time: daily snapshots suffice for monthly patterns, but millisecond transactions demand continuous-time treatment.

Why Graphs Change Over Time

Real-world networks are never truly static:

  • Social networks: friendships form and fade, users join and leave
  • Financial networks: transactions occur at specific timestamps
  • Traffic networks: road states change with congestion, incidents
  • Citation networks: papers get cited over years; authors leave academia
  • Protein interactions: binding/unbinding events, cell-state-dependent interactions

A static GNN trained once on a snapshot cannot predict future edges or adapt to structural shifts. Dynamic graph learning is the framework for handling this.

Taxonomy of Dynamic Graphs

Discrete-Time Dynamic Graphs (DTDG)

The graph is observed as a sequence of snapshots:

G = {G_1, G_2, ..., G_T} where G_t = (V_t, E_t, X_t)

Each snapshot G_t is a full graph at time t. Between snapshots, changes are not tracked โ€” only the state at each observation.

Modelling approach: run a GNN on each snapshot, then apply a temporal model (RNN/Transformer) across snapshots to capture evolution.

Examples:

  • Monthly snapshots of a social network
  • Daily transaction graphs in finance
  • Hourly traffic sensor graphs

Limitation: if events happen between snapshots, they are invisible. Finer snapshots increase resolution but increase computation.

Continuous-Time Dynamic Graphs (CTDG)

The graph is a stream of timestamped events:

E = {(u_i, v_i, t_i, f_i)}_{i=1}^{N}

Where each event is an edge (u_i, v_i) occurring at time t_i with optional features f_i. Nodes may also have state updates at specific times.

Modelling approach: maintain a memory state for each node, updated upon each interaction. Compute node embeddings on demand for any time t.

Examples:

  • Reddit posts (user posts to subreddit at timestamp)
  • Wikipedia edits (user edits page at timestamp)
  • E-commerce interactions (user clicks product at time)

Advantage over snapshots: exact timing information preserved; computation triggered by events (sparse updates).

Key Challenges

1. Evolving Structure

New edges and nodes arrive continuously. The model must incorporate new information without full retraining:

  • Transductive: all nodes known at training time
  • Inductive: new nodes appear at test time (requires generalising to unseen entities)

2. Temporal Dependencies

Events at time t may depend on events at t-k (historical context). Capturing long-range temporal dependencies while maintaining efficient updates is the core challenge.

3. Forgetting and Recency

Not all past events are equally relevant. A social interaction from 3 years ago matters less than one from last week. Models must balance memory capacity with relevance weighting.

The memory bottleneck: Naive CTDG models replay all past events to compute current node states โ€” O(history) per query. TGN and similar architectures solve this with fixed-size memory modules that summarise history efficiently, analogous to how LSTMs summarise sequence history in a fixed hidden state.

Visualising DTDG vs CTDG

DTDG: Discrete Snapshots Gโ‚ Gโ‚‚ Gโ‚ƒ gap: events lost t=1 t=2 t=3 CTDG: Event Stream t=1.2 t=1.7 t=3.1 t=3.9 t=5.5 t=6.2 edge add edge remove Exact timestamps โ€” no information lost
DTDG (left) collapses events between snapshots into a single state โ€” fine for monthly data, but events between snapshots vanish. CTDG (right) records every event with its exact timestamp, preserving full temporal resolution at the cost of more complex modelling.

DTDG vs CTDG: Practical Trade-offs

PropertyDTDG (Snapshots)CTDG (Event Stream)
Temporal resolutionCoarse (snapshot intervals)Fine (exact timestamps)
Modelling complexityGNN + sequence modelEvent-driven memory
ComputationPer snapshot (batched)Per event (online)
Handles new nodesRetrain or fine-tuneNaturally inductive
Memory of historyImplicit in sequence modelExplicit memory module
Use casesRegular-interval dataIrregular event data

Standard Benchmarks

CTDG benchmarks:

  • Wikipedia: 9227 nodes, 157474 interaction events
  • Reddit: 10984 nodes, 672447 interaction events
  • MOOC: student-course interactions with timestamps
  • LastFM: user-song interactions (music streaming)

DTDG benchmarks:

  • Bitcoin-OTC / Bitcoin-Alpha: trust ratings over time
  • DBLP co-authorship: yearly snapshots
  • Yelp reviews: monthly snapshots

Summary

ConceptDefinition
Static graphFixed (V, E, X) โ€” standard GNN setting
Snapshot graphSeries G_1, โ€ฆ, G_T of static graphs
Event streamOrdered sequence of timestamped interactions
InductiveGeneralises to nodes not seen during training
Memory moduleFixed-size state capturing interaction history

Dynamic graph learning adds the temporal dimension to all GNN tasks: link prediction becomes โ€œwill u and v interact in the future?โ€, node classification becomes โ€œwhat is vโ€™s state now?โ€, and graph-level tasks must account for structural evolution. The field is rapidly developing, with TGN as the current dominant framework for CTDG.

References