Skip to main content
. 2024 Dec 16;24(24):8026. doi: 10.3390/s24248026
Algorithm 3 Evolution Algorithm
  • Input: 

    Population size np, parent solutions P(q), crossover probability pcrossover, and mutation probability pmutation.

  • Output: 

    Offspring solutions: P(q)EA.

  •    1:

    Randomly divide P(q) into two populations: P(q)C and P(q)M;

  •    2:

    V^,Φ(V^)←MSS(P(q)C,K,H);

  •    3:

    Sort the solutions P(q)c in an ascending order based on their Φ(V^);

  •    4:

    Compose {Pib(q),Pjw(q)} of the first 50% of the populations {Pib(q)} and the last 50% of the populations {Pjw(q)};

  •    5:

    for each pair of solutions (Pib(q),Pjw(q)) do

  •    6:

       if A randomly generated value p1≤pcrossover then

  •    7:

         Each pair of genes (xi,xj) in Pib(q) and Pjw(q) is randomly assigned a value of 0 or 1, thus constituting the sequence M;

  •    8:

         for each (xi,xj) in {Pib(q),Pjw(q)} do

  •    9:

            if (xi,xj) corresponds to a value of 1 in the sequence M then

  •  10:

              Replace the values of xi and xj to obtain a new Pi(q)C and Pj(q)C;

  •  11:

            end if

  •  12:

         end for

  •  13:

       end if

  •  14:

    end for

  •  15:

    Set {P(q)C}={Pi(q)C}∪{Pj(q)C};

  •  16:

    for each solution Pi(q)M in P(q)M do

  •  17:

       for each weight parameter y in Pi(q)M do

  •  18:

         if A randomly generated value p2≤pmutation then

  •  19:

            Update y value to a value N(−1,1),get Pi(q)M;

  •  20:

         end if

  •  21:

       end for

  •  22:

    end for

  •  23:

    V^,Φ(V^)←MSS(P(q)C∪P(q)M,K,H);

  •  24:

    The np populations from P(q)C∪P(q)M with the highest Φ(V^) are selected as P(q)EA;