Skip to main content
. 2025 Aug 22;10(9):560. doi: 10.3390/biomimetics10090560
Algorithm 1 GPSPositiveBasis2N algorithm

Require:

   Objective function FObj

   Initial point x0∈Rn

   Lower bound LoB, upper bound UpB

   Initial step size Δ0>0, tolerance τ>0

   Maximum iterations Kmax

Ensure: Optimal solution x*, optimal value f*

  •  1:

    xbest←x0

  •  2:

    fbest←FObj(xbest)

  •  3:

    Δ←Δ0

  •  4:

    Generate positive basis D=In−InT

  •  5:

    for k=1→Kmax do

  •  6:

          improved←false

  •  7:

          for each direction di∈D do

  •  8:

                xcand←xbest+Δdi

  •  9:

                xcand←clip(xcand,LoB,UpB)

  • 10:

               fcand←FObj(xcand)

  • 11:

               if fcand<fbest then

  • 12:

                   xbest←xcand

  • 13:

                   fbest←fcand

  • 14:

                   improved←true

  • 15:

              end if

  • 16:

          end for

  • 17:

          if improved then

  • 18:

                Δ←1.5Δ               ▷ Step expansion

  • 19:

          else

  • 20:

                Δ←0.5Δ             ▷ Step contraction

  • 21:

          end if

  • 22:

          if Δ<τ then

  • 23:

                break

  • 24:

          end if

  • 25:

    end for

  • 26:

    return xbest,fbest