Table 1

Pseudocode of the modified particle swarm optimisation (PSO) algorithm with a restart strategy

Algorithm 1 Modified PSO with a restart strategy
1: P←INITIALIZE(pSize)
  • Initial particles (P)

2: for each particle in P
3:v←INITIALIZE_V()
  • Initial particle’s velocity

4:p←INITIALIZE_P()
  • Initial particle’s position

5:pbest←INITIALIZE_PB()
  • Initial particle’s pbest (denotes the individual optimum)

6: gbest←INITIALIZE_GB()
  • Initial gbest (denotes the global optimum by a global structure)

7: fitnessgbest ←COMPUTEFITNESS(gbest)
  • Compute global fitness

8: count←0
  • Counter for times of fitnessgbest with the same value

9: gbesttemp gbest
10: fitnesstemp fitnessgbest
11: for each iteration
12:for each particle in P
13:  v←UPDATE_v(p, v, pbest, gbest)
  • Update particle’s velocity

14:  p←UPDATE_p(p, v)
  • Update particle’s position

15:  fitnesscurrent ←COMPUTEFITNESS(p)
  • Compute current fitness

16:  fitnesspbest ←COMPUTEFITNESS(pbest)
  • Compute particle’s best fitness

17:  if fitnesscurrent<fitnesspbest then
18:   pbestp
19:   fitnesspbest fitnesscurrent
20:  if fitnesspbest<fitnesstemp then
21:   gbesttemp pbest
22:   fitnesstemp fitnesspbest
23:if fitnesstemp< fitnessgbest then
24:  gbestgbesttemp
25:  fitnessgbest fitnesstemp
26:  count←0
27:else
28:  countcount+1
29:if count >tf then
  • Trap into the local optimum

30:  for each particle in P
  • Apply restart strategy

31:   v←INITIALIZE_V()
  • Initial particle’s velocity

32:   p←INITIALIZE_P()
  • Initial particle’s position

33:   pbest←INITIALIZE_PB()
  • Initial particle’s pbest

34:  count←0