Submitted:
06 August 2025
Posted:
07 August 2025
You are already at the latest version
Abstract
Keywords:
1. Introduction
- Innovative STC Injection Mechanism: We propose a method to organically integrate STC properties into the Graph Neural Network training process, enabling the model to learn to distinguish between strong and weak connections, thereby more accurately characterizing community structures.
- Prompt-based Few-Shot Learning Framework: We design a parameter-efficient prompt learning framework that enables the model to extract key features from a small number of labeled communities and apply this knowledge to identify unlabeled similar communities.
- End-to-end Community Detection System: We implement a complete pipeline from pre-training and prompt learning to final community prediction, providing a practical solution for real-world applications.
2. Related Work
2.1. Community Detection Algorithms
2.2. Triadic Closure Principle and Its Applications in Network Analysis
3. Problem Definition and Preliminaries
3.1. Community Detection
3.2. Strong Triadic Closure (STC)
4. STC-CDP: The Proposed Approach
4.1. Edge Labeling Using STC
4.1.1. Graph-Theoretic Modeling of the STC Problem
- , where each edge e in the original graph is mapped to a vertex in the wedge graph
4.1.2. STC Solution Based on Minimum Vertex Cover
| Algorithm 1 Wedge Graph-based STC Edge Labeling Algorithm |
|
4.2. STC-Enhanced Contrastive Learning Pre-training
4.2.1. STC-Based Representation Learning Framework
- Node-level Contrastive Learning: Learns the consistency between node representations and their corresponding community representations.
- Community-level Contrastive Learning: Learns the consistency between the original community structure and the perturbed community structure, where the perturbation retains strong edges and preferentially removes weak edges.
4.2.2. STC-Guided Contrastive Learning
4.2.3. Edge Prediction Auxiliary Task
| Algorithm 2 STC-based Graph Pre-training Algorithm |
|
4.3. Prompt Learning and Knowledge Transfer
4.3.1. Prompt Function Design
4.3.2. Edge Weight-Aware K-EGO Network Construction
4.3.3. Training Strategy with Positive-Negative Sample Balancing
- Positive samples:
- Negative samples:
4.3.4. Community Prediction Process
5. Experiments
5.1. Experimental Setup
5.1.1. Datasets
5.1.2. Baseline Methods
5.1.3. Evaluation Metrics
5.1.4. Implementation Details
5.2. Experimental Results and Analysis
5.2.1. Overall Performance Comparison (RQ1)
5.2.2. Ablation Study (RQ2)
5.2.3. Parameter Sensitivity Analysis (RQ3)
5.2.4. Computational Efficiency Analysis (RQ4)
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
| STC | Strong Triadic Closure |
| CDP | Community Detection with Prompt |
| GNN | Graph Neural Network |
| MLP | Multi-Layer Perceptron |
References
- Yang, H.; Li, B.; Cheng, F.; Zhou, P.; Cao, R.; Zhang, L. A Node Classification-Based Multiobjective Evolutionary Algorithm for Community Detection in Complex Networks. IEEE Trans. Comput. Soc. Syst. 2024, 11, 292–306. [Google Scholar] [CrossRef]
- Li, B.; Kamuhanda, D.; He, K. Centroid-Based Multiple Local Community Detection. IEEE Trans. Comput. Soc. Syst. 2024, 11, 455–464. [Google Scholar] [CrossRef]
- Ni, L.; Li, Q.; Zhang, Y.; Luo, W.; Sheng, V.S. Local Community Detection in Multi-Attributed Road-Social Networks. IEEE Trans. Knowl. Data Eng. 2025, 37, 3514–3527. [Google Scholar] [CrossRef]
- Ding, X.; Mittal, A.; Gopal, A. DELPHYNE: A Pre-Trained Model for General and Financial Time Series. arXiv 2025, arXiv:2506.06288 2025. [Google Scholar]
- Wu, X.; Xiong, Y.; Zhang, Y.; Jiao, Y.; Zhang, J.; Zhu, Y.; Yu, P.S. ConsRec: Learning Consensus Behind Interactions for Group Recommendation. Proceedings of the ACM Web Conference 2023 2023, 240–250. [Google Scholar]
- Fionda, V.; Pirrò, G. Community deception in attributed networks. IEEE Trans. Comput. Soc. Syst. 2022, 11, 228–237. [Google Scholar] [CrossRef]
- Madi, S.A.; Pirrò, G. Node-centric community deception based on safeness. IEEE Trans. Comput. Soc. Syst. 2023, 11, 2955–2965. [Google Scholar] [CrossRef]
- Li, Q.; Zhu, Y.; Ye, J.; Yu, J.X. Skyline group queries in large road-social networks revisited. IEEE Transactions on Knowledge and Data Engineering 2021, 35, 3115–3129. [Google Scholar] [CrossRef]
- Xin, X.; Wang, C.; Ying, X.; Wang, B. Deep community detection in topologically incomplete networks. Physica A 2017, 469, 342–352. [Google Scholar] [CrossRef]
- Wu, Z.; Pan, S.; Chen, F.; Long, G.; Zhang, C.; Yu, P.S. A comprehensive survey on graph neural networks. IEEE Trans. Neural Netw. Learn. Syst. 2020, 32, 4–24. [Google Scholar] [CrossRef]
- Onnela, J.P.; Saramäki, J.; Hyvönen, J.; Szabó, G.; Lazer, D.; Kaski, K.; Kertész, J.; Barabási, A.L. Structure and tie strengths in mobile communication networks. Proc. Natl. Acad. Sci. USA 2007, 104, 7332–7336. [Google Scholar] [CrossRef]
- Dunbar, R.I.M. Do online social media cut through the constraints that limit the size of offline social networks? R. Soc. Open Sci. 2016, 3, 150292. [Google Scholar] [CrossRef]
- Wu, X.; Xiong, K.; Xiong, Y.; He, X.; Zhang, Y.; Jiao, Y.; Zhang, J. ProCom: A Few-shot Targeted Community Detection Algorithm. Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining 2024, 3414–3424. [Google Scholar]
- Perozzi, B.; Al-Rfou, R.; Skiena, S. Deepwalk: Online learning of social representations. Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining 2014, 701–710. [Google Scholar]
- Li, Y.; King, I. Autograph: Automated graph neural network. Neural Information Processing: 27th International Conference, ICONIP 2020 2020, 189–01. [Google Scholar]
- Bianconi, G.; Darst, R.K.; Iacovacci, J.; Fortunato, S. Triadic closure as a basic generating mechanism of communities in complex networks. Phys. Rev. E 2014, 90, 042806. [Google Scholar] [CrossRef]
- Easley, D.; Kleinberg, J. Networks, crowds, and markets: Reasoning about a highly connected world; Cambridge University Press: Cambridge, UK, 2010. [Google Scholar]
- Granovetter, M.S. The strength of weak ties. Am. J. Sociol. 1973, 78, 1360–1380. [Google Scholar] [CrossRef]
- Burt, R.S. Structural holes and good ideas. Am. J. Sociol. 2004, 110, 349–399. [Google Scholar] [CrossRef]
- Blondel, V.D.; Guillaume, J.L.; Lambiotte, R.; Lefebvre, E. Fast unfolding of communities in large networks. J. Stat. Mech. Theory Exp. 2008, 2008, P10008. [Google Scholar] [CrossRef]
- Girvan, M.; Newman, M.E.J. Community structure in social and biological networks. Proc. Natl. Acad. Sci. USA 2002, 99, 7821–7826. [Google Scholar] [CrossRef]
- Rashnodi, O.; Rastegarpour, M.; Moradi, P.; Zamanifar, A. Community detection in attributed social networks using deep learning. J. Supercomput. 2024, 80, 25933–25973. [Google Scholar] [CrossRef]
- Xiong, K.; Jin, Y.; Xiong, Y.; Zhang, J. GetCom: An Efficient and Generalizable Framework for Community Detection. Proceedings of the 33rd ACM International Conference on Information and Knowledge Management 2024, 2650–2659. [Google Scholar]
- Fortunato, S.; Hric, D. Community detection in networks: A user guide. Phys. Rep. 2016, 659, 1–44. [Google Scholar] [CrossRef]
- Ji, J.; Feng, S.; Li, Y. Tensorized Unaligned Multi-view Clustering with Multi-scale Representation Learning. Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining 2024, 1246–1256. [Google Scholar]
- Li, J.; Lai, S.; Shuai, Z.; Tan, Y.; Jia, Y.; Yu, M.; Lu, Y. A comprehensive review of community detection in graphs. Neurocomputing 2024, 128169. [Google Scholar] [CrossRef]
- Wu, X.; Lu, W.; Quan, Y.; Miao, Q.; Sun, P.G. Deep dual graph attention auto-encoder for community detection. Expert Syst. Appl. 2024, 238, 122182. [Google Scholar] [CrossRef]
- Kojaku, S.; Radicchi, F.; Ahn, Y.Y.; Fortunato, S. Network community detection via neural embeddings. Nat. Commun. 2024, 15, 9446. [Google Scholar] [CrossRef]
- Huang, D.; Song, J.; He, Y. Community detection algorithm for social network based on node intimacy and graph embedding model. Eng. Appl. Artif. Intell. 2024, 132, 107947. [Google Scholar] [CrossRef]
- Gmati, H.; Mouakher, A.; Gonzalez-Pardo, A.; Camacho, D. A new algorithm for communities detection in social networks with node attributes. J. Ambient Intell. Humaniz. Comput. 2024, 1–13. [Google Scholar] [CrossRef]
- Zhao, Y.; Li, W.; Liu, F.; Wang, J.; Luvembe, A.M. Integrating heterogeneous structures and community semantics for unsupervised community detection in heterogeneous networks. Expert Syst. Appl. 2024, 238, 121821. [Google Scholar] [CrossRef]
- Liu, X.; Zhang, M.; Liu, Y.; Liu, C.; Li, C.; Wang, W.; Bouyer, A. Semi-supervised community detection method based on generative adversarial networks. J. King Saud Univ. Comput. Inf. Sci. 2024, 36, 102008. [Google Scholar] [CrossRef]
- Momenzadeh, S.; Mohammadiani, R.P. Community Detection by ELPMeans: An Unsupervised Approach That Uses Laplacian Centrality and Clustering. arXiv 2025. [Google Scholar] [CrossRef]
- Zhang, Y.; Xiong, Y.; Ye, Y.; Liu, T.; Wang, W.; Zhu, Y.; Yu, P.S. SEAL: Learning heuristics for community detection with generative adversarial networks. Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining 2020, 1103–1113. [Google Scholar]
- Wu, X.; Xiong, Y.; Zhang, Y.; Jiao, Y.; Shan, C.; Sun, Y.; Yu, P.S. CLARE: A semi-supervised community detection algorithm. Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining 2022, 2059–2069. [Google Scholar]
- Sintos, S.; Tsaparas, P. Using strong triadic closure to characterize ties in social networks. Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining 2014, 1466–1475. [Google Scholar]
- Tsourakakis, C.E.; Pachocki, J.; Mitzenmacher, M. Scalable motif-aware graph clustering. Proceedings of the 26th International Conference on World Wide Web 2017, 1451–1460. [Google Scholar]
- Arachchi, C.W.; Kumpulainen, I.; Tatti, N. Dense Subgraph Discovery Meets Strong Triadic Closure. arXiv 2025. [Google Scholar] [CrossRef]
- Shang, K.; Yi, J.; Small, M.; Zhou, Y. Triadic Closure-Heterogeneity-Harmony GCN for Link Prediction. arXiv 2025, arXiv:2504.20492 2025. [Google Scholar]



| Datasets | Nodes | Edges | # | |
|---|---|---|---|---|
| Amazon | 13,178 | 33,767 | 4,517 | 9.31 |
| DBLP | 114,095 | 466,761 | 4,559 | 8.4 |
| 87,760 | 1,293,985 | 2,838 | 10.88 | |
| Youtube | 216,544 | 1,393,206 | 2,865 | 7.67 |
| Livejournal | 316,606 | 4,945,140 | 4,510 | 17.65 |
| Component | Hyper-parameter | Value |
|---|---|---|
| Encoding | Batch size | 256 |
| Number of epochs | 30 | |
| Learning rate | 1e-3 | |
| Implementation of | 2 layers GCN | |
| k-ego subgraph | 2 | |
| Embedding dimension | 128 | |
| Temperature | 0.1 | |
| Ratio for corruption | 0.85 | |
| Loss weight | 1 | |
| Sampling | Batch size | 32 |
| Number of epochs | 100 | |
| Embedding dimension | 64 | |
| MLP layers | 3 | |
| LGPNs layers | 3 | |
| Learning rate | 1e-2 | |
| Discount factor | 1 | |
| Fine-tuning | Implementation of | 2 layers MLP |
| Number of epochs | 30 | |
| Learning rate | 1e-3 | |
| k-ego subgraph | 3 | |
| Number of prompts m | 20 | |
| Threshold value | 0.2 |
| Method | Amazon | DBLP | Livejournal | ||
|---|---|---|---|---|---|
| SEAL | / | / | / | / | / |
| CLARE | / | / | / | / | / |
| ProCom | / | / | / | / | / |
| STC-CDP (Ours) | / | / | / | / | / |
| Variant | Amazon | DBLP | Livejournal | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| F1 | Jaccard | F1 | Jaccard | F1 | Jaccard | F1 | Jaccard | F1 | Jaccard | |
| Basic GNN | 33.8 | 24.1 | 83.3 | 74.8 | 45.7 | 35.3 | 41.5 | 33.6 | 27.0 | 18.0 |
| GNN+STC | 34.3 | 24.7 | 83.5 | 74.9 | 47.3 | 36.8 | 47.0 | 38.6 | 29.5 | 19.7 |
| GNN + Prompt Learning | 38.8 | 28.2 | 84.3 | 75.9 | 51.4 | 40.2 | 54.0 | 44.6 | 31.1 | 20.8 |
| STC-CDP (Full Model) | 39.5 | 29.1 | 85.1 | 76.5 | 57.4 | 46.3 | 55.0 | 44.7 | 31.9 | 21.5 |
| Method | Amazon | DBLP | Livejournal | ||
|---|---|---|---|---|---|
| SEAL | 2h27m | 1h3m | 50m | 3h35m | 2h28m |
| CLARE | 275s | 529s | 22m | 832s | 36m |
| ProCom | 30s | 144s | 367s | 260s | 446s |
| STC-CDP (Ours) | 82s | 275s | 706s | 818s | 635s |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).