Skip to main content
. 2024 Feb 28;24(5):1545. doi: 10.3390/s24051545
Algorithm 2: Adaptive Reconstruction and Elimination Mechanism
Input:
  • -

    Search space R

  • -

    Population Pop

  • -

    Subpopulations subPop1, subPop2, …, subPopK

  • -

    Optimal solutions of subpopulations pbest1, pbest2, …, pbestK

Output:
  • -

    The global optimal solution gbest

1: While the number of subpopulations K falls below the threshold:
2:  Perform the search process (as described in Section 2.2.2);
3:  Utilize the K-means clustering method to reorganize all subpopulations;
4:  Select pbest1, pbest2, …, pbestK as the cluster centers from each subPop1, subPop2, …, subPopK;
5:  for each individual Popi in Pop:
6:    Calculate Euclidean distance Popi−pbestK2 between Popi and each pbest1, pbest2, …, pbestK;
7:    Assign Popi to the subpopulation with the closest distance to its corresponding cluster center;
8:  end for
9:  for each subPopK:
10:    if the number of individuals in a subpopulation is less than the Threshold:
11:      Eliminate the subpopulation subPopK;
12:    end if
13:  end for
14:  Continue the search process;
15: end while
16: Return the global optimal solution gbest.