Clustering is a statistical method that attempts to group the points in a dataset according to a distance measure, usually the Euclidean distance, which calculates the root of the squared differences between coordinates of a pair of points. To put this simply, those points that are classified within the same cluster are closer (in terms of the distance defined) to each other than they are to the points belonging to other clusters. At the same time, the larger the distance between two clusters, the better we can distinguish them. This is similar to saying that we try to build groups in which members are more alike and are more different to members of other groups.
It is clear that the most important part of a clustering algorithm is to define and calculate the distance between two given points and to iteratively assign the points...