CLGNN: A Contrastive Learning-based GNN Model for Betweenness Centrality Prediction on Temporal Graphs

Tianming Zhang, Renbo Zhang, Zhengyi Yang, Yunjun Gao, Bin Cao, Jing FanarXiv 2025 · OpenReview

Abstract

Temporal Betweenness Centrality (TBC) measures how often a node appears on optimal temporal paths, reflecting its importance in temporal networks. However, exact computation is highly expensive, and real-world TBC distributions are extremely imbalanced. The severe imbalance leads learning-based models to overfit to zero-centrality nodes, resulting in inaccurate TBC predictions and failure to identify truly central nodes. Existing graph neural network (GNN) methods either fail to handle such imbalance or ignore temporal dependencies altogether. To address these issues, we propose a scalable and inductive contrastive learning-based GNN (CLGNN) for accurate and efficient TBC prediction. CLGNN builds an instance graph to preserve path validity and temporal order, then encodes structural and temporal features using dual aggregation, i.e., mean and edge-to-node multi-head attention mechanisms, enhanced by temporal path count and time encodings. A stability-based clustering-guided contrastive module (KContrastNet) is introduced to separate high-, median-, and low-centrality nodes in representation space, mitigating class imbalance, while a regression module (ValueNet) estimates TBC values. CLGNN also supports multiple optimal path definitions to accommodate diverse temporal semantics. Extensive experiments demonstrate the effectiveness and efficiency of CLGNN across diverse benchmarks. CLGNN achieves up to a 663.7× speedup compared to state-of-the-art exact TBC computation methods. It outperforms leading static GNN baselines with up to 31.4× lower MAE and 16.7× higher Spearman correlation, and surpasses state-of-the-art temporal GNNs with up to 5.7× lower MAE and 3.9× higher Spearman correlation.

Introduction: The Challenge of Temporal Centrality

In dynamic networks—ranging from social interactions to communication systems—identifying influential nodes is crucial for understanding information flow and system vulnerabilities. Temporal Betweenness Centrality (TBC) is a fundamental metric that quantifies a node's importance based on its presence on optimal temporal paths. However, computing exact TBC is computationally prohibitive for large-scale, fast-moving graphs.

A significant hurdle in applying machine learning to this task is the extreme class imbalance inherent in real-world TBC distributions. As shown in Figure 2, the vast majority of nodes (often over 96%) have zero centrality. Standard Graph Neural Networks (GNNs) tend to overfit to these zero-value nodes, taking a "shortcut" by predicting low values for all nodes and failing to distinguish the rare, critical "hub" nodes.

Figure 2: Distribution of Temporal Betweenness Centrality (TBC) values in a typical dataset, highlighting the extreme imbalance where 96.20% of nodes have zero centrality.

The CLGNN Framework

To address these challenges, the authors propose CLGNN (Contrastive Learning-based GNN), a scalable and inductive framework. CLGNN integrates structural and temporal features through a sophisticated architecture designed to handle both temporal dynamics and data imbalance.

The model consists of two primary components:

  1. Representation Module: This module constructs an instance graph to maintain path validity and temporal order. It employs a Path-Time Dual-Aware mechanism, utilizing continuous time encoding and a novel temporal path count encoding to capture the temporal context and the volume of reachable paths.
  2. Prediction Module: The core innovation is KContrastNet, a contrastive learning module. It uses stability-based clustering to group nodes into high-, median-, and low-centrality categories. By applying a contrastive loss, it forces the model to separate these categories in the embedding space, preventing the dominant zero-value nodes from overwhelming the learning process. A regression head, ValueNet, then estimates the final TBC values.
Figure 4: The complete CLGNN architecture, featuring the Representation Module with dual-aware mechanisms and the Prediction Module with KContrastNet for contrastive learning.

Experimental Evaluation

CLGNN was evaluated against 12 real-world temporal datasets representing diverse human and digital interactions. The results demonstrate significant improvements over both static and temporal GNN baselines:

  • Massive Speedup: CLGNN achieves up to a 663.7× speedup compared to exact TBC computation methods, making it viable for large-scale applications.
  • Superior Accuracy: It reduces Mean Absolute Error (MAE) by up to 31.4× compared to static GNNs and 5.7× compared to state-of-the-art temporal GNNs.
  • Robust Ranking: The model achieves significantly higher Spearman correlation scores (up to 16.7× higher than static baselines), indicating its superior ability to correctly rank node importance across the network.

Conclusion

CLGNN effectively bridges the gap between the computational complexity of exact TBC and the limitations of standard GNNs on imbalanced temporal data. By leveraging contrastive learning and dual-aware feature encoding, it provides a robust and efficient solution for identifying critical hubs in time-varying networks. Future work may explore more advanced temporal graph augmentation techniques and extend the framework to other complex temporal centrality measures like Closeness or PageRank.

Summary updated

BibTeX
@misc{zhang2025clgnn,
  author = {Tianming Zhang and Renbo Zhang and Zhengyi Yang and Yunjun Gao and Bin Cao and Jing Fan},
  title = {{CLGNN: A Contrastive Learning-based GNN Model for Betweenness Centrality Prediction on Temporal Graphs}},
  year = {2025},
  eprint = {2506.14122},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.14122},
}
Figure