Comparing temporal graphs using dynamic time warping

Vincent Froese, Brijnesh J. Jain, Rolf Niedermeier, Malte Renken

TL;DR

This paper introduces Dynamic Temporal Graph Warping (dtgw), a novel proximity measure for comparing graphs that evolve over time. By merging graph matching with time-series "warping" techniques, the authors create a robust framework that can identify similarities between temporal networks even when they progress at different speeds or vary in duration.

What Problem Does This Paper Address?

In the real world, networks are rarely static. Social contacts, disease outbreaks, and protein interactions are all "temporal graphs"—collections of nodes where the edges appear and disappear over time.

The challenge lies in pattern recognition: how do we mathematically determine if two temporal networks are "similar"? Standard graph comparison tools usually focus on static snapshots, ignoring the time dimension. Conversely, time-series tools like Dynamic Time Warping (DTW) are great at handling temporal shifts (e.g., one process running faster than another) but aren't designed for the complex structural relationships found in graphs.

The authors aim to bridge this gap by creating a measure that is flexible enough to handle "temporal distortion" while maintaining a consistent mapping between the individuals (nodes) in the networks.

Methods

The core contribution is the dtgw-distance. It is defined as a twofold discrete minimization problem:

  1. Vertex Mapping: Finding the best way to match nodes in Graph A to nodes in Graph B.
  2. Warping Path: Finding the optimal alignment of time layers between the two graphs.

To make this computationally tractable, the authors use vertex signatures (local features like a node's degree) to calculate the cost of mapping one node to another.

Because the authors prove that finding the optimal dtgw is NP-hard (specifically because the node mapping must remain consistent across all time steps), they propose two implementation paths:

  • Exact Solution: A Quadratic Programming (QP) formulation for small-scale problems.
  • Heuristic (Alternating Minimization): An efficient algorithm that alternates between fixing the node mapping to find the best warping path, and fixing the warping path to find the best node mapping. This continues until the solution converges.

Datasets

The researchers evaluated their approach using real-world data from the SocioPatterns project, which records face-to-face and spatial proximity contacts:

  • LyonSchool: Contacts among 237 individuals in a primary school (1,700 time layers).
  • SFHH: Contacts among 403 attendees at a scientific conference (2,300 time layers).
  • InVS15: Contacts among 180 office workers (2,100 time layers).

They also generated "noisy," "shifted," and "randomized" versions of these datasets to test how well the algorithm could handle temporal delays and data corruption.

Key Insights and Ideas

  • The Consistency Constraint: The "aha moment" of the paper is the realization that while time can be warped, the identity of the nodes cannot. By forcing the node mapping to be consistent across the entire warping path, the measure becomes a powerful tool for de-anonymization (identifying the same person across different datasets).
  • Robustness to "Speed": Because it uses DTW, the measure doesn't break if one network's events are delayed or stretched out. This makes it uniquely suited for biological or social processes that naturally vary in tempo.
  • Heuristic Efficiency: The alternating minimization (AM) heuristic is surprisingly effective. It typically converges in just a few iterations, making it practical for networks that are far too large for exact solvers.

Key Results

  • Speedup: The AM heuristic was over 10,000 times faster than the exact QP solver. While the QP solver took minutes or hours for small samples, the heuristic finished in less than 0.01 seconds.
  • Accuracy: In de-anonymization tests on the conference dataset, dtgw correctly re-identified up to 86% of vertices.
  • Superiority in Noise: When tested against "shifted" data (where one graph's events were delayed), dtgw maintained its high accuracy, whereas competing methods like DynaMAGNA++ and HTNE saw their performance drop significantly.
  • Clustering: The measure successfully clustered noisy versions of temporal graphs back to their original sources, outperforming non-temporal baselines.

Limitations and Future Work

  • Computational Complexity: Despite the heuristic, the underlying problem remains NP-hard. Scaling to massive networks with millions of nodes remains a challenge.
  • Signature Sensitivity: The results depend heavily on the choice of vertex signatures. While "vertex degree" worked well here, more complex signatures might be needed for different types of data.
  • Data Scarcity: The authors noted a lack of publicly available temporal molecular data (like chemical reaction networks), which limited their ability to test the measure in biological domains.
  • Future Directions: The authors suggest applying dtgw to analyze the learning process of neural networks (viewed as temporal graphs) or analyzing strategies in team sports data.

Summary updated

BibTeX
@inproceedings{froese2020comparing,
  author = {Vincent Froese and Brijnesh J. Jain and Rolf Niedermeier and Malte Renken},
  title = {{Comparing temporal graphs using dynamic time warping}},
  booktitle = {Soc. Netw. Anal. Min},
  year = {2020},
  url = {https://openreview.net/forum?id=lG1gqoisDR},
}

Loading related content...

Figure