class_docstr: !
  @brief The class represents clustering algorithm ROCK.
  
  Example:
  @code
      from pyclustering.cluster import cluster_visualizer
      from pyclustering.cluster.rock import rock
      from pyclustering.samples.definitions import FCPS_SAMPLES
      from pyclustering.utils import read_sample
  
      # Read sample for clustering from file.
      sample = read_sample(FCPS_SAMPLES.SAMPLE_HEPTA)
  
      # Create instance of ROCK algorithm for cluster analysis. Seven clusters should be allocated.
      rock_instance = rock(sample, 1.0, 7)
  
      # Run cluster analysis.
      rock_instance.process()
  
      # Obtain results of clustering.
      clusters = rock_instance.get_clusters()
  
      # Visualize clustering results.
      visualizer = cluster_visualizer()
      visualizer.append_clusters(clusters, sample)
      visualizer.show()
  @endcode
     
docstr: !
  @brief Returns pair of clusters that are best candidates for merging in line with goodness measure.
         The pair of clusters for which the above goodness measure is maximum is the best pair of clusters to be merged.
         
  @param[in] clusters (list): List of clusters that have been allocated during processing, each cluster is represented by list of indexes of points from the input data set.
  
  @return (list) List that contains two indexes of clusters (from list 'clusters') that should be merged on this step.
          It can be equals to [-1, -1] when no links between clusters.
docstr_tok: ["!","@","brief","Returns","pair","of","clusters","that","are","best","candidates","for","merging","in","line","with","goodness","measure",".","The","pair","of","clusters","for","which","the","above","goodness","measure","is","maximum","is","the","best","pair","of","clusters","to","be","merged",".","@","param","[","in","]","clusters","(","list",")",":","List","of","clusters","that","have","been","allocated","during","processing",",","each","cluster","is","represented","by","list","of","indexes","of","points","from","the","input","data","set",".","@","return","(","list",")","List","that","contains","two","indexes","of","clusters","(","from","list","'clusters","'",")","that","should","be","merged","on","this","step",".","It","can","be","equals","to","[","-1",",","-1","]","when","no","links","between","clusters","."]
code: def __find_pair_clusters(self, clusters):
      """!
      @brief Returns pair of clusters that are best candidates for merging in line with goodness measure.
             The pair of clusters for which the above goodness measure is maximum is the best pair of clusters to be merged.
  
      @param[in] clusters (list): List of clusters that have been allocated during processing, each cluster is represented by list of indexes of points from the input data set.
  
      @return (list) List that contains two indexes of clusters (from list 'clusters') that should be merged on this step.
              It can be equals to [-1, -1] when no links between clusters.
  
      """
  
      maximum_goodness = 0.0
      cluster_indexes = [-1, -1]
  
      for i in range(0, len(clusters)):
          for j in range(i + 1, len(clusters)):
              goodness = self.__calculate_goodness(
                  clusters[i], clusters[j]
              )
              if goodness > maximum_goodness:
                  maximum_goodness = goodness
                  cluster_indexes = [i, j]
  
      return cluster_indexes
  
file_path: pyclustering/pyclustering/cluster/rock.py
imports: from pyclustering.cluster.encoder import type_encoding
  from pyclustering.utils import euclidean_distance
  from pyclustering.core.wrapper import ccore_library
  import pyclustering.core.rock_wrapper
label_desc: Use image node_id 5 for calling the rock obj's underlying member method code with example usage: obj.__find_pair_clusters(clusters) and returns: cluster_indexes