Abstract
DynamicGEM is an open-source Python library for learning node representations of dynamic graphs. It consists of state-of-the-art algorithms for defining embeddings of nodes whose connections evolve over time. The library also contains the evaluation framework for four downstream tasks on the network: graph reconstruction, static and temporal link prediction, node classification, and temporal visualization. We have implemented various metrics to evaluate the state-of-the-art methods, and examples of evolving networks from various domains. We have easy-to-use functions to call and evaluate the methods and have extensive usage documentation. Furthermore, DynamicGEM provides a template to add new algorithms with ease to facilitate further research on the topic.
Introduction
In the real world, graphs are rarely static. Social networks gain and lose friends, citation networks grow, and biological pathways shift. Traditional graph embedding methods (like Node2Vec or DeepWalk) typically treat a graph as a single, frozen snapshot. To handle changes, one would traditionally have to re-run the entire embedding process from scratch for every new time step, which is computationally expensive and often fails to capture the "trajectory" of how nodes move.
DynamicGEM is an open-source Python library designed to bring "temporal awareness" to graph embeddings. By providing a unified framework for state-of-the-art dynamic graph embedding algorithms and evaluation metrics, it allows researchers to efficiently model and visualize how networks evolve over time.
Methods
DynamicGEM acts as a "one-stop shop" for dynamic graph embedding, implementing several classes of algorithms:
- SVD-Based Methods: These include Optimal SVD, Incremental SVD (which uses perturbation matrices to update embeddings without a full restart), and Rerun SVD (which balances efficiency and accuracy by restarting calculations only when a tolerance threshold is met).
- Structural Patterns: Dynamic TRIAD models the "triadic closure" process—the idea that if two people have a common friend, they are likely to become friends later—to preserve both structural and evolutionary patterns.
- Deep Learning Approaches:
- dynGEM: Uses deep auto-encoders to incrementally generate embeddings for new snapshots.
- AEalign: Uses auto-encoders combined with a rotation matrix to align embeddings across different time steps.
- dyngraph2vec (AE, RNN, and AERNN): A family of methods that use LSTMs (Long Short-Term Memory networks) to learn the underlying "velocity" of network changes, allowing the model to capture complex temporal dynamics.
Datasets and Evaluation
The library includes both synthetic and real-world data generators, such as Dynamic Stochastic Block Models (SBM), where communities diminish or migrate over time. By providing a template for four specific tasks—graph reconstruction, link prediction (static and temporal), node classification, and visualization—the library ensures that new algorithms are tested on a level playing field.
Key Results
The primary contribution of DynamicGEM is the standardization of dynamic embedding workflows. A compelling qualitative result is achieved using the dyngraph2vecRNN model on a migrating SBM dataset.
As shown in the figure above, as nodes migrate from one community to another, the RNN-based embedding is able to "anticipate" this movement. Because it learns the temporal trend (the "velocity" of change), it embeds the migrating nodes closer to their future destination even before the migration is complete, outperforming methods that only look at the current snapshot.
Conclusion
DynamicGEM addresses a major gap in the graph representation learning community by providing a centralized toolkit for temporal embeddings. While the current version focuses on discrete time snapshots, the library's template-based design encourages future contributions, including methods for continuous-time dynamic graphs where edges appear and disappear at specific timestamps.
Summary updated