| Algorithm 3 Compact co-Firefly Algorithm |
|
** Initialization ** ; Initialize and by setting all the probabilities inside as 0.5; generate and through and , respectively; ** Evolving Process ** while do ** Exploitation ** generate a solution through ; = -step(); // see also Algorithm 1 ** Competition ** ; if then ; end if ** PV Update ** for ; ; i++ do if then ; else ; end if end for ** Exploration ** generate a solution through ; = -step(, ); // see also Algorithm 2 ** Competition ** ; if then swap(; end if ** PV Update ** for ; ; i++ do if then ; else ; end if end for ** Communication ** ; if then swap(; swap(; end if update ; // see also Section 4.2.2 ** Judge whether the algorithm converges ** if all elements of and are equal to 1 or 0 then break; end if end while output ; |