Algorithm 2

Enhanced PSO Algorithm

1:

Set the initial value of swarm size SS(N), acceleration constants c1 and c2, wmax, wmtn, vmax and maxiter.

2:

Randomly initialize the population as x using Eq. (9) for each solution and the velocity vectors v as D dimensional zero vectors as in Eq. (10).

3:

Set t := 0. {Counter initialization}

4:

w=wmaxtwmaxwminmax_iter

5:

Evaluate the fitness function for each of the solutions using f(xi) (Eq. (2)) and assign the values for Pbest and gbest.

6:

for(i = l; i < SS; i ++) do

7:

vi(t+1)=wvi(t)+c1ri1Pbesti(t)xi(t)+c2ri2 gbest xi(t)

8:

end for{Update the velocities of Particles}

9:

for(i= l; i < SS, i + +) do

10:

for(j = 1; j <D;j + +) do

11:

if(v(i,j) > vmax) then

12:

v(i,j) = vmax

13:

end if

14:

if(v(i, j)< -vmax) then

15:

v(i, j) = −vmax

16:

end if

17:

S=11+ev(ij)

18:

if(rand < s) then

19:

x(i, j) = 1

20:

else

21:

x(i,j)=0

22:

end if

23:

end for

24:

end for

25:

t = t +1 {Iteration counter is increasing}

26:

until(t <mox iter) {Termination criteria are satisfied}.

27:

Produce the best solution gbest.

or Create an Account

Close subscription notice
Close access options