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

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

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

  •  1:

    Initialize binary random population X

  •  2:

    Evaluate the objective function of each individual

  •  3:

    Identify the best individual in the population (X*)

  •  4:

    for iteration (t) do

  •  5:

          for solution(i) do

  •  6:

                Update a,A,C,l and p

  •  7:

                if p<0.5 then

  •  8:

                     if |A|<1 then

  •  9:

                           Apply Equation (14)

  • 10:

                   else

  • 11:

                         Apply Equation (11)

  • 12:

                   end if

  • 13:

                else

  • 14:

                   Apply Equation (15)

  • 15:

                end if

  • 16:

          end for

  • 17:

          Binarization of population X using Algorithm 1

  • 18:

          Evaluate the objective function of each individual

  • 19:

          Update X* if there is a better solution

  • 20:

    end for

  • 21:

    Return (X*)