Skip to main content
. 2024 Feb 28;24(5):1545. doi: 10.3390/s24051545
Algorithm 1: Initialize the Subpopulations Based on Clustering
Input:
  • -

    Search space R

  • -

    The number of subpopulations K

  • -

    Initial population Pop

  • -

    Initial population individual Popi

  • -

    Cluster centers Pa1,Pa2,..,PaK

Output:
  • -

    Subpopulations subPop1, subPop2, …, subPopK

1: Generate the initial population Pop within the search space R;
2: Randomly select K individuals Pa1,Pa2,..,PaK as cluster centers;
3: for each Popi in Pop:
4:  Calculate the Euclidean distance Popi−Pai2 between Popi and each cluster center Pai;
5:  Assign Popi to the subpopulation subPopi corresponding to the nearest cluster center Pai;
6: end for
7: Return subPop1, subPop2, …, subPopK