Skip to main content
. 2025 May 12;10(5):314. doi: 10.3390/biomimetics10050314
Algorithm 4 Binary Pendulum Search Algorithm.

 Input: The population X={X1,X2,…,Xi}

 Output: The updated population X′={X1′,X2′,…,Xi′} and Best

  •  1:

    Initialize binary random population X

  •  2:

    Evaluate the objective function of each individual

  •  3:

    Identify the best individual in the population (Best)

  •  4:

    for iteration (t) do

  •  5:

          for solution(i) do

  •  6:

                for dimension(j) do

  •  7:

                      Update pendi.jt by Equation (10)

  •  8:

                      Update the position of Xi,jt using Equation (9)

  •  9:

                end for

  • 10:

          end for

  • 11:

          Binarization of population X using Algorithm 1

  • 12:

          Evaluate the objective function of each individual

  • 13:

          Update Best if there is a better solution

  • 14:

    end for

  • 15:

    return the updated population X′ where Best is the best result