A social network graph partitioning algorithm based on double deep Q-Network

Jie Cao, Haoxiang Wang, Jianxin Jiao, Kekun Hu, Ping QiScientific 2025

Abstract

With the rapid expansion of social networks, efficiently mining and analyzing massive graph data has become a fundamental challenge in social network research. Graph partitioning plays a pivotal role in enhancing the performance of such analyses. However, conventional graph partitioning methods predominantly rely on local structural information and often overlook the rich attribute information associated with vertices in social network graphs. To overcome this limitation, this paper introduces GP-DQN (Graph Partitioning via Double Deep Q-Network), a large-scale graph partitioning algorithm that jointly considers structural correlations, attribute disparities among user vertices, and partition load balancing. GP-DQN encodes partition load metrics and vertex attributes into vector representations and employs a Graph Convolutional Network (GCN) to aggregate both vertex features and neighborhood structures, thereby improving the accuracy and scalability of the partitioning process. A tailored reward function is designed to guide partitioning actions, where a Double Deep Q-Network (DDQN) predicts the expected partitioning rewards based on GCN-extracted features for assigning each vertex to different partitions. The partitioning strategy is iteratively optimized using both immediate and expected rewards, ultimately achieving balanced load distribution while minimizing the number of edge cuts. Experimental results demonstrate that GP-DQN produces well-balanced partitions with significantly fewer edge cuts, leading to enhanced computational efficiency within each partition.

1. Introduction

As social networks like WeChat and Facebook scale to billions of users, analyzing their underlying graphs becomes a massive distributed computing challenge. To process these graphs efficiently, they must be partitioned—split across multiple servers to allow for parallel computation.

Traditional partitioning methods, such as METIS or simple Hashing, face two major hurdles. First, they often focus solely on edge topology and ignore vertex attributes (e.g., user type or data volume), which are crucial for real-world load balancing. Second, finding the optimal partition that minimizes edge cuts while maintaining perfect load balance is an NP-hard problem. While Reinforcement Learning (RL) has been proposed as a solution, existing approaches often struggle with the discrete nature of vertex-to-partition assignments or fail to capture local neighborhood features effectively, leading to high overhead or poor partition quality.

2. The GP-DQN Framework

GP-DQN treats graph partitioning as a vertex-centric combinatorial optimization problem. The framework utilizes an iterative loop to refine partitioning decisions based on both structural and attribute data.

The iterative execution process of the GP-DQN algorithm.

2.1 Feature Extraction via GraphSAGE

Instead of relying purely on graph structure, the model encodes four key features into a vector for each vertex: data volume, vertex type (one-hot encoded), current partition location, and the overall load status of all partitions. A GraphSAGE (Graph Convolutional Network) layer then aggregates these features from a vertex's K-hop neighborhood, creating a high-dimensional representation of the local graph state.

2.2 Decision Making with DDQN

This representation is fed into a Double Deep Q-Network (DDQN). Unlike standard DQN, DDQN decouples action selection from evaluation, preventing the model from overestimating rewards. The network predicts a "Q-value matrix" where each entry represents the expected reward for moving a specific vertex to a specific partition.

Internal architecture of the Q-network.

The model is guided by a tailored reward function that penalizes both edge cuts and load imbalances. By adjusting a load balance coefficient ($\gamma$) and a reward balance coefficient ($\mu$), the algorithm can be tuned to prioritize either communication efficiency or computational load distribution.

3. Experimental Evaluation

The researchers evaluated GP-DQN across six diverse datasets from the Stanford Network Analysis Project (SNAP), including social networks (Facebook, NotreDame, LastFM, Twitch, GitHub) and web networks (Amazon). GP-DQN was compared against standard baselines including Hash, METIS, and the RL-based DRL-Metis.

Key insights from the evaluation include:

  • Attributes as Structural Signals: Incorporating vertex metadata allows the GCN to identify community structures that purely structural algorithms might miss.
  • Discrete Action Optimization: DDQN’s architecture is naturally suited for the discrete choice of vertex assignment, outperforming continuous-policy methods like A2C which often struggle to converge on high-quality assignments.

4. Results and Discussion

GP-DQN demonstrated superior performance across multiple metrics:

  • Partition Quality: The algorithm achieved significantly fewer edge cuts than METIS and Hash while maintaining a superior load balance compared to METIS.
  • Computational Efficiency: On the GitHub dataset, GP-DQN was 48.14 seconds faster at generating partitions than DRL-Metis.
  • Downstream Performance: When running standard graph algorithms like PageRank and Single-Source Shortest Path (SSSP) on the resulting partitions, GP-DQN led to the fastest execution times. In high-latency scenarios, PageRank on GP-DQN partitions was over 113,000 seconds faster than on METIS partitions.

5. Conclusion

GP-DQN provides a robust framework for large-scale social network partitioning by combining the feature aggregation power of GraphSAGE with the stable decision-making of DDQN. While currently focused on static graphs and homogeneous computing clusters, future work will extend the algorithm to handle real-time dynamic graph updates and adapt to heterogeneous hardware environments.

Summary updated

BibTeX
@inproceedings{cao2025social,
  author = {Jie Cao and Haoxiang Wang and Jianxin Jiao and Kekun Hu and Ping Qi},
  title = {{A social network graph partitioning algorithm based on double deep Q-Network}},
  booktitle = {Scientific},
  year = {2025},
  doi = {10.1038/s41598-025-16768-x},
}
Figure