Optimizing k-means centroid initialization using genetic algorithms for student activity clustering
Abstract
K-means is one of the most widely used clustering algorithms due to its computational efficiency and simplicity. However, its performance depends heavily on the selection of initial centroids, which can lead to inconsistent or suboptimal outcomes. To address this limitation, k-means++ was introduced with a probabilistic initialization strategy. Although it improves stability compared to random initialization, k-means++ still encounters challenges when applied to datasets with complex or non-linear structures. This study proposes integrating a genetic algorithm (GA) with k-means to optimize centroid initialization before clustering. GA applies selection, crossover, and mutation processes to explore the solution space and identify near-optimal centroids. The performance of GA k-means was evaluated using fitness scores and silhouette scores, and compared with k-means++ and random initialization. Experiments were conducted on student online learning activity data, including module access, discussion participation, and other interactions. Results show that GA consistently produces higher fitness values, with the best score of 0.8948 at two clusters, reflecting stable centroid optimization. Meanwhile, k-means++ achieved the highest silhouette score of 0.6144 at three clusters, indicating the most coherent structure. These results demonstrate that combining GA with k-means offers a robust solution for clustering educational data and similar applications.
Keywords
Centroid initialization; Clustering; Genetic algorithm; K-means++; Student activity data
Full Text:
PDFDOI: http://doi.org/10.11591/ijai.v15.i6.pp5289-5298
Refbacks
- There are currently no refbacks.
Copyright (c) 2026 Abdul Rahman, Sri Mulyana, Agus Sihabuddin, Aina Musdholifah

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
IAES International Journal of Artificial Intelligence (IJ-AI)
ISSN/e-ISSN 2089-4872/2252-8938
This journal is published by the Institute of Advanced Engineering and Science (IAES).