Abstract
The identification of community structure is pivotal for understanding the functional characteristics of complex networks. To address the limitations of most existing community detection algorithms, which often require predefining the number of communities and lack robustness, this paper proposes a novel community detection algorithm named D-means (K-means community detection algorithm based on density peaks). This algorithm integrates the concept of density peak clustering with K-means spectral clustering, employing Chebyshev's inequality to automatically determine the number of community centers, thereby enabling unsupervised identification of community quantities. By designing a multi-dimensional evaluation framework, the comparative experiments were conducted on LFR benchmark networks (Lancichinetti-Fortunato-Radicchi benchmark networks) and real-world social network datasets. The results demonstrate that the D-means algorithm outperforms traditional algorithms in terms of ACC (accuracy), ARI (adjusted rand index), and NMI (normalized mutual information) metrics, while also achieving improvements in runtime efficiency, showcasing strong robustness. Finally, the D-means algorithm was applied to the public transportation network of Urumqi. Empirical analysis identified 12 functionally significant transportation communities, providing theoretical support for urban rail transit optimization and commercial facility layout planning.