Improving the Walktrap Algorithm Using K-Means Clustering

Multivariate Behav Res. 2024 Mar-Apr;59(2):266-288. doi: 10.1080/00273171.2023.2254767. Epub 2024 Feb 15.

Abstract

The walktrap algorithm is one of the most popular community-detection methods in psychological research. Several simulation studies have shown that it is often effective at determining the correct number of communities and assigning items to their proper community. Nevertheless, it is important to recognize that the walktrap algorithm relies on hierarchical clustering because it was originally developed for networks much larger than those encountered in psychological research. In this paper, we present and demonstrate a computational alternative to the hierarchical algorithm that is conceptually easier to understand. More importantly, we show that better solutions to the sum-of-squares optimization problem that is heuristically tackled by hierarchical clustering in the walktrap algorithm can often be obtained using exact or approximate methods for K-means clustering. Three simulation studies and analyses of empirical networks were completed to assess the impact of better sum-of-squares solutions.

Keywords: K-means clustering; Psychological networks; community detection; hierarchical clustering; walktrap algorithm.

MeSH terms

  • Algorithms*
  • Cluster Analysis
  • Computer Simulation