Research Article

An Effective Hybrid Firefly Algorithm with Harmony Search for Global Numerical Optimization

Algorithm 3

HS/FA method.
Begin
  Step  1. Initialization. Set ; define ; set , at ; set HMCR and PAR; set the
    number of top fireflies KEEP.
  Step  2. Evaluate the light intensity I.
  Step  3. While  t < MaxGeneration do
      Sort the fireflies by light intensity I;
      for    : KEEP (all Top fireflies) do
       for    : NP (all fireflies) do
       if     then
          Move firefly i towards j;
       else
          for    : D (all elements) do// Mutate
         if  (rand < HMCR) then
           
           
           if (rand < PAR) then
             
           end if
         else
           
         end if
          end for  k
       end if
       Update attractiveness;
       Update light intensity;
       end for  j
      end for  i
      Evaluate the light intensity I.
      Sort the population by light intensity I;
      ;
  Step  4. end while
End.