class_docstr: !
  @brief Class represents clustering algorithm CURE with KD-tree optimization.
  @details CCORE option can be used to use the pyclustering core - C/C++ shared library for processing that significantly increases performance.
  
  Here is an example how to perform cluster analysis of sample 'Lsun':
  @code
      from pyclustering.cluster import cluster_visualizer;
      from pyclustering.cluster.cure import cure;
      from pyclustering.utils import read_sample;
      from pyclustering.samples.definitions import FCPS_SAMPLES;
  
      # Input data in following format [ [0.1, 0.5], [0.3, 0.1], ... ].
      input_data = read_sample(FCPS_SAMPLES.SAMPLE_LSUN);
  
      # Allocate three clusters.
      cure_instance = cure(input_data, 3);
      cure_instance.process();
      clusters = cure_instance.get_clusters();
  
      # Visualize allocated clusters.
      visualizer = cluster_visualizer();
      visualizer.append_clusters(clusters, input_data);
      visualizer.show();
  @endcode
class_docstr_tok: ["!","@","brief","Class","represents","clustering","algorithm","CURE","with","KD-tree","optimization",".","@","details","CCORE","option","can","be","used","to","use","the","pyclustering","core","-","C\/C++","shared","library","for","processing","that","significantly","increases","performance",".","Here","is","an","example","how","to","perform","cluster","analysis","of","sample","'Lsun","'",":","@","code","from","pyclustering.cluster","import","cluster_visualizer",";","from","pyclustering.cluster.cure","import","cure",";","from","pyclustering.utils","import","read_sample",";","from","pyclustering.samples.definitions","import","FCPS_SAMPLES",";","#","Input","data","in","following","format","[","[","0.1",",","0.5","]",",","[","0.3",",","0.1","]",",","...","]",".","input_data","=","read_sample","(","FCPS_SAMPLES.SAMPLE_LSUN",")",";","#","Allocate","three","clusters",".","cure_instance","=","cure","(","input_data",",","3",")",";","cure_instance.process","(",")",";","clusters","=","cure_instance.get_clusters","(",")",";","#","Visualize","allocated","clusters",".","visualizer","=","cluster_visualizer","(",")",";","visualizer.append_clusters","(","clusters",",","input_data",")",";","visualizer.show","(",")",";","@","endcode"]
docstr: !
  @brief Create queue of sorted clusters by distance between them, where first cluster has the nearest neighbor. At the first iteration each cluster contains only one point.
  
  @param[in] data (list): Input data that is presented as list of points (objects), each point should be represented by list or tuple.
  
  @return (list) Create queue of sorted clusters by distance between them.
docstr_tok: ["!","@","brief","Create","queue","of","sorted","clusters","by","distance","between","them",",","where","first","cluster","has","the","nearest","neighbor",".","At","the","first","iteration","each","cluster","contains","only","one","point",".","@","param","[","in","]","data","(","list",")",":","Input","data","that","is","presented","as","list","of","points","(","objects",")",",","each","point","should","be","represented","by","list","or","tuple",".","@","return","(","list",")","Create","queue","of","sorted","clusters","by","distance","between","them","."]
code: def __create_queue(self):
      """!
      @brief Create queue of sorted clusters by distance between them, where first cluster has the nearest neighbor. At the first iteration each cluster contains only one point.
  
      @param[in] data (list): Input data that is presented as list of points (objects), each point should be represented by list or tuple.
  
      @return (list) Create queue of sorted clusters by distance between them.
  
      """
  
      self.__queue = [
          cure_cluster(self.__pointer_data[index_point], index_point)
          for index_point in range(len(self.__pointer_data))
      ]
  
      # set closest clusters
      for i in range(0, len(self.__queue)):
          minimal_distance = float("inf")
          closest_index_cluster = -1
  
          for k in range(0, len(self.__queue)):
              if i != k:
                  dist = self.__cluster_distance(
                      self.__queue[i], self.__queue[k]
                  )
                  if dist < minimal_distance:
                      minimal_distance = dist
                      closest_index_cluster = k
  
          self.__queue[i].closest = self.__queue[closest_index_cluster]
          self.__queue[i].distance = minimal_distance
  
      # sort clusters
      self.__queue.sort(key=lambda x: x.distance, reverse=False)
  
imports: import numpy
  from pyclustering.cluster.encoder import type_encoding
  from pyclustering.utils import euclidean_distance_square
  from pyclustering.container.kdtree import kdtree
  from pyclustering.core.wrapper import ccore_library
  import pyclustering.core.cure_wrapper
label_desc: Use image node_id 17 for calling the cure obj's underlying member method code with example usage: obj.__create_queue() without return types