{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,10,31]],"date-time":"2026-10-31T22:39:55Z","timestamp":1793486395503,"version":"4.5.0"},"reference-count":36,"publisher":"MDPI AG","issue":"12","license":[{"start":{"date-parts":[[2023,12,17]],"date-time":"2023-12-17T00:00:00Z","timestamp":1702771200000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Algorithms"],"abstract":"<jats:p>K-Means is a \u201cde facto\u201d standard clustering algorithm due to its simplicity and efficiency. K-Means, though, strongly depends on the initialization of the centroids (seeding method) and often gets stuck in a local sub-optimal solution. K-Means, in fact, mainly acts as a local refiner of the centroids, and it is unable to move centroids all over the data space. Random Swap was defined to go beyond K-Means, and its modus operandi integrates K-Means in a global strategy of centroids management, which can often generate a clustering solution close to the global optimum. This paper proposes an approach which extends both K-Means and Random Swap and improves the clustering accuracy through an evolutionary technique and careful seeding. Two new algorithms are proposed: the Population-Based K-Means (PB-KM) and the Population-Based Random Swap (PB-RS). Both algorithms consist of two steps: first, a population of J candidate solutions is built, and then the candidate centroids are repeatedly recombined toward a final accurate solution. The paper motivates the design of PB-KM and PB-RS, outlines their current implementation in Java based on parallel streams, and demonstrates the achievable clustering accuracy using both synthetic and real-world datasets.<\/jats:p>","DOI":"10.3390\/a16120572","type":"journal-article","created":{"date-parts":[[2023,12,18]],"date-time":"2023-12-18T10:04:47Z","timestamp":1702893887000},"page":"572","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":12,"title":["Improving Clustering Accuracy of K-Means and Random Swap by an Evolutionary Technique Based on Careful Seeding"],"prefix":"10.3390","volume":"16","author":[{"ORCID":"https:\/\/orcid.org\/0000-0001-6577-4777","authenticated-orcid":false,"given":"Libero","family":"Nigro","sequence":"first","affiliation":[{"name":"Engineering Department of Informatics Modelling Electronics and Systems Science, University of Calabria, 87036 Rende, Italy"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-6138-5739","authenticated-orcid":false,"given":"Franco","family":"Cicirelli","sequence":"additional","affiliation":[{"name":"CNR\u2014National Research Council of Italy, Institute for High Performance Computing and Networking (ICAR), 87036 Rende, Italy"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"1968","published-online":{"date-parts":[[2023,12,17]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","unstructured":"Bell, J. (2020). Machine Learning: Hands-on for Developers and Technical Professionals, John Wiley & Sons.","DOI":"10.1002\/9781119642183"},{"key":"ref_2","doi-asserted-by":"crossref","first-page":"129","DOI":"10.1109\/TIT.1982.1056489","article-title":"Least squares quantization in PCM","volume":"28","author":"Lloyd","year":"1982","journal-title":"IEEE Trans. Inf. Theory"},{"key":"ref_3","unstructured":"MacQueen, J. (1967). Proceedings of the 5th Berkeley Symposium on Mathematical Statistics and Probability, University of California."},{"key":"ref_4","doi-asserted-by":"crossref","first-page":"651","DOI":"10.1016\/j.patrec.2009.09.011","article-title":"Data clustering: 50 years beyond k-means","volume":"31","author":"Jain","year":"2010","journal-title":"Pattern Recognit. Lett."},{"key":"ref_5","doi-asserted-by":"crossref","first-page":"4743","DOI":"10.1007\/s10489-018-1238-7","article-title":"K-means properties on six clustering benchmark datasets","volume":"48","author":"Sieranoja","year":"2018","journal-title":"Appl. Intell."},{"key":"ref_6","doi-asserted-by":"crossref","first-page":"95","DOI":"10.1016\/j.patcog.2019.04.014","article-title":"How much can k-means be improved by using better initialization and repeats?","volume":"93","author":"Sieranoja","year":"2019","journal-title":"Pattern Recognit."},{"key":"ref_7","doi-asserted-by":"crossref","first-page":"1975","DOI":"10.1007\/s10994-021-06021-7","article-title":"An empirical comparison between stochastic and deterministic centroid initialization for K-means variations","volume":"110","author":"Vouros","year":"2021","journal-title":"Mach. Learn."},{"key":"ref_8","first-page":"1","article-title":"Efficiency of random swap algorithm","volume":"5","year":"2018","journal-title":"J. Big Data"},{"key":"ref_9","doi-asserted-by":"crossref","first-page":"102712","DOI":"10.1016\/j.simpat.2022.102712","article-title":"Parallel random swap: An efficient and reliable clustering algorithm in Java","volume":"124","author":"Nigro","year":"2023","journal-title":"Simul. Model. Pract. Theory"},{"key":"ref_10","doi-asserted-by":"crossref","first-page":"61","DOI":"10.1016\/S0167-8655(99)00133-6","article-title":"Genetic algorithm with deterministic crossover for vector quantization","volume":"21","year":"2000","journal-title":"Pattern Recognit. Lett."},{"key":"ref_11","unstructured":"Baldassi, C. (2020). Recombinator K-Means: A population based algorithm that exploits k-means++ for recombination. arXiv."},{"key":"ref_12","doi-asserted-by":"crossref","first-page":"991","DOI":"10.1109\/TEVC.2022.3144134","article-title":"Recombinator K-Means: An evolutionary algorithm that exploits k-means++ for recombination","volume":"26","author":"Baldassi","year":"2022","journal-title":"IEEE Trans. Evol. Comput."},{"key":"ref_13","doi-asserted-by":"crossref","first-page":"133","DOI":"10.1109\/TSMCC.2008.2007252","article-title":"A survey of evolutionary algorithms for clustering","volume":"39","author":"Hruschka","year":"2009","journal-title":"IEEE Trans. Syst. Man Cybern. Part C (Appl. Rev.)"},{"key":"ref_14","doi-asserted-by":"crossref","first-page":"200","DOI":"10.1016\/j.eswa.2012.07.021","article-title":"A comparative study of efficient initialization methods for the k-means clustering algorithm","volume":"40","author":"Celebi","year":"2013","journal-title":"Expert Syst. Appl."},{"key":"ref_15","doi-asserted-by":"crossref","unstructured":"Nigro, L. (2022). Performance of parallel K-means algorithms in Java. Algorithms, 15.","DOI":"10.3390\/a15040117"},{"key":"ref_16","unstructured":"Urma, R.G., Fusco, M., and Mycroft, A. (2018). Modern Java in Action, Manning."},{"key":"ref_17","doi-asserted-by":"crossref","unstructured":"Nigro, L., and Cicirelli, F. (2023, January 12\u201314). Performance of a K-Means algorithm driven by careful seeding. Proceedings of the 13th International Conference on Simulation and Modeling Methodologies, Technologies and Applications (SIMULTECH) 2023, Rome, Italy.","DOI":"10.5220\/0012045000003546"},{"key":"ref_18","unstructured":"Arthur, D., and Vassilvitskii, S. K-Means++: The advantages of careful seeding. Proceedings of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms 2007."},{"key":"ref_19","unstructured":"Goldberg, D.E. (1989). Genetic Algorithms in Search Optimization and Machine Learning, Addison Wesley."},{"key":"ref_20","doi-asserted-by":"crossref","unstructured":"Nigro, L., and Fr\u00e4nti, P. (2023). Two Medoid-Based Algorithms for Clustering Sets. Algorithms, 16.","DOI":"10.3390\/a16070349"},{"key":"ref_21","doi-asserted-by":"crossref","first-page":"2173","DOI":"10.1109\/TKDE.2016.2551240","article-title":"Set Matching Measures for External Cluster Validity","volume":"28","author":"Rezaei","year":"2016","journal-title":"IEEE Trans. Knowl. Data Eng."},{"key":"ref_22","doi-asserted-by":"crossref","first-page":"3034","DOI":"10.1016\/j.patcog.2014.03.017","article-title":"Centroid index: Cluster level similarity measure","volume":"47","author":"Rezaei","year":"2014","journal-title":"Pattern Recognit."},{"key":"ref_23","unstructured":"Fr\u00e4nti, P., and Rezaei, M. (December, January 29). Generalized centroid index to different clustering models. Proceedings of the Joint IAPR International Workshops on Statistical Techniques in Pattern Recognition (SPR) and Structural and Syntactic Pattern Recognition (SSPR), M\u00e9rida, Mexico. LNCS 10029."},{"key":"ref_24","unstructured":"Fr\u00e4nti, P. (2023, August 01). Repository of Datasets. Available online: http:\/\/cs.uef.fi\/sipu\/datasets\/."},{"key":"ref_25","unstructured":"(2023, August 01). UCI Machine Learning Repository. Available online: http:\/\/archive.ics.uci.edu\/ml."},{"key":"ref_26","doi-asserted-by":"crossref","first-page":"551","DOI":"10.1016\/j.patrec.2019.10.019","article-title":"Fast and general density peaks clustering","volume":"128","author":"Sieranoja","year":"2019","journal-title":"Pattern Recognit. Lett."},{"key":"ref_27","doi-asserted-by":"crossref","first-page":"14.92","DOI":"10.1126\/science.1242072","article-title":"Clustering by fast search and find of density peaks","volume":"344","author":"Rodriguez","year":"2014","journal-title":"Science"},{"key":"ref_28","unstructured":"Baldassi, C. (2023, August 01). UrbanGB Dataset. Available online: https:\/\/github.com\/carlobaldassi\/UrbanGB-dataset."},{"key":"ref_29","doi-asserted-by":"crossref","first-page":"109454","DOI":"10.1016\/j.patcog.2023.109454","article-title":"K-sets and k-swaps algorithms for clustering sets","volume":"139","author":"Rezaei","year":"2023","journal-title":"Pattern Recognit."},{"key":"ref_30","doi-asserted-by":"crossref","first-page":"102189","DOI":"10.1016\/j.simpat.2020.102189","article-title":"Parallel Theatre: A Java actor-framework for high-performance computing","volume":"106","author":"Nigro","year":"2021","journal-title":"Simul. Model. Pract. Theory"},{"key":"ref_31","first-page":"100","article-title":"Algorithm as 136: A k-means clustering algorithm","volume":"28","author":"Hartigan","year":"1979","journal-title":"J. R. Stat. Soc. Ser. C (Appl. Stat.)"},{"key":"ref_32","unstructured":"Slonim, N., Aharoni, E., and Crammer, K. (2013, January 3\u20139). Hartigan\u2019s k-means versus Lloyd\u2019s k-means-is it time for a change?. Proceedings of the Twenty-Third International Joint Conference on Artificial Intelligence (IJCAI 2013), Beijing, China."},{"key":"ref_33","doi-asserted-by":"crossref","first-page":"109144","DOI":"10.1016\/j.patcog.2022.109144","article-title":"Finding compact and well separated clusters: Clustering using silhouette coefficients","volume":"135","author":"Bagirov","year":"2023","journal-title":"Pattern Recognit."},{"key":"ref_34","doi-asserted-by":"crossref","first-page":"972","DOI":"10.1126\/science.1136800","article-title":"Clustering by passing messages between data points","volume":"315","author":"Frey","year":"2007","journal-title":"Science"},{"key":"ref_35","doi-asserted-by":"crossref","first-page":"155297","DOI":"10.1109\/ACCESS.2021.3128284","article-title":"A quantitative site-specific classification approach based on affinity propagation clustering","volume":"9","author":"Moustafa","year":"2021","journal-title":"IEEE Access"},{"key":"ref_36","doi-asserted-by":"crossref","first-page":"187","DOI":"10.1049\/ip-vis:20010361","article-title":"Uniform distribution of points on a hyper-sphere with applications to vector bit-plane encoding","volume":"148","author":"Lovisolo","year":"2001","journal-title":"IEE Proc.-Vis. Image Signal Process."}],"container-title":["Algorithms"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/1999-4893\/16\/12\/572\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,10]],"date-time":"2025-10-10T21:40:24Z","timestamp":1760132424000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/1999-4893\/16\/12\/572"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2023,12,17]]},"references-count":36,"journal-issue":{"issue":"12","published-online":{"date-parts":[[2023,12]]}},"alternative-id":["a16120572"],"URL":"https:\/\/doi.org\/10.3390\/a16120572","relation":{},"ISSN":["1999-4893"],"issn-type":[{"value":"1999-4893","type":"electronic"}],"subject":[],"published":{"date-parts":[[2023,12,17]]}}}