def __merge_by_average_link(self):
minimum_average_distance = float('<STR_LIT>');<EOL>for index_cluster1 in range(<NUM_LIT:0>, len(self.__clusters)):<EOL><INDENT>for index_cluster2 in range(index_cluster1 + <NUM_LIT:1>, len(self.__clusters)):<EOL><INDENT>candidate_average_distance = <NUM_LIT:0.0>;<EOL>for index_object1 in self.__clusters[index_cluster1]:<EOL><INDENT>for index_object2 in self.__clusters[index_cluster2]:<EOL><INDENT>candidate_average_distance += euclidean_distance_square(self.__pointer_data[index_object1], self.__pointer_data[index_object2]);<EOL><DEDENT><DEDENT>candidate_average_distance /= (len(self.__clusters[index_cluster1]) + len(self.__clusters[index_cluster2]));<EOL>if (candidate_average_distance < minimum_average_distance):<EOL><INDENT>minimum_average_distance = candidate_average_distance;<EOL>indexes = [index_cluster1, index_cluster2];<EOL><DEDENT><DEDENT><DEDENT>self.__clusters[indexes[<NUM_LIT:0>]] += self.__clusters[indexes[<NUM_LIT:1>]];  <EOL>self.__clusters.pop(indexes[<NUM_LIT:1>])<EOL>
!
        @brief Merges the most similar clusters in line with average link type.