class_docstr: !
  @brief Class represents clustering algorithm CLARANS (a method for clustering objects for spatial data mining).
class_docstr_tok: ["!","@","brief","Class","represents","clustering","algorithm","CLARANS","(","a","method","for","clustering","objects","for","spatial","data","mining",")","."]
docstr: !
  @brief Finds the another nearest medoid for the specified point that is differ from the specified medoid. 
  
  @param[in] point_index: index of point in dataspace for that searching of medoid in current list of medoids is perfomed.
  @param[in] current_medoid_index: index of medoid that shouldn't be considered as a nearest.
  
  @return (uint) index of the another nearest medoid for the point.
docstr_tok: ["!","@","brief","Finds","the","another","nearest","medoid","for","the","specified","point","that","is","differ","from","the","specified","medoid",".","@","param","[","in","]","point_index",":","index","of","point","in","dataspace","for","that","searching","of","medoid","in","current","list","of","medoids","is","perfomed",".","@","param","[","in","]","current_medoid_index",":","index","of","medoid","that","should","n't","be","considered","as","a","nearest",".","@","return","(","uint",")","index","of","the","another","nearest","medoid","for","the","point","."]
code: def __find_another_nearest_medoid(
      self, point_index, current_medoid_index
  ):
      """!
      @brief Finds the another nearest medoid for the specified point that is differ from the specified medoid.
  
      @param[in] point_index: index of point in dataspace for that searching of medoid in current list of medoids is perfomed.
      @param[in] current_medoid_index: index of medoid that shouldn't be considered as a nearest.
  
      @return (uint) index of the another nearest medoid for the point.
  
      """
      other_medoid_index = -1
      other_distance_nearest = float("inf")
      for index_medoid in self.__current:
          if index_medoid != current_medoid_index:
              other_distance_candidate = euclidean_distance_square(
                  self.__pointer_data[point_index],
                  self.__pointer_data[current_medoid_index],
              )
  
              if other_distance_candidate < other_distance_nearest:
                  other_distance_nearest = other_distance_candidate
                  other_medoid_index = index_medoid
  
      return other_medoid_index
  
file_path: pyclustering/pyclustering/cluster/clarans.py
imports: import random
  from pyclustering.cluster.encoder import type_encoding
  from pyclustering.utils import euclidean_distance_square
label_desc: Use image node_id 9 for calling the clarans obj's underlying member method code with example usage: obj.__find_another_nearest_medoid(point_index, current_medoid_index) and returns: other_medoid_index