def __improve_structure(self, clusters, centers):
allocated_centers = []<EOL>amount_free_centers = self.__kmax - len(centers)<EOL>for index_cluster in range(len(clusters)):<EOL><INDENT>(parent_child_clusters, parent_child_centers) = self.__improve_parameters(None, clusters[index_cluster])<EOL>if len(parent_child_clusters) > <NUM_LIT:1>:<EOL><INDENT>parent_scores = self.__splitting_criterion([ clusters[index_cluster] ], [ centers[index_cluster] ])<EOL>child_scores = self.__splitting_criterion([ parent_child_clusters[<NUM_LIT:0>], parent_child_clusters[<NUM_LIT:1>] ], parent_child_centers)<EOL>split_require = False<EOL>if self.__criterion == splitting_type.BAYESIAN_INFORMATION_CRITERION:<EOL><INDENT>if parent_scores < child_scores: split_require = True<EOL><DEDENT>elif self.__criterion == splitting_type.MINIMUM_NOISELESS_DESCRIPTION_LENGTH:<EOL><INDENT>if parent_scores > child_scores: split_require = True;<EOL><DEDENT>if (split_require is True) and (amount_free_centers > <NUM_LIT:0>):<EOL><INDENT>allocated_centers.append(parent_child_centers[<NUM_LIT:0>])<EOL>allocated_centers.append(parent_child_centers[<NUM_LIT:1>])<EOL>amount_free_centers -= <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>allocated_centers.append(centers[index_cluster])<EOL><DEDENT><DEDENT>else:<EOL><INDENT>allocated_centers.append(centers[index_cluster])<EOL><DEDENT><DEDENT>return allocated_centers<EOL>
!
        @brief Check for best structure: divides each cluster into two and checks for best results using splitting criterion.

        @param[in] clusters (list): Clusters that have been allocated (each cluster contains indexes of points from data).
        @param[in] centers (list): Centers of clusters.

        @return (list) Allocated centers for clustering.