Learning Time-Aware Graph Structures for Spatially Correlated Time Series Forecasting

Minbo Ma, Jilin Hu, Christian S. Jensen, Fei Teng, Peng Han, Zhiqiang Xu, Tianrui Li

Abstract

Spatio-temporal forecasting is critical for urban management, yet current Graph Neural Network (GNN) approaches often rely on static or heuristically learned graph structures. These methods fail to capture the dynamic, periodic nature of spatial correlations—such as the shifting relationships between business and residential districts during rush hours. This paper presents the Time-aware Graph Convolutional Recurrent Network (TGCRN), a framework that explicitly models time-varying graph topologies. By leveraging time-aware graph structure learning and contrastive time discrepancy learning, TGCRN achieves significant accuracy improvements across diverse real-world datasets, including metro traffic and electricity demand.

Introduction

In spatio-temporal forecasting, GNNs treat sensors or stations as nodes and their relationships as edges. While effective, most existing models assume these relationships are either static or "self-learning" without explicit temporal awareness. However, real-world spatial correlations are inherently dynamic and regular. For instance, two subway stations may be highly correlated during morning commutes but decoupled at night.

Spatial periodicity and trends in passenger flow across different days and times.

As shown in the figure above, passenger flow patterns exhibit distinct spatial periodicity (weekdays vs. weekends) and spatial trends (hourly shifts). Existing models often fail to distinguish these predictable shifts, leading to suboptimal forecasting performance.

Methods

The proposed TGCRN framework addresses these limitations through four key components:

  1. Time-aware Graph Structure Learning (TagSL): Unlike traditional methods that learn a single adjacency matrix, TagSL generates a unique graph for every time step by blending node embeddings with time embeddings. This allows the graph topology to evolve dynamically with the clock.
  2. Time Discrepancy Learning: To ensure the model respects the linear flow of time, a contrastive learning approach with distance-based regularization is employed. This forces the model to learn that temporally adjacent states (e.g., 8:00 AM and 8:15 AM) should have more similar spatial structures than distant ones.
  3. Periodic Discriminant Function: This module identifies periodic patterns by analyzing the current state of nodes, helping the model differentiate between "rhythms" like weekdays and weekends.
  4. GCGRU Architecture: These time-aware graphs are integrated into a Graph Convolution-based Gated Recurrent Unit (GCGRU) within an encoder-decoder architecture for robust multi-step forecasting.
Comparison between a standard self-learning graph and the proposed time-aware graph structure.

The figure above illustrates how TGCRN moves beyond a simple similarity metric to incorporate time representations and periodic discriminants into the graph generation process.

Evaluation and Results

The model was evaluated on five large-scale datasets: HZMetro, SHMetro, NYC-Bike, NYC-Taxi, and Electricity. To rigorously test robustness, the authors re-split the HZMetro dataset to ensure training and testing sets contained distinct traffic patterns (e.g., training on weekdays and testing on weekends).

Key Findings

  • Superior Accuracy: TGCRN consistently outperformed 13 baselines. On the HZMetro dataset, it achieved a 10.95% improvement in MAE and a 14.16% improvement in RMSE over the best existing models.
  • Horizon Stability: The performance gap widened as the forecasting horizon increased, indicating that TGCRN better captures the long-term underlying dynamics of the system.
  • Interpretability: t-SNE visualizations of the learned time embeddings revealed a clear chronological loop, confirming that the model successfully internalizes daily periodic cycles.

Conclusion

TGCRN demonstrates that time should not just be a feature on a graph, but a primary factor defining the graph's topology. While the model introduces higher computational costs due to its per-step graph recalculation (~16M parameters), its significant accuracy gains make it a powerful tool for complex forecasting tasks. Future research will explore adaptive inference techniques to reduce computational overhead by updating graph structures only when significant system changes occur.

Summary updated

BibTeX
@inproceedings{ma2023learning,
  author = {Minbo Ma and Jilin Hu and Christian S. Jensen and Fei Teng and Peng Han and Zhiqiang Xu and Tianrui Li},
  title = {{Learning Time-Aware Graph Structures for Spatially Correlated Time Series Forecasting}},
  booktitle = {ICDE},
  year = {2023},
}
Figure