Skip to main content
. 2022 Sep 2;8:e1068. doi: 10.7717/peerj-cs.1068

Algorithm 1. Proposed discrete stepping ahead firefly algorithm.

Step 1: Initialize population of fireflies
Random population of N solutions using LD constraint sorting
Each exam is placed in non-conflicting slot
Initialize all variables
while t < MaxGeneration do
 for i = 1: n (all n fireflies) do
  for j = 1: n (all n fireflies) do
   Step 2: Evaluation
   if IjIi then
    move firefly in relation to i using the Kempe move; Inew
    while count 5 & Ii = Inew do
      move firefly in relation to i using the Kempe move; Inew
    end
   end
   Step 3: Stepping ahead
   if Stepping ahead is activated then
    move firefly in relation to j using the Kempe move; Inew
    while count 5 & InewIj>QIi=Inew do
      move firefly in relation to Inew using the Kempe move 1 & 2; Inew
    end
   end
  end
  nothing
 end
 Rank fireflies and update best using threshold and probability; Preference utilized;
 if No improvement then
  Stepping ahead is activated;
 else
  Stepping ahead is deactivated;
 end
 if No improvement due to stepping ahead then
  restart 10 steps back where there was improvement;
 end
end
Post processing the results and visualization;