arXiv:2608.28342cs.SIAug 2026

Manuscript Offprint

arXiv:2608.28342

Scalable dynamic community detection on temporal graphs using graph neural networks

Peijie Zhong, Raul Mondragon, Richard G. Clegg

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

PEIJIE ZHONG, Queen Mary University of London, United Kingdom

RAÚL MONDRAGÓN, Queen Mary University of London, United Kingdom

RICHARD CLEGG, Queen Mary University of London, United Kingdom

Dynamic community detection on temporal graphs seeks to identify evolving community structures while allowing node memberships to change over time. In this work, we formulate dynamic community detection over observed node-time instances, where each node-time instance in the temporal interaction stream is assigned a cluster label. We propose a diffusion-guided contrastive learning framework that uses a local temporal diffusion affinity matrix to construct positive and negative node-time pairs and organise the learned representations according to their temporal structural relationships. We then apply a clustering algorithm to the resulting embedding space to detect dynamic communities. Experiments on synthetic temporal networks show that the proposed method outperforms static community detection baselines and achieves competitive or better performance than existing dynamic community detection methods in terms of AMI and ARI, while maintaining good scalability. We further apply the method to a large-scale OpenAlex computer science collaboration network from 2016 to 2025, revealing persistent and evolving collaboration communities in real scientific data. These results suggest that time-node-level representation learning provides an effective framework for scalable dynamic community detection on temporal graphs.

CCS Concepts: • Computing methodologies → Machine learning algorithms; • Information systems → Clustering; • Mathematics of computing → Graph algorithms.

Additional Key Words and Phrases: dynamic clustering, dynamic community detection, temporal graph.

1 Introduction

Many real-world networks are inherently temporal, with interactions evolving continuously over time rather than remaining fixed. Social networks, communication systems, collaboration networks, and transaction networks are often represented as temporal graphs or link streams, where edges appear, disappear, and recur at different timestamps. In such networks, the structural role of a node may change over time. For example, as illustrated in Fig. 1 (A), a user on a social platform may initially participate in one topic group and later shift attention to other topics. This type of temporal variation suggests that assigning one fixed community label to each node over the entire observation period is often insufficient for analysing evolving temporal networks. As illustrated in Fig. 1 (B), aggregating a temporal graph into a static graph may obscure temporal changes in community structure. This motivates dynamic community detection, where the goal is to recover not only groups of related nodes, but also how these groups and node memberships evolve over time. A half-way approach is given by snapshot based methods [6, 30] which, instead of treating the network as a truly temporal network, work on an ordered series of static networks defined by time windows. Recently, Longitudinal Agglomerative Greedy Optimization (LAGO) [10] was the first genuinely dynamic community detection method. It introduces the concept of a node-time set which defines the community for a node at each point in time where it interacts with another node. However, the scaling behaviour of LAGO is poor and it struggles with real-world network sizes.

Authors' Contact Information: Peijie Zhong, Queen Mary University of London, London, United Kingdom, p.zhong@qmul.ac.uk; Raúl Mondragón, Queen Mary University of London, London, United Kingdom, r.j.mondragon@qmul.ac.uk; Richard Clegg, Queen Mary University of London, London, United Kingdom, r.clegg@qmul.ac.uk.

  1. ACM 1556-472X/2026/8-ART0 https://doi.org/

0:2

Zhong et al.

(A)

Figure

Figure

Link stream

Time

The aggregate static graph

(B)

Fig. 1. (A) demonstrates the phenomenon of user interest drift on a social platform. Users' interests may change over time, leading to evolving community membership. (B) aggregating a link stream into a static graph may obscure temporal changes in community structure.

This paper is the first to demonstrate a method that can provide truly dynamic community detection in large-scale temporal networks. Unlike LAGO [10], which directly optimises community assignments over the node-time set, our method uses a learning-based framework to make dynamic community detection more scalable on large temporal networks. We validate the method by using synthetic networks with a known ground-truth and demonstrate that we can recover the ground truth partitions. We compare our method with LAGO [10], static methods [7, 23, 33] and snapshot-based dynamic methods [6, 30] demonstrating that we better match the ground truth. We measure the quality of detected dynamic community structure using adjusted mutual information (AMI) [16, 45] and adjusted Rand index (ARI) [20, 39], two established metrics that can compare community assignments that change in time. We also demonstrate that we scale better in terms of run-time as network size increases (the only algorithm with comparable run-time scaling has much worse performance against the ground truth). We demonstrate the utility of our algorithm on real-world datasets by running it on a large-scale network of computer science collaborations known as OpenAlex [38] and show that we can interpret how communities evolve and split as the network changes.

In order to provide truly dynamic community analysis, our method needs to keep the fine temporal resolution of link streams while simultaneously remaining scalable on large networks. To this end, we introduce a graph representation learning framework for dynamic community detection. Instead of assigning one label to each node, the proposed framework assigns a community label to each node-time instance, by which we mean an observed occurrence of a node at a particular timestamp in the link stream. In this way, the same node can receive different community labels when it appears in different temporal interaction contexts. This allows the same node to belong to different communities at different timestamps. To improve scalability, the model learns low-dimensional node-time representations with a temporal graph encoder and optimises the objective in mini-batches, rather than directly searching over all node-time community assignments. To learn representations tailored to dynamic community detection, we introduce a diffusion-guided contrastive learning framework. At each timestamp, a local temporal diffusion affinity matrix captures the structural relationships between node-time instances and is used to construct positive and negative training pairs. The resulting contrastive objective brings structurally related instances closer while pushing unrelated ones apart, thereby embedding local temporal structure into the

0:3

NameClassificationStrategyComplexity
Louvain [7]StaticModularity maximisationO(Nlog⁡(N))O(N\log(N))
CTDNE [33]+K-MeansStaticRandom walkO(ρlNd)O(\rho lNd)
TGC [23]StaticGraph neural networkO(rE)O(rE)
MAGI [25]StaticGraph neural networkO(Nrd2)O(Nrd^2)
GenLouvain [6, 30]Window-basedModularity maximisationO(NL)O(NL)
LAGO [10]DynamicModularity maximisationO(EN2)O(EN^2)

Table 1. Comparison of representative static and dynamic clustering/community detection methods used in this study. Static clustering methods assign one fixed cluster label to each node over the whole observation period, whereas dynamic clustering methods allow node memberships to vary over time. The table summarises the main modelling strategy and asymptotic complexity of each method. Here, NN denotes the number of nodes, EE denotes the number of temporal interactions or edges, dd denotes the embedding dimension, ll denotes the random-walk length. ρ\rho denotes the number of random walks sampled per node, rr denotes the number of training epochs for graph neural networks, and LL denotes the number of layers after the temporal network is discretised into a multilayer representation.

representation space. We then apply a clustering algorithm to the embedding space produced by the trained model to detect dynamic community structures.

References (13)