class_docstr: !
  @brief Analyser of cluster ordering diagram.
  @details Using cluster-ordering it is able to connectivity radius for allocation of specified amount of clusters and
            calculate amount of clusters using specified connectivity radius. Cluster-ordering is formed by OPTICS algorithm
            during cluster analysis.
  
  @see optics
docstr: !
  @brief Calculates connectivity radius of allocation specified amount of clusters using ordering diagram and marks borders of clusters using indexes of values of ordering diagram.
  @details Parameter 'maximum_iterations' is used to protect from hanging when it is impossible to allocate specified number of clusters.
  
  @param[in] amount_clusters (uint): amount of clusters that should be allocated by calculated connectivity radius.
  @param[in] maximum_iterations (uint): maximum number of iteration for searching connectivity radius to allocated specified amount of clusters (by default it is restricted by 100 iterations).
  
  @return (double, list) Value of connectivity radius and borders of clusters like (radius, borders), radius may be 'None' as well as borders may be '[]'
                          if connectivity radius hasn't been found for the specified amount of iterations.
code: def calculate_connvectivity_radius(
      self, amount_clusters, maximum_iterations=100
  ):
      """!
      @brief Calculates connectivity radius of allocation specified amount of clusters using ordering diagram and marks borders of clusters using indexes of values of ordering diagram.
      @details Parameter 'maximum_iterations' is used to protect from hanging when it is impossible to allocate specified number of clusters.
  
      @param[in] amount_clusters (uint): amount of clusters that should be allocated by calculated connectivity radius.
      @param[in] maximum_iterations (uint): maximum number of iteration for searching connectivity radius to allocated specified amount of clusters (by default it is restricted by 100 iterations).
  
      @return (double, list) Value of connectivity radius and borders of clusters like (radius, borders), radius may be 'None' as well as borders may be '[]'
                              if connectivity radius hasn't been found for the specified amount of iterations.
  
      """
  
      maximum_distance = max(self.__ordering)
  
      upper_distance = maximum_distance
      lower_distance = 0.0
  
      result = None
  
      amount, borders = self.extract_cluster_amount(maximum_distance)
      if amount <= amount_clusters:
          for _ in range(maximum_iterations):
              radius = (lower_distance + upper_distance) / 2.0
  
              amount, borders = self.extract_cluster_amount(radius)
              if amount == amount_clusters:
                  result = radius
                  break
  
              elif amount == 0:
                  break
  
              elif amount > amount_clusters:
                  lower_distance = radius
  
              elif amount < amount_clusters:
                  upper_distance = radius
  
      return result, borders
  
imports: import math
  import matplotlib.pyplot
  from pyclustering.container.kdtree import kdtree_balanced
  from pyclustering.cluster.encoder import type_encoding
  from pyclustering.utils.color import color
  from pyclustering.core.wrapper import ccore_library
  import pyclustering.core.optics_wrapper
label_desc: Use image node_id 4 for calling the ordering_analyser obj's underlying member method code with example usage: obj.calculate_connvectivity_radius(amount_clusters, maximum_iterations) and returns: result,  borders