I am trying to write my own k-means and k-medoids clustering algorithms. I understand the general idea: given
k centroids, one continually updates the centroids such that the distance between the points and centroids is minimized; these distances can be euclidean, manhattan, etc. The centroids are members of the original dataset in the case of k-medoids, unlike k-means.
So say the algorithm is computing data-centroid distances before updating the centroids and repeating this process. Suppose there are two or more potential centroids for which the minimized distances are equal. Is there a criteria or general rule to pick which centroid to update?
This question is also posed here; the answer suggests using the originally assigned centroid to avoid infinite loops. This appears to me to be a reason based on programming errors as opposed to the actual method.