k medoids clustering algorithm to partition around medoids