Open Access iconOpen Access



Performances of K-Means Clustering Algorithm with Different Distance Metrics

Taher M. Ghazal1,2, Muhammad Zahid Hussain3, Raed A. Said5, Afrozah Nadeem6, Mohammad Kamrul Hasan1, Munir Ahmad7, Muhammad Adnan Khan3,4,*, Muhammad Tahir Naseem3

1 Center for Cyber Security, Faculty of Information Science and Technology, Universiti Kebansaan Malaysia (UKM), 43600, Bangi, Selangor, Malaysia
2 School of Information Technology, Skyline University College, University City Sharjah, 1797, Sharjah, UAE
3 Riphah School of Computing & Innovation, Faculty of Computing, Riphah International University, Lahore Campus, Lahore, 54000, Pakistan
4 Pattern Recognition and Machine Learning Lab, Department of Software Engineering, Gachon University, Seongnam, 13557, South Korea
5 Canadian University Dubai, Dubai, UAE
6 Department of Computer Science, Lahore Garrison University, Lahore, 54000, Pakistan
7 School of Computer Science, National College of Business Administration & Economics, Lahore, 54000, Pakistan

* Corresponding Author: Muhammad Adnan Khan. Email: email

Intelligent Automation & Soft Computing 2021, 30(2), 735-742.


Clustering is the process of grouping the data based on their similar properties. Meanwhile, it is the categorization of a set of data into similar groups (clusters), and the elements in each cluster share similarities, where the similarity between elements in the same cluster must be smaller enough to the similarity between elements of different clusters. Hence, this similarity can be considered as a distance measure. One of the most popular clustering algorithms is K-means, where distance is measured between every point of the dataset and centroids of clusters to find similar data objects and assign them to the nearest cluster. Further, there are a series of distance metrics that can be applied to calculate point-to-point distances. In this research, the K-means clustering algorithm is evaluated with three different mathematical metrics in terms of execution time with different datasets and different numbers of clusters. The results indicate that the implementation of Manhattan distance measure metrics achieves the best results in most cases. These results also demonstrate that distance metrics can affect the execution time and the number of clusters created by the K-means algorithm.


Cite This Article

T. M. Ghazal, M. Zahid Hussain, R. A. Said, A. Nadeem, M. Kamrul Hasan et al., "Performances of k-means clustering algorithm with different distance metrics," Intelligent Automation & Soft Computing, vol. 30, no.2, pp. 735–742, 2021.


cc This work is licensed under a Creative Commons Attribution 4.0 International License , which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
  • 3201


  • 3065


  • 1


Share Link