Abstract
Analyzing the temporal behavior of nodes in time-varying graphs is useful for many applications such as targeted advertising, community evolution and outlier detection. In this paper, we present a novel approach, STWalk, for learning trajectory representations of nodes in temporal graphs. The proposed framework makes use of structural properties of graphs at current and previous time-steps to learn effective node trajectory representations. STWalk performs random walks on a graph at a given time step (called space-walk) as well as on graphs from past time-steps (called time-walk) to capture the spatio-temporal behavior of nodes. We propose two variants of STWalk to learn trajectory representations. In one algorithm, we perform space-walk and time-walk as part of a single step. In the other variant, we perform space-walk and time-walk separately and combine the learned representations to get the final trajectory embedding. Extensive experiments on three real-world temporal graph datasets validate the effectiveness of the learned representations when compared to three baseline methods. We also show the goodness of the learned trajectory embeddings for change point detection, as well as demonstrate that arithmetic operations on these trajectory representations yield interesting and interpretable results.
Introduction
Most graph embedding techniques, such as DeepWalk or Node2vec, are designed for static snapshots. However, real-world networks—including social media, citation indices, and sensor networks—are inherently dynamic. The primary challenge is that a node’s importance or role is not just defined by its current connections, but by its "trajectory" over time. Analyzing snapshots independently fails to capture the temporal correlation between steps. For instance, a researcher might transition from database research to AI research; a static embedding misses this transition, whereas a trajectory embedding can represent the shift itself as a feature for tasks like change-point detection or community evolution.
Methodology
The authors propose STWalk (SpaceTimeWalk), an unsupervised framework for learning trajectory representations. It leverages random walks and the SkipGram model to capture how a node’s behavior and position in a network evolve.
Two variants of the algorithm are introduced:
- STWalk1 (Unified): This method constructs a "Space-Time Graph" where a node at time $t$ is connected to its spatial neighbors at time $t$ and to itself at previous time steps ($t-1, t-2, \dots$). Random walks on this combined structure allow the walker to jump between current neighborhoods and past states.
- STWalk2 (Decoupled): This variant separates the learning process. It performs a SpaceWalk on the current graph snapshot and a TimeWalk specifically on the temporal links (the node's history). The resulting spatial and temporal embeddings are then combined, typically through vector addition.
The core innovation lies in the explicit construction of temporal "self-edges" to link graph snapshots into a single traversable space-time manifold.
Experimental Evaluation
The researchers evaluated STWalk on three real-world temporal datasets:
- DBLP: A bibliographic dataset (1969–2016) where nodes are authors and edges represent co-authorship.
- Epinion: A product review site (2002–2011) where edges connect users who reviewed products in the same category.
- Ciao: A product review dataset (2001–2011) similar to Epinion.
The primary task was classifying node trajectories (e.g., distinguishing "Expert Researcher" from "Interdisciplinary Researcher" in DBLP).
Key Results and Discussion
STWalk was compared against several baselines, including Node PageRank, Average DeepWalk, and an LSTM-AutoEncoder (LSTM-AE).
As shown in the results table, STWalk2 consistently achieved the highest accuracy across all datasets. For example, on the DBLP dataset with a window size of 5, STWalk2 achieved 78.74% accuracy, outperforming the LSTM-AE (73.89%) and PageRank (70.42%). In the CIAO dataset, STWalk showed even more significant gains, outperforming the best baseline by nearly 10-20% in certain configurations.
The authors observed that the decoupled approach (STWalk2) generally performed better than the unified one (STWalk1). This suggests that separate walks force the model to explore temporal history more thoroughly, preventing the walker from getting "trapped" in dense spatial neighborhoods. Furthermore, the trajectory embeddings exhibited linear arithmetic properties similar to Word2Vec (e.g., Interdisciplinary Author - Expert (DB) ≈ Expert (AI)), indicating they capture semantic directions of behavioral change.
Conclusion
STWalk provides a robust framework for capturing node dynamics in temporal graphs. While performance can be sensitive to the temporal window size ($\tau$), the method excels at identifying behavioral shifts and representing complex trajectories. Future work may explore more sophisticated methods for combining spatial and temporal embeddings and applying the framework to link prediction in dynamic networks.
Summary updated