Skip to main content
. 2023 Jul 4;25(7):1021. doi: 10.3390/e25071021
Algorithm 4 Genetic Algorithm
  • 1:

    Randomly generate a population P of n solutions

  • 2:

    repeat

  • 3:

         p=

  • 4:

          repeat

  • 5:

            Selection of 2 solutions x and x of P

  • 6:

            Crossing between the two parents x and x to form two children y and y

  • 7:

            Mutate y and y under certain conditions

  • 8:

            Add y and y in P

  • 9:

          until (|P|=n)

  • 10:

         P=P

  • 11:

        until shutdown criteria are met