Research Article

Solving Two-Dimensional HP Model by Firefly Algorithm and Simplified Energy Function

Pseudocode 1

The pseudo-codes of the firefly algorithm can be summarized as
Step  1  Initialization.
  Step  1.1  Create the initial population of n fireflies ( , ,…, and ) within d-dimensional search space.
  Step  1.2  Formulate light intensity of each firefly so as to be associated with the energy value .
  Step  1.3  Define the parameters and .
Step  2  Perform.
while (termination criteria are not met)
  for to n
    for j = 1 to
      if ( )
        Move firefly towards firefly via (5).
      end if
      Update Attractiveness Table.
      Evaluate New Solutions and Update light intensity.
    end for
  end for
  Rank the fireflies and find the best.
end for while
Step  3  Post-processing and output.