performance of differential evolution and particle swarm ... · annealing method “ of...

29
Munich Personal RePEc Archive Performance of Differential Evolution and Particle Swarm Methods on Some Relatively Harder Multi-modal Benchmark Functions Mishra, SK North-Eastern Hill University, Shillong (India) 13 October 2006 Online at https://mpra.ub.uni-muenchen.de/1743/ MPRA Paper No. 1743, posted 11 Feb 2007 UTC

Upload: others

Post on 23-Jul-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

Munich Personal RePEc Archive

Performance of Differential Evolution

and Particle Swarm Methods on Some

Relatively Harder Multi-modal

Benchmark Functions

Mishra, SK

North-Eastern Hill University, Shillong (India)

13 October 2006

Online at https://mpra.ub.uni-muenchen.de/1743/

MPRA Paper No. 1743, posted 11 Feb 2007 UTC

Page 2: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

Performance of Differential Evolution and Particle Swarm Methods

on Some Relatively Harder Multi-modal Benchmark Functions

SK Mishra

Department of Economics North-Eastern Hill University,

Shillong, Meghalaya (India).

I. Introduction: Global optimization (GO) is concerned with finding the optimum point(s) of a non-convex (multi-modal) function in an m-dimensional space. Although some work was done in the pre-1970’s to develop appropriate methods to find the optimal point(s) of a multi-modal function, the 1970’s evidenced a great fillip in simulation-based optimization research due to the invention of the ‘genetic algorithm’ by John Holland (1975). A number of other methods of global optimization were soon developed. Among them, the ‘Clustering Method” of Aimo Törn (1978), the “Simulated Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986), the “Ant Colony Algorithm” of Dorigo (1992), the “Particle Swarm Method” of Kennedy and Eberhart (1995) and the “Differential Evolution Method” of Price and Storn (1996) are quite effective and popular. All these methods use the one or the other stochastic process to search the global optima.

II. The Characteristic Features of Stochastic GO Methods: All stochastic search methods of global optimization partake of the probabilistic nature inherent to them. As a result, one cannot obtain certainty in their results, unless they are permitted to go in for indefinitely large search attempts. Larger is the number of attempts, greater is the probability that they would find out the global optimum, but even then it would not reach at the certainty. Secondly, all of them adapt themselves to the surface on which they find the global optimum. The scheme of adaptation is largely based on some guesswork since nobody knows as to the true nature of the problem (environment or surface) and the most suitable scheme of adaptation to fit the given environment. Surfaces may be varied and different for different functions. A particular type of surface may be suited to a particular method while a search in another type of surface may be a difficult proposition for it. �Further, each of these methods operates with a number of parameters that may be changed at choice to make it more effective. This choice is often problem oriented and for obvious reasons. A particular choice may be extremely effective in a few cases, but it might be ineffective (or counterproductive) in certain other cases. Additionally, there is a relation of trade-off among those parameters. These features make all these methods a subject of trial and error exercises.

III. The Objectives: Our objective in this paper is to compare the performance of the Differential Evolution (DE) and the Repulsive Particle Swarm (RPS) methods of global optimization. To this end, some relatively difficult test functions have been chosen. Among these test functions, some are new while others are well known in the literature.

IV. Details of the Test Functions used in this Study: The following test (benchmark) functions have been used in this study.

Page 3: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

2

(1) Perm function #1: In the domain x ∈[-4, 4], the function has fmin =0 for x =(1, 2, 3, 4) .

It is specified as 2

4 4

1 1

( ) ( ){( / ) 1}k k

i

k i

f x i x iβ= =

� �= + −� �

� �� �

The value of β (=50) introduces difficulty to optimization. Smaller values of beta raise

this difficulty further.

(2) Perm function #2: In the domain x ∈[-1, 1], and for a given β (=10), this m-variable

function has 1;min 0 ( ) 1,2,...,

if for x i i m−= = = . It is specified as

24 4

1 1

( ){( ) ( ) }k k

i

k i

i x iβ −

= =

� �+ −� �

� �� �

Smaller values of beta raise difficulty in optimization.

(3) Power-sum function: Defined on four variables in the domain x ∈[0, 4], this function has fmin=0 for any permutation of x = (1, 2, 2, 3). The function is defined as

24 4

1 1

( ) ; (8, 18, 44, 114) (1, 2, 3, 4)k

k i k

k i

f x b x b for k= =

� �= − = =� �

� �� � respectively.

(4) Bukin’s functions: Bukin’s functions are almost fractal (with fine seesaw edges) in the surroundings of their minimal points. Due to this property, they are extremely difficult to optimize by any method of global (or local) optimization and find correct values of decision variables (i.e. xi for i=1,2). In the search domain

1 2[ 15, 5], [ 3, 3]x x∈ − − ∈ − the 6th Bukin’s function is defined as follows.

2

6 2 1 1( ) 100 0.01 0.01 10f x x x x= − + + ; min ( 10, 1) 0f − =

(5) Zero-sum function: Defined in the domain x ∈ [-10, 10] this function (in m ≥ 2) has

f(x) =0 if 1

0m

iix

==� . Otherwise ( )

0.5

1( ) 1 10000

m

iif x x

== + � . This function has innumerably

many minima but it is extremely difficult to obtain any of them. Larger is the value of m (dimension), it becomes more difficult to optimize the function.

(6) Hougen function: Hougen function is typical complex test for classical non-linear regression problems. The Hougen-Watson model for reaction kinetics is an example of such non-linear regression problem. The form of the model is

1 2 3 5

2 1 3 2 4 3

/

1

x xrate

x x x

β β

β β β

−=

+ + +

where the betas are the unknown parameters, 1 2 3( , , )x x x x= are

the explanatory variables and ‘rate’ is the dependent variable. The parameters are estimated via the least squares criterion. That is, the parameters are such that the sum of the squared differences between the observed responses and their fitted values of rate is minimized. The input data given alongside are used.

x1 x2 x3 rate 470 300 10 8.55

285 80 10 3.79

470 300 120 4.82

470 80 120 0.02

470 80 10 2.75

100 190 10 14.39

100 80 65 2.54

470 190 65 4.35

100 300 54 13.00

100 300 120 8.50

100 80 120 0.05

285 300 10 11.32

285 190 120 3.13

Page 4: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

3

The best results are obtained by the Rosenbrock-Quasi-Newton method:

1β̂ = 1.253031; 2β̂ = 1.190943; 3β̂ = 0.062798; 4β̂ = 0.040063; 5β̂ = 0.112453. The sum

of squares of deviations (S2) = fmin is = 0.298900994 and the coefficient of correlation (R) between observed rate and expected rate is =0.99945.

(7) Giunta function: In the search domain 1 2, [ 1, 1]x x ∈ − this function is defined as

follows and has min (0.45834282, 0.45834282) 0.0602472184f � (Silagadge, 2004),

which appears to be incorrect. We get min (0.46732, 0.46732) 0.0644704205f � . 2 16 16 1 162

15 15 50 151( ) 0.6 [sin( 1) sin ( 1) sin(4( 1))]

i i iif x x x x

== + − + − + −� .

(8) DCS function: The generalized deflected corrugated spring function is an m-variable function with min 1 2( , ,..., ) 1

mf c c c = − . In case all ci=�, then min ( , ,..., ) 1f α α α = − . For larger

dimension it is a difficult function to optimize. In particular, one of its local minimum at f(x) = -0.84334 is very attractive and most of the optimization algorithms are attracted to and trapped by that local optimum. The DCS function is defined as:

0.5

2 2

1 1

1( ) ( ) cos ( ) ; [ 20, 20]

10

m m

i i i i

i i

f x x c k x c x= =

� �� �� �= − − − ∈ −� �� �� �� � � �� �� �

� �

(9) Kowalik or Yao-Liu #15 function: It is a 4-variable function in the domain x ∈[-5, 5], that has the global minimum min (0.19,0.19,0.12,0.14) 0.3075.f = This function is given as:

2211

1 2

21 3 4

( )( ) 1000 i i

i

i i i

x b b xf x a

b b x x=

� += − �

+ +� � ; where

1 1 1 1 1 1 1 1 1 1 1, , , , , , , , , ,

0.25 0.5 1 2 4 6 8 10 12 14 16b

� = ��

and

a = (0.1957, 0.1947, 0.1735, 0.1600, 0.0844, 0.0627, 0.0456, 0.0342, 0.0323, 0.0235, 0.0246).

(10) Yao-Liu #7 function: It is an m-variable function in the domain x ∈[-1.28, 1.28], that has the global minimum min (0, 0,..., 0) 0f = . This function is given as:

4

1

( ) [0,1] ( )m

i

i

f x rand i x=

= +�

(11) Fletcher-Powell function: This is an m-variable function with min 1 2( , ,..., ) 0m

f c c c =

given as follows:

2

1

( ) ( )m

i i

i

f x A B=

= −� ,

where 1

sin( ) cos( )m

i ij j ij j

j

A u c v c=

� �= +� �� ; 1

sin( ) cos( )m

i ij j ij j

j

B u x v x=

� �= +� �� ; , [ 100, 100]ij ij

u v rand= −

and i

x , [ , ]i

c π π∈ − . Moreover, c could be stochastic or fixed. When c is fixed, it is easier

to optimize, but for stochastic c optimization is quite difficult. One may visualize c as a vector that has two parts; c1 (fixed) and r (random). Either of them could be zero or both of them could be non-zero. (12) New function 1: This function (with min (1, 1,..., 1) 2f = ) may be defined as follows:

1

1

( ) (1 ) ; ; [0, 1] 1,2,...,m

mx

m m i

i

f x x x m x x i m−

=

=

= + − ∈ ∀ =�

Page 5: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

4

This function is not very difficult to optimize. However, its modification that gives us a new function (#2) is considerably difficult. (13) New function 2: This function (with min (1, 1,..., 1) 2f = ) may be defined as follows:

1

1

1

( ) (1 ) ; ( ) / 2; [0, 1] 1, 2,...,m

mx

m m i i

i

f x x x m x x x i m−

= +=

= + − + ∈ ∀ =�

Unlike the new function #1, here xm of the prior iteration indirectly enters into the posterior iteration. As a result, this function is extremely difficult to optimize.

V. Some Details of the Particle Swarm Methods used Here: In this exercise we have used (modified) Repulsive Particle Swarm method. The Repulsive Particle Swarm method of optimization is a variant of the classical Particle Swarm method (see Wikipedia, http://en.wikipedia.org/wiki/RPSO). It is particularly effective in finding out the global optimum in very complex search spaces (although it may be slower on certain types of optimization problems).

In the traditional RPS the future velocity, 1iv + of a particle at position with a recent

velocity, i

v , and the position of the particle are calculated by:

1 1 2 3

1 1

ˆ ˆ( ) ( )i i i i hi i

i i i

v v r x x r x x r z

x x v

ω α ωβ ωγ+

+ +

= + − + − +

= +

where,

• x is the position and v is the velocity of the individual particle. The subscripts i and 1i + stand for the recent and the next (future) iterations, respectively.

• 1 2 3,r r r are random numbers, ∈[0,1]

• ω is inertia weight, ∈[0.01,0.7]

• x̂ is the best position of a particle

• h

x is best position of a randomly chosen other particle from within the swarm

• z is a random velocity vector

• , ,α β γ are constants

Occasionally, when the process is caught in a local optimum, some chaotic perturbation in position as well as velocity of some particle(s) may be needed.

The traditional RPS gives little scope of local search to the particles. They are

guided by their past experience and the communication received from the others in the swarm. We have modified the traditional RPS method by endowing stronger (wider) local search ability to each particle. Each particle flies in its local surrounding and searches for a better solution. The domain of its search is controlled by a new parameter (nstep). This local search has no preference to gradients in any direction and resembles closely to tunneling. This added exploration capability of the particles brings the RPS method closer to what we observe in real life.

Each particle learns from its ‘chosen’ inmates in the swarm. At the one extreme is

to learn from the best performer in the entire swarm. This is how the particles in the original PS method learn. However, such learning is not natural. How can we expect the

Page 6: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

5

individuals to know as to the best performer and interact with all others in the swarm? We believe in limited interaction and limited knowledge that any individual can possess and acquire. So, our particles do not know the ‘best’ in the swarm. Nevertheless, they interact with some chosen inmates that belong to the swarm. Now, the issue is: how does the particle choose its inmates? One of the possibilities is that it chooses the inmates closer (at lesser distance) to it. But, since our particle explores the locality by itself, it is likely that it would not benefit much from the inmates closer to it. Other relevant topologies are : (the celebrated) ring topology, ���������������� ��� ��������� ���������,

star topology, ���������������� �, etc.

Now, let us visualize the possibilities of choosing (a predetermined number of)

inmates randomly from among the members of the swarm. This is much closer to reality in the human world. When we are exposed to the mass media, we experience this. Alternatively, we may visualize our particles visiting a public place (e.g. railway platform, church, etc) where it (he) meets people coming from different places. Here, geographical distance of an individual from the others is not important. Important is how the experiences of others are communicated to us. There are large many sources of such information, each one being selective in what it broadcasts and each of us selective in what we attend to and, therefore, receive. This selectiveness at both ends transcends the geographical boundaries and each one of us is practically exposed to randomized information. Of course, two individuals may have a few common sources of information. We have used these arguments in the scheme of dissemination of others’ experiences to each individual particle. Presently, we have assumed that each particle chooses a pre-assigned number of inmates (randomly) from among the members of the swarm. However, this number may be randomized to lie between two pre-assigned limits.

VI. Some Details of the Differential Evolution Methods used Here: The differential Evolution method consists of three basic steps: (i) generation of (large enough) population with N individuals [x = (x1, x2, …, xm )] in the m-dimensional space, randomly distributed over the entire domain of the function in question and evaluation of the individuals of the so generated by finding f(x); (ii) replacement of this current population by a better fit new population, and (iii) repetition of this replacement until satisfactory results are obtained or certain criteria of termination are met.

The crux of the problem lays in replacement of the current population by a new population that is better fit. Here the meaning of ‘better’ is in the Pareto improvement sense. A set Sa is better than another set Sb iff : (i) no xi ∈Sa is inferior to the corresponding member xi∈Sb ; and (ii) at least one member xk ∈Sa is better than the corresponding member xk∈Sb. Thus, every new population is an improvement over the earlier one. To accomplish this, the DE method generates a candidate individual to replace each current individual in the population. The candidate individual is obtained by a crossover of the current individual and three other randomly selected individuals from the current population. The crossover itself is probabilistic in nature. Further, if the candidate individual is better fit than the current individual, it takes the place of the current individual, else the current individual stays and passes into the next iteration.

Page 7: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

6

Algorithmically stated, initially, a population of points (p in d-dimensional space) is generated and evaluated (i.e. f(p) is obtained) for their fitness. Then for each point (pi) three different points (pa, pb and pc) are randomly chosen from the population. A new point (pz) is constructed from those three points by adding the weighted difference between two points (w(pb-pc)) to the third point (pa). Then this new point (pz) is subjected to a crossover with the current point (pi) with a probability of crossover (cr), yielding a candidate point, say pu. This point, pu, is evaluated and if found better than pi then it replaces pi else pi remains. Thus we obtain a new vector in which all points are either better than or as good as the current points. This new vector is used for the next iteration. This process makes the differential evaluation scheme completely self-organizing.

The crossover scheme (called exponential crossover, as suggested by Kenneth Price in his personal letter to the author) is given below.

The mutant vector is vi,g = xr1,g + F*(xr2,g - xr3,g) and the target vector is xi,g and the trial vector is ui,g. The indices r1, r2 and r3 are randomly but different from each other. Uj(0,1) is a uniformly distributed random number between 0 and 1 that is chosen anew for each parameter as needed.

Step 1: Randomly pick a parameter index j = jrand.

Step 2: The trial vector inherits the jth parameter (initially = jrand) from the mutant vector, i.e., uj,i,g = vj,i,g.

Step 3: Increment j; if j = D then reset j = 0.

Step 4: If j = jrand end crossover; else goto Step 5.

Step 5: If Cr <= Uj(0,1), then goto Step 2; else goto Step 6

Step 6: The trial vector inherits the jth parameter from the target vector, i.e., uj,i,g = xj,i,g.

Step 7: Increment j; if j = D then reset j = 0.

Step 8: If j = jrand end crossover; else goto Step 6.

There could be other schemes (as many as 10 in number) of crossover, including no crossover (probabilistic replacement only, which works better in case of a few functions).

VII. Specification of Adjustable Parameters: The RPS as well as the DE method needs some parameters to be specified by the user. In case of the RPS we have fixed the parameters as follows:

Population size, N=100; neighbour population, NN=50; steps for local search, NSTEP=11; Max no. of iterations permitted, ITRN=10000; chaotic perturbation allowed, NSIGMA=1; selection of neighbour : random, ITOP=3; A1=A2=0.5; A3=5.e-04; W=.5; SIGMA=1.e-03; EPSI=1.d-08. Meanings of these parameters are explained in the programs (appended).

Page 8: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

7

In case of the DE, we have used two alternatives: first, the exponential crossover (ncross=1) as suggested by Price, and the second, only probabilistic replacement (but no crossover, ncross=0). We have fixed other parameters as: max number of iterations allowed, Iter = 10000, population size, N = 10 times of the dimension of the function or 100 whichever maximum; pcros = 0.9; scale factor, fact = 0.5, random number seed, iu = 1111 and all random numbers are uniformly distributed between -1000 and 1000; accuracy needed, eps =1.0e-08.

In case of either method, if x in f(x) violates the boundary then it is forcibly brought within the specified limits through replacing it by a random number lying in the given limits of the function concerned.

VIII. Findings and Discussion: Our findings are summarized in tables #1 through #3. The first table presents the results of the DE method when used with the exponential crossover scheme, while the table #2 presents the results of DE with no crossover (only probabilistic replacement). Table #3 presents the results of the RPS method. A perusal of table #1 suggests that DE (with the exponential crossover scheme) mostly fails to find the optimum. Of course, it succeeds in case of some functions (perm#2, zero-sum) for very small dimension (m), but begins to falter as soon as the dimension is increased. In case of DCS function, it works well up to m (dimension) = 5.

Table-1: Differential Evolution (with exponential crossover: Ncross=1, Cr = 0.9, F = 0.5)

��������� M=2 M=4 M=5 M=10 M=20 M=30 M=50 M=100

Bukin-6 0.01545 - - - - - - -

Giunta 0.06447 - - - - - - -

Perm #1 - 2.45035 - - - - - -

Power-Sum - 0.00752 - - - - - -

Kowalik - 0.36724 - - - - - -

Hougen - - 0.34228 - - - - -

New Fn #2 2.05349 2.03479 2.12106 2.57714

Fletcher 0.02288 0.72118 3.13058 12027.6

Perm #2 0 0.00549 0.07510 0.01005 0.15991

Yao-Liu#7 0.02924 0.02244 0.03338 0.04643 0.19073 0.27375 0.51610

Zero-Sum 0 1.73194 1.70313 1.26159 1.13372 1.74603 1.70230 1.22196

DCS -1 -0.99994 -0.99994 -0.84334 -0.84334 0.40992 0.40992 1.50650

Table-2: Differential Evolution (without crossover: Ncross = 0, Cr = 0.9, F = 0.5)

��������� M=2 M=4 M=5 M=10 M=20 M=30 M=50 M=100

Bukin-6 0.02132 - - - - - - -

Giunta 0.06447 - - - - - - -

Perm #1 - 0.00000 - - - - - -

Power-Sum - 0.00000 - - - - - -

Kowalik - 0.30745 - - - - - -

Hougen - - 0.29890 - - - - -

New Fn #2 2.03031 2.11842 2.11040 2.57009

Fletcher 0.00862 2.84237 7.09278 261.377

Perm #2 0 0.00009 0.00011 0.07219 13.355

Yao-Liu#7 0.02984 0.00668 0.02467 0.02396 0.21920 0.22435 0.31691

Zero-Sum 0 0 0 0 0 0 1.32197 1.30459

DCS -1 -1 -0.84334 -0.84334 -0.84334 -0.37336 -0.37302 -0.37302

Page 9: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

8

When we use no crossover (only probabilistic replacement) we obtain better results in case of several of the functions under study. Thus, overall, table #2 presents better results than what table #1 does. In case of Perm#1, Perm#2, Zero-sum, Kowalik, Hougen and Power-sum functions the advantage is clear.

Whether crossover or no crossover, DE falters when the optimand function has

some element of randomness. This is indicated by the functions: Yao-Liu#7, Fletcher-Powell, and “New function#2”. DE has no problems in optimizing the “New function #1”. But the “New function #2” proves to be a hard nut. However, RPS performs much better for such stochastic functions. When the Fletcher-Powell function is optimized with non-stochastic c vector, DE works fine. But as soon as c is stochastic, it becomes unstable. Thus, it may be observed that an introduction of stochasticity into the decision

variables (or simply added to the function as in Yao-Liu#7) interferes with the

fundamentals of DE, which works through attainment of better and better (in the sense of

Pareto improvement) population at each successive iteration.

Table-3: Repulsive Particle Swarm ��������� M=2 M=4 M=5 M=10 M=20 M=30 M=50 M=100 Bukin-6 0.75649 - - - - - - - Giunta 0.06447 - - - - - - - Perm #1 - 0.00000 - - - - - - Power-Sum - 0.00000 - - - - - - Kowalik - 0.30749 - - - - - - Hougen - - 0.42753 - - - - - New Fn #2 2.00000 2.00021 2.00115 2.00644 Fletcher 0.00003 0.09582 0.92413 40.70962 Perm #2 0 0.00006 0.00011 0.00008 1.17420 Yao-Liu#7 0.00000 0.00002 0.00000 0.00003 0.00007 0.00050 0.00060 Zero-Sum 1.12312 1.14119 1.19259 1.21672 1.44780 1.02749 1.18303 1.56457 DCS -1 -1 -1 -0.84334 -0.84334 -0.37336 -0.37336 11.68769

IX. Conclusion: Ours is a very small sample of test functions that we have used to compare DE (with and without crossover) and RPS methods. So the limitations of our conclusions are obvious. However, if any indication is obtained, those are: (1) for different types of problems, different schemes of crossover (including none) may be suitable or unsuitable, (2) Stochasticity entering into the optimand function may make DE unstable, but RPS may function well.

Page 10: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

9

Bibliography

• Bauer, J.M.: “Harnessing the Swarm: Communication Policy in an Era of Ubiquitous Networks

and Disruptive Technologies”, Communications and Strategies, 45, 2002.

• Box, M.J.: “A New Method of Constrained Optimization and a Comparison with Other Methods”. Comp. J. 8, pp. 42-52, 1965.

• Bukin, A. D.: New Minimization Strategy For Non-Smooth Functions, Budker Institute of Nuclear Physics preprint BUDKER-INP-1997-79, Novosibirsk 1997.

• Cerny, V.: "Thermodynamical Approach to the Traveling Salesman Problem: An Efficient Simulation Algorithm", J. Opt. Theory Appl., 45, 1, 41-51, 1985.

• Eberhart R.C. and Kennedy J.: “A New Optimizer using Particle Swarm Theory”, Proceedings

Sixth Symposium on Micro Machine and Human Science, pp. 39–43. IEEE Service Center, Piscataway, NJ, 1995.

• Fleischer, M.: “Foundations of Swarm Intelligence: From Principles to Practice”, Swarming Network Enabled C4ISR, arXiv:nlin.AO/0502003 v1 2 Feb 2005.

• G.E.P. Box, “Evolutionary Operation: A Method for Increasing Industrial Productivity”, Applied

Statistics, 6 , pp. 81-101, 1957.

• Glover F.," Future Paths for Integer Programming and Links to Artificial Intelligence", Computers

and Operations Research, 5:533-549, 1986.

• Hayek, F.A.: The Road to Serfdom, Univ. of Chicago Press, Chicago, 1944.

• Holland, J.: Adaptation in Natural and Artificial Systems, Univ. of Michigan Press, Ann Arbor, 1975.

• Karush, W. Minima of Functions of Several Variables with Inequalities as Side Constraints. M.Sc. Dissertation. Dept. of Mathematics, Univ. of Chicago, Chicago, Illinois, 1939.

• Kirkpatrick, S., Gelatt, C.D. Jr., and Vecchi, M.P.: "Optimization by Simulated Annealing", Science, 220, 4598, 671-680, 1983.

• Krink, T., Filipi�, B., Fogel, G.B. and Thomsen, R.: “Noisy Optimization Problems – A Particular Challenge for Differential Evolution?”, 0-7803-8515-2/04/$20.00©2004 IEEE, pp. 332-339, 2004.

• Kuhn, H.W. and Tucker, A.W.: “Nonlinear Programming”, in Neymann, J. (ed) Proceedings of

Second Berkeley Symposium on Mathematical Statistics and Probability, Univ. of California Press, Berkrley, Calif. pp. 481-492, 1951.

• Metropolis, N. The Beginning of the Monte Carlo Method. Los Alamos Science, No. 15, Special Issue, pp. 125-130, 1987.

• Metropolis, N., Rosenbluth, A., Rosenbluth, M., Teller, A., and Teller, E.: "Equation of State Calculations by Fast Computing Machines", J. Chem. Phys.,21, 6, 1087-1092, 1953.

• Mishra, S.K.: “Some Experiments on Fitting of Gielis Curves by Simulated Annealing and Particle Swarm Methods of Global Optimization”, Social Science Research Network (SSRN): http://ssrn.com/abstract=913667, Working Papers Series, 2006 (a).

• Mishra, S.K.: “Least Squares Fitting of Chacón-Gielis Curves by the Particle Swarm Method of Optimization”, Social Science Research Network (SSRN), Working Papers Series, http://ssrn.com/abstract=917762 , 2006 (b).

• Mishra, S.K.: “Performance of Repulsive Particle Swarm Method in Global Optimization of Some Important Test Functions: A Fortran Program” , Social Science Research Network (SSRN), Working Papers Series, http://ssrn.com/abstract=924339 , 2006 (c).

• Mishra, S.K.: “Some New Test Functions for Global Optimization and Performance of Repulsive Particle Swarm Method”, Social Science Research Network (SSRN) Working Papers Series, http://ssrn.com/abstract=927134, 2006 (d).

• Mishra, S.K.: “Repulsive Particle Swarm Method on Some Difficult Test Problems of Global Optimization” ,SSRN: http://ssrn.com/abstract=928538 , 2006 (e).

• Mishra, S.K.: “Global Optimization by Differential Evolution and Particle Swarm Methods: Evaluation on Some Benchmark Functions”. SSRN: http://ssrn.com/abstract=933827 , 2006 (f).

Page 11: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

10

• Nagendra, S.: Catalogue of Test Problems for Optimization Algorithm Verification, Technical Report 97-CRD-110, General Electric Company, 1997.

• Nelder, J.A. and Mead, R.: “A Simplex Method for Function Minimization” Computer Journal, 7: pp. 308-313, 1964.

• Parsopoulos, K.E. and Vrahatis, M.N., “Recent Approaches to Global Optimization Problems Through Particle Swarm Optimization”, Natural Computing, 1 (2-3), pp. 235- 306, 2002.

• Prigogine, I. and Strengers, I.: Order Out of Chaos: Man’s New Dialogue with Nature, Bantam Books, Inc. NY, 1984.

• Silagadge, Z.K.: “Finding Two-Dimensional Peaks”, Working Paper, Budkar Insttute of Nuclear Physics, Novosibirsk, Russia, arXive:physics/0402085 V3 11 Mar 2004.

• Simon, H.A.: Models of Bounded Rationality, Cambridge Univ. Press, Cambridge, MA, 1982.

• Smith, A.: The Theory of the Moral Sentiments, The Adam Smith Institute (2001 e-version), 1759.

• Sumper, D.J.T.: “The Principles of Collective Animal Behaviour”, Phil. Trans. R. Soc. B. 361, pp. 5-22, 2006.

• Törn, A.A and Viitanen, S.: “Topographical Global Optimization using Presampled Points”, J. of

Global Optimization, 5, pp. 267-276, 1994.

• Törn, A.A.: “A search Clustering Approach to Global Optimization” , in Dixon, LCW and Szegö, G.P. (Eds) Towards Global Optimization – 2, North Holland, Amsterdam, 1978.

• Tsallis, C. and Stariolo, D.A.: “Generalized Simulated Annealing”, ArXive condmat/9501047 v1

12 Jan, 1995.

• Valentine, R.H.: Travel Time Curves in Oblique Structures, Ph.D. Dissertation, MIT, Mass, 1937.

• Veblen, T.B.: "Why is Economics Not an Evolutionary Science" The Quarterly Journal of

Economics, 12, 1898.

• Veblen, T.B.: The Theory of the Leisure Class, The New American library, NY. (Reprint, 1953), 1899.

• Vesterstrøm, J. and Thomsen, R.: “A Comparative Study of Differential Evolution, Particle Swarm Optimization, and Evolutionary Algorithms on Numerical Benchmark Problems”, Congress on Evolutionary Computation, 2004. CEC2004, 2, pp. 1980-1987, 2004.

• Whitley, D., Mathias, K., Rana, S. and Dzubera, J.: “Evaluating Evolutionary Algorithms”, Artificial Intelligence, 85, pp. 245-276, 1996.

• Yao, X. and Liu, Y.: “Fast Evolutionary Programming”, in Fogel, LJ, Angeline, PJ and Bäck, T (eds) Proc. 5

th Annual Conf. on Evolutionary programming, pp. 451-460, MIT Press, Mass, 1996.

Page 12: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 1/1810/16/2006 7:32:50 AM

1: C MAIN PROGRAM : PROVIDES TO USE REPULSIVE PARTICLE SWARM METHOD2: C (SUBROUTINE RPS) AND DIFFERENTIAL WVOLUTION METHOD (DE)3: c -----------------------------------------------------------------

4: c Adjust the parameters suitably in subroutines DE and RPS

5: c When the program asks for parameters, feed them suitably

6: c -----------------------------------------------------------------

7: PROGRAM DERPS

8: IMPLICIT DOUBLE PRECISION (A-H, O-Z)

9: COMMON /KFF/KF,NFCALL ! FUNCTION CODE AND NO. OF FUNCTION CALLS10: CHARACTER *30 METHOD(2)

11: CHARACTER *1 PROCEED

12: DIMENSION XX(2,100),KKF(2),MM(2),FMINN(2)

13: DIMENSION X(100)! X IS THE DECISION VARIABLE X IN F(X) TO MINIMIZE14: C M IS THE DIMENSION OF THE PROBLEM, KF IS TEST FUNCTION CODE AND15: C FMIN IS THE MIN VALUE OF F(X) OBTAINED FROM DE OR RPS16:

17: WRITE(*,*)'Adjust the parameters suitably in subroutines DE & RPS'

18: WRITE(*,*)'==================== WARNING =============== '

19: METHOD(1)=' : DIFFERENTIAL EVALUATION'

20: METHOD(2)=' : REPULSIVE PARTICLE SWARM'

21: DO I=1,2

22:

23: IF(I.EQ.1) THEN24: WRITE(*,*)'============ DIFFERENTIAL EVOLUTION PROGRAM =========='

25: WRITE(*,*)'TO PROCEED TYPE ANY CHARACTER AND STRIKE ENTER'

26: READ(*,*) PROCEED

27: CALL DE(M,X,FMINDE) ! CALLS DE AND RETURNS OPTIMAL X AND FMIN28: FMIN=FMINDE

29: ELSE30: WRITE(*,*)' '

31: WRITE(*,*)' '

32: WRITE(*,*)'==========REPULSIVE PARTICLE SWARM PROGRAM =========='

33: WRITE(*,*)'TO PROCEED TYPE ANY CHARACTER AND STRIKE ENTER'

34: READ(*,*) PROCEED

35: CALL RPS(M,X,FMINRPS) ! CALLS RPS AND RETURNS OPTIMAL X AND FMIN36: FMIN=FMINRPS

37: ENDIF38: DO J=1,M

39: XX(I,J)=X(J)

40: ENDDO41: KKF(I)=KF

42: MM(I)=M

43: FMINN(I)=FMIN

44: ENDDO45: WRITE(*,*)' '

46: WRITE(*,*)' '

47: WRITE(*,*)'---------------------- FINAL RESULTS=================='

48: DO I=1,2

49: WRITE(*,*)'FUNCT CODE=',KKF(I),' FMIN=',FMINN(I),' : DIM=',MM(I)

50: WRITE(*,*)'OPTIMAL DECISION VARIABLES : ',METHOD(I)

51: WRITE(*,*)(XX(I,J),J=1,M)

52: WRITE(*,*)'/////////////////////////////////////////////////////'

53: ENDDO54: WRITE(*,*)'PROGRAM ENDED'

55: END56: C -----------------------------------------------------------------57: SUBROUTINE DE(M,A,FBEST)

58: C PROGRAM: "DIFFERENTIAL EVOLUTION ALGORITHM" OF GLOBAL OPTIMIZATION59: C THIS METHOD WAS PROPOSED BY R. STORN AND K. PRICE IN 1995. REF --60: C "DIFFERENTIAL EVOLUTION - A SIMPLE AND EFFICIENT ADAPTIVE SCHEME61: C FOR GLOBAL OPTIMIZATION OVER CONTINUOUS SPACES" : TECHNICAL REPORT62: C INTERNATIONAL COMPUTER SCIENCE INSTITUTE, BERKLEY, 1995.63: C PROGRAM BY SK MISHRA, DEPT. OF ECONOMICS, NEHU, SHILLONG (INDIA)64: C -----------------------------------------------------------------65: C PROGRAM EVOLDIF66: IMPLICIT DOUBLE PRECISION (A-H, O-Z) ! TYPE DECLARATION67: PARAMETER(NMAX=1000,MMAX=100) ! MAXIMUM DIMENSION PARAMETERS

1/18

Page 13: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 2/1810/16/2006 7:32:50 AM

68: PARAMETER(NCROSS=1) ! CROSS-OVER SCHEME (NCROSS <=0 OR =>1)69: PARAMETER(IPRINT=500,EPS=1.D-08)!FOR WATCHING INTERMEDIATE RESULTS70: C IT PRINTS THE INTERMEDIATE RESULTS AFTER EACH IPRINT ITERATION AND71: C EPS DETERMINES ACCURACY FOR TERMINATION. IF EPS= 0, ALL ITERATIONS72: C WOULD BE UNDERGONE EVEN IF NO IMPROVEMENT IN RESULTS IS THERE.73: C ULTIMATELY "DID NOT CONVERGE" IS REOPORTED.74: COMMON /RNDM/IU,IV ! RANDOM NUMBER GENERATION (IU = 4-DIGIT SEED)75: INTEGER IU,IV ! FOR RANDOM NUMBER GENERATION76: COMMON /KFF/KF,NFCALL ! FUNCTION CODE AND NO. OF FUNCTION CALLS77: CHARACTER *70 FTIT ! TITLE OF THE FUNCTION78: C -----------------------------------------------------------------79: C THE PROGRAM REQUIRES INPUTS FROM THE USER ON THE FOLLOWING ------80: C (1) FUNCTION CODE (KF), (2) NO. OF VARIABLES IN THE FUNCTION (M);81: C (3) N=POPULATION SIZE (SUGGESTED 10 TIMES OF NO. OF VARIABLES, M,82: C FOR SMALLER PROBLEMS N=100 WORKS VERY WELL);83: C (4) PCROS = PROB. OF CROSS-OVER (SUGGESTED : ABOUT 0.85 TO .99);84: C (5) FACT = SCALE (SUGGESTED 0.5 TO .95 OR SO);85: C (6) ITER = MAXIMUM NUMBER OF ITERATIONS PERMITTED (5000 OR MORE)86: C (7) RANDOM NUMBER SEED (4 DIGITS INTEGER)87: C ----------------------------------------------------------------88: DIMENSION X(NMAX,MMAX),Y(NMAX,MMAX),A(MMAX),FV(NMAX)

89: DIMENSION IR(3)

90: C ----------------------------------------------------------------91: C ------- SELECT THE FUNCTION TO MINIMIZE AND ITS DIMENSION -------92: CALL FSELECT(KF,M,FTIT)

93: C SPECIFY OTHER PARAMETERS ---------------------------------------94: WRITE(*,*)'POPULATION SIZE [N] AND NO. OF ITERATIONS [ITER] ?'

95: WRITE(*,*)'SUGGESTED: MAX(100, 10.M); ITER 10000 OR SO'

96: READ(*,*) N,ITER

97: WRITE(*,*)'CROSSOVER PROBABILITY [PCROS] AND SCALE [FACT] ?'

98: WRITE(*,*)'SUGGESTED: PCROS ABOUT 0.9; FACT=.5 OR LARGER BUT <=1'

99: READ(*,*) PCROS,FACT

100: WRITE(*,*)'RANDOM NUMBER SEED ?'

101: WRITE(*,*)'A FOUR-DIGIT POSITIVE ODD INTEGER, SAY, 1171'

102: READ(*,*) IU

103:

104: NFCALL=0 ! INITIALIZE COUNTER FOR FUNCTION CALLS105: GBEST=1.D30 ! TO BE USED FOR TERMINATION CRITERION106: C INITIALIZATION : GENERATE X(N,M) RANDOMLY107: DO I=1,N

108: DO J=1,M

109: CALL RANDOM(RAND)

110: X(I,J)=(RAND-.5D00)*2000

111: C RANDOM NUMBERS BETWEEN -RRANGE AND +RRANGE (BOTH EXCLUSIVE)112: ENDDO113: ENDDO114: WRITE(*,*)'COMPUTING --- PLEASE WAIT '

115: IPCOUNT=0

116: DO 100 ITR=1,ITER ! ITERATION BEGINS117:

118: C EVALUATE ALL X FOR THE GIVEN FUNCTION119: DO I=1,N

120: DO J=1,M

121: A(J)=X(I,J)

122: ENDDO123: CALL FUNC(A,M,F)

124: C STORE FUNCTION VALUES IN FV VECTOR125: FV(I)=F

126: ENDDO127: C ----------------------------------------------------------------128: C FIND THE FITTEST (BEST) INDIVIDUAL AT THIS ITERATION129: FBEST=FV(1)

130: KB=1

131: DO IB=2,N

132: IF(FV(IB).LT.FBEST) THEN133: FBEST=FV(IB)

134: KB=IB

2/18

Page 14: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 3/1810/16/2006 7:32:50 AM

135: ENDIF136: ENDDO137: C BEST FITNESS VALUE = FBEST : INDIVIDUAL X(KB)138: C -----------------------------------------------------------------139: C GENERATE OFFSPRINGS140: DO I=1,N ! I LOOP BEGINS141: C INITIALIZE CHILDREN IDENTICAL TO PARENTS; THEY WILL CHANGE LATER142: DO J=1,M

143: Y(I,J)=X(I,J)

144: ENDDO145: C SELECT RANDOMLY THREE OTHER INDIVIDUALS146: 20 DO IRI=1,3 ! IRI LOOP BEGINS147: IR(IRI)=0

148:

149: CALL RANDOM(RAND)

150: IRJ=INT(RAND*N)+1

151: C CHECK THAT THESE THREE INDIVIDUALS ARE DISTICT AND OTHER THAN I152: IF(IRI.EQ.1.AND.IRJ.NE.I) THEN153: IR(IRI)=IRJ

154: ENDIF155: IF(IRI.EQ.2.AND.IRJ.NE.I.AND.IRJ.NE.IR(1)) THEN156: IR(IRI)=IRJ

157: ENDIF158: IF(IRI.EQ.3.AND.IRJ.NE.I.AND.IRJ.NE.IR(1).AND.IRJ.NE.IR(2)) THEN159: IR(IRI)=IRJ

160: ENDIF161: ENDDO ! IRI LOOP ENDS162: C CHECK IF ALL THE THREE IR ARE POSITIVE (INTEGERS)163: DO IX=1,3

164: IF(IR(IX).LE.0) THEN165: GOTO 20 ! IF NOT THEN REGENERATE166: ENDIF167: ENDDO168: C THREE RANDOMLY CHOSEN INDIVIDUALS DIFFERENT FROM I AND DIFFERENT169: C FROM EACH OTHER ARE IR(1),IR(2) AND IR(3)170: C ----------------------------------------------------------------171: C NO CROSS OVER, ONLY REPLACEMENT THAT IS PROBABILISTIC172: IF(NCROSS.LE.0) THEN173: DO J=1,M ! J LOOP BEGINS174: CALL RANDOM(RAND)

175: IF(RAND.LE.PCROS) THEN ! REPLACE IF RAND < PCROS176: A(J)=X(IR(1),J)+(X(IR(2),J)-X(IR(3),J))*FACT ! CANDIDATE CHILD177: ENDIF178: ENDDO ! J LOOP ENDS179: ENDIF180:

181: C -----------------------------------------------------------------182: C CROSSOVER SCHEME (EXPONENTIAL) SUGGESTED BY KENNETH PRICE IN HIS183: C PERSONAL LETTER TO THE AUTHOR (DATED SEPTEMBER 29, 2006)184: IF(NCROSS.GE.1) THEN185: CALL RANDOM(RAND)

186: 1 JR=INT(RAND*M)+1

187: J=JR

188: 2 A(J)=X(IR(1),J)+FACT*(X(IR(2),J)-X(IR(3),J))

189: 3 J=J+1

190: IF(J.GT.M) J=1

191: 4 IF(J.EQ.JR) GOTO 10

192: 5 CALL RANDOM(RAND)

193: IF(PCROS.LE.RAND) GOTO 2

194: 6 A(J)=X(I,J)

195: 7 J=J+1

196: IF(J.GT.M) J=1

197: 8 IF (J.EQ.JR) GOTO 10

198: 9 GOTO 6

199: 10 CONTINUE200: ENDIF201: C -----------------------------------------------------------------

3/18

Page 15: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 4/1810/16/2006 7:32:50 AM

202: CALL FUNC(A,M,F) ! EVALUATE THE OFFSPRING203: IF(F.LT.FV(I)) THEN ! IF BETTER, REPLACE PARENTS BY THE CHILD204: FV(I)=F

205: DO J=1,M

206: Y(I,J)=A(J)

207: ENDDO208: ENDIF209: ENDDO ! I LOOP ENDS210: DO I=1,N

211: DO J=1,M

212: X(I,J)=Y(I,J) ! NEW GENERATION IS A MIX OF BETTER PARENTS AND213: C BETTER CHILDREN214: ENDDO215: ENDDO216: IPCOUNT=IPCOUNT+1

217: IF(IPCOUNT.EQ.IPRINT) THEN218: DO J=1,M

219: A(J)=X(KB,J)

220: ENDDO221: WRITE(*,*)(X(KB,J),J=1,M),' FBEST UPTO NOW = ',FBEST

222: WRITE(*,*)'TOTAL NUMBER OF FUNCTION CALLS =',NFCALL

223: IF(DABS(FBEST-GBEST).LT.EPS) THEN224: WRITE(*,*) FTIT

225: WRITE(*,*)'COMPUTATION OVER'

226: RETURN227: ELSE228: GBEST=FBEST

229: ENDIF230: IPCOUNT=0

231: ENDIF232: C ----------------------------------------------------------------233: 100 ENDDO ! ITERATION ENDS : GO FOR NEXT ITERATION, IF APPLICABLE234: C ----------------------------------------------------------------235: WRITE(*,*)'DID NOT CONVERGE. REDUCE EPS OR RAISE ITER OR DO BOTH'

236: WRITE(*,*)'INCREASE N, PCROS, OR SCALE FACTOR (FACT)'

237: RETURN238: END239: C -----------------------------------------------------------------240: C RANDOM NUMBER GENERATOR (UNIFORM BETWEEN 0 AND 1 - BOTH EXCLUSIVE)241: SUBROUTINE RANDOM(RAND1)

242: DOUBLE PRECISION RAND1

243: COMMON /RNDM/IU,IV

244: INTEGER IU,IV

245: RAND=REAL(RAND1)

246: IV=IU*65539

247: IF(IV.LT.0) THEN248: IV=IV+2147483647+1

249: ENDIF250: RAND=IV

251: IU=IV

252: RAND=RAND*0.4656613E-09

253: RAND1= (RAND)

254: RETURN255: END256: C -----------------------------------------------------------------257: SUBROUTINE FSELECT(KF,M,FTIT)

258: C THE PROGRAM REQUIRES INPUTS FROM THE USER ON THE FOLLOWING ------259: C (1) FUNCTION CODE (KF), (2) NO. OF VARIABLES IN THE FUNCTION (M);260: CHARACTER *70 TIT(100),FTIT

261: WRITE(*,*)'----------------------------------------------------'

262: DATA TIT(1)/'KF=1 NEW ZERO-SUM FUNCTION (N#7) M-VARIABLES M=?'/

263: DATA TIT(2)/'KF=2 PERM FUNCTION #1 (SET BETA) 4-VARIABLES M=4'/

264: DATA TIT(3)/'KF=3 PERM FUNCTION #2 (SET BETA) M-VARIABLES M=?'/

265: DATA TIT(4)/'KF=4 POWER-SUM FUNCTION 4-VARIABLES M=4'/

266: DATA TIT(5)/'KF=5 BUKIN 6TH FUNCTION 2-VARIABLES M=2'/

267: DATA TIT(6)/'KF=6 DEFL CORRUG SPRING FUNCTION M-VARIABLES M=?'/

268: DATA TIT(7)/'KF=7 YAO-LIU FUNCTION#7 M-VARIABLES M=?'/

4/18

Page 16: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 5/1810/16/2006 7:32:50 AM

269: DATA TIT(8)/'KF=8 HOUGEN FUNCTION : 5-VARIABLES M=5'/

270: DATA TIT(9)/'KF=9 GIUNTA FUNCTION : 2-VARIABLES M=2'/

271: DATA TIT(10)/'KF=10 KOWALIK FUNCTION : 4-VARIABLES M=4'/

272: DATA TIT(11)/'KF=11 FLETCHER-POWELL FUNCTION : M-VARIABLES M=?'/

273: DATA TIT(12)/'KF=12 NEW NFUNCT#1 FUNCTION : M-VARIABLES M=?'/

274: DATA TIT(13)/'KF=13 NEW NFUNCT#2 FUNCTION : M-VARIABLES M=?'/

275: DATA TIT(14)/'KF=14 WOOD FUNCTION : 4-VARIABLES M=4'/

276: DATA TIT(15)/'KF=15 FENTON-EASON FUNCTION : 2-VARIABLES M=2'/

277: DATA TIT(16)/'KF=16 TYPICAL NON-LINEAR FUNCTION:M-VARIABLES M=?'/

278: DATA TIT(17)/'KF=17 WILD FUNCTION : M-VARIABLES M=?'/

279: C -----------------------------------------------------------------280: DO I=1,17

281: WRITE(*,*)TIT(I)

282: ENDDO283: WRITE(*,*)'----------------------------------------------------'

284: WRITE(*,*)'FUNCTION CODE [KF] AND NO. OF VARIABLES [M] ?'

285: READ(*,*) KF,M

286: FTIT=TIT(KF) ! STORE THE NAME OF THE CHOSEN FUNCTION IN FTIT287: RETURN288: END289: C -----------------------------------------------------------------290: C =================== REPULSIVE PARTICLE SWARM ====================291: SUBROUTINE RPS(M,BST,FMINIM)

292: C PROGRAM TO FIND GLOBAL MINIMUM BY REPULSIVE PARTICLE SWARM METHOD293: C WRITTEN BY SK MISHRA, DEPT. OF ECONOMICS, NEHU, SHILLONG (INDIA)294: C -----------------------------------------------------------------295: PARAMETER(N=100,NN=50,MX=100,NSTEP=11,ITRN=100000,NSIGMA=1,ITOP=3)

296: PARAMETER (NPRN=500) ! ECHOS RESULTS AT EVERY 500 TH ITERATION297: C PARAMETER(N=50,NN=25,MX=100,NSTEP=9,ITRN=10000,NSIGMA=1,ITOP=3)298: C PARAMETER (N=100,NN=15,MX=100,NSTEP=9,ITRN=10000,NSIGMA=1,ITOP=3)299: C IN CERTAIN CASES THE ONE OR THE OTHER SPECIFICATION WORKS BETTER300: C DIFFERENT SPECIFICATIONS OF PARAMETERS MAY SUIT DIFFERENT TYPES301: C OF FUNCTIONS OR DIMENSIONS - ONE HAS TO DO SOME TRIAL AND ERROR302: C -----------------------------------------------------------------303: C N = POPULATION SIZE. IN MOST OF THE CASES N=30 IS OK. ITS VALUE304: C MAY BE INCREASED TO 50 OR 100 TOO. THE PARAMETER NN IS THE SIZE OF305: C RANDOMLY CHOSEN NEIGHBOURS. 15 TO 25 (BUT SUFFICIENTLY LESS THAN306: C N) IS A GOOD CHOICE. MX IS THE MAXIMAL SIZE OF DECISION VARIABLES.307: C IN F(X1, X2,...,XM) M SHOULD BE LESS THAN OR EQUAL TO MX. ITRN IS308: C THE NO. OF ITERATIONS. IT MAY DEPEND ON THE PROBLEM. 200(AT LEAST)309: C TO 500 ITERATIONS MAY BE GOOD ENOUGH. BUT FOR FUNCTIONS LIKE310: C ROSENBROCKOR GRIEWANK OF LARGE SIZE (SAY M=30) IT IS NEEDED THAT311: C ITRN IS LARGE, SAY 5000 OR EVEN 10000.312: C SIGMA INTRODUCES PERTURBATION & HELPS THE SEARCH JUMP OUT OF LOCAL313: C OPTIMA. FOR EXAMPLE : RASTRIGIN FUNCTION OF DMENSION 3O OR LARGER314: C NSTEP DOES LOCAL SEARCH BY TUNNELLING AND WORKS WELL BETWEEN 5 AND315: C 15, WHICH IS MUCH ON THE HIGHER SIDE.316: C ITOP <=1 (RING); ITOP=2 (RING AND RANDOM); ITOP=>3 (RANDOM)317: C NSIGMA=0 (NO CHAOTIC PERTURBATION);NSIGMA=1 (CHAOTIC PERTURBATION)318: C NOTE THAT NSIGMA=1 NEED NOT ALWAYS WORK BETTER (OR WORSE)319: C SUBROUTINE FUNC( ) DEFINES OR CALLS THE FUNCTION TO BE OPTIMIZED.320: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

321: COMMON /RNDM/IU,IV

322: COMMON /KFF/KF,NFCALL

323: INTEGER IU,IV

324: CHARACTER *70 FTIT

325: DIMENSION X(N,MX),V(N,MX),A(MX),VI(MX)

326: DIMENSION XX(N,MX),F(N),V1(MX),V2(MX),V3(MX),V4(MX),BST(MX)

327: C A1 A2 AND A3 ARE CONSTANTS AND W IS THE INERTIA WEIGHT.328: C OCCASIONALLY, TINKERING WITH THESE VALUES, ESPECIALLY A3, MAY BE329: C NEEDED.330: DATA A1,A2,A3,W,SIGMA,EPSI /.5D0,.5D0,5.D-04,.5D00,1.D-03,1.D-08/

331: C -----------------------------------------------------------------332: C CALL SUBROUTINE FOR CHOOSING FUNCTION (KF) AND ITS DIMENSION (M)333: CALL FSELECT(KF,M,FTIT)

334: C -----------------------------------------------------------------335: GGBEST=1.D30 ! TO BE USED FOR TERMINATION CRITERION

5/18

Page 17: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 6/1810/16/2006 7:32:50 AM

336: LCOUNT=0

337: NFCALL=0

338: WRITE(*,*)'4-DIGITS SEED FOR RANDOM NUMBER GENERATION'

339: WRITE(*,*)'A FOUR-DIGIT POSITIVE ODD INTEGER, SAY, 1171'

340: READ(*,*) IU

341: FMIN =1.0E30

342: C GENERATE N-SIZE POPULATION OF M-TUPLE PARAMETERS X(I,J) RANDOMLY343: DO I=1,N

344: DO J=1,M

345: CALL RANDOM(RAND)

346: X(I,J)=(RAND-0.5D00)*2000

347: C WE GENERATE RANDOM(-5,5). HERE MULTIPLIER IS 10. TINKERING IN SOME348: C CASES MAY BE NEEDED349: ENDDO350: F(I)=1.0D30

351: ENDDO352: C INITIALISE VELOCITIES V(I) FOR EACH INDIVIDUAL IN THE POPULATION353: DO I=1,N

354: DO J=1,M

355: CALL RANDOM(RAND)

356: V(I,J)=(RAND-0.5D+00)

357: C V(I,J)=RAND358: ENDDO359: ENDDO360: DO 100 ITER=1,ITRN

361: C LET EACH INDIVIDUAL SEARCH FOR THE BEST IN ITS NEIGHBOURHOOD362: DO I=1,N

363: DO J=1,M

364: A(J)=X(I,J)

365: VI(J)=V(I,J)

366: ENDDO367: CALL LSRCH(A,M,VI,NSTEP,FI)

368: IF(FI.LT.F(I)) THEN369: F(I)=FI

370: DO IN=1,M

371: BST(IN)=A(IN)

372: ENDDO373: C F(I) CONTAINS THE LOCAL BEST VALUE OF FUNCTION FOR ITH INDIVIDUAL374: C XX(I,J) IS THE M-TUPLE VALUE OF X ASSOCIATED WITH LOCAL BEST F(I)375: DO J=1,M

376: XX(I,J)=A(J)

377: ENDDO378: ENDIF379: ENDDO380: C NOW LET EVERY INDIVIDUAL RANDOMLY COSULT NN(<<N) COLLEAGUES AND381: C FIND THE BEST AMONG THEM382: DO I=1,N

383: C ------------------------------------------------------------------384: IF(ITOP.GE.3) THEN385: C RANDOM TOPOLOGY ******************************************386: C CHOOSE NN COLLEAGUES RANDOMLY AND FIND THE BEST AMONG THEM387: BEST=1.0D30

388: DO II=1,NN

389: CALL RANDOM(RAND)

390: NF=INT(RAND*N)+1

391: IF(BEST.GT.F(NF)) THEN392: BEST=F(NF)

393: NFBEST=NF

394: ENDIF395: ENDDO396: ENDIF397: C----------------------------------------------------------------------398: IF(ITOP.EQ.2) THEN399: C RING + RANDOM TOPOLOGY ******************************************400: C REQUIRES THAT THE SUBROUTINE NEIGHBOR IS TURNED ALIVE401: BEST=1.0D30

402: CALL NEIGHBOR(I,N,I1,I3)

6/18

Page 18: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 7/1810/16/2006 7:32:50 AM

403: DO II=1,NN

404: IF(II.EQ.1) NF=I1

405: IF(II.EQ.2) NF=I

406: IF(II.EQ.3) NF=I3

407: IF(II.GT.3) THEN408: CALL RANDOM(RAND)

409: NF=INT(RAND*N)+1

410: ENDIF411: IF(BEST.GT.F(NF)) THEN412: BEST=F(NF)

413: NFBEST=NF

414: ENDIF415: ENDDO416: ENDIF417: C---------------------------------------------------------------------418: IF(ITOP.LE.1) THEN419: C RING TOPOLOGY **************************************************420: C REQUIRES THAT THE SUBROUTINE NEIGHBOR IS TURNED ALIVE421: BEST=1.0D30

422: CALL NEIGHBOR(I,N,I1,I3)

423: DO II=1,3

424: IF (II.NE.I) THEN425: IF(II.EQ.1) NF=I1

426: IF(II.EQ.3) NF=I3

427: IF(BEST.GT.F(NF)) THEN428: BEST=F(NF)

429: NFBEST=NF

430: ENDIF431: ENDIF432: ENDDO433: ENDIF434: C---------------------------------------------------------------------435: C IN THE LIGHT OF HIS OWN AND HIS BEST COLLEAGUES EXPERIENCE, THE436: C INDIVIDUAL I WILL MODIFY HIS MOVE AS PER THE FOLLOWING CRITERION437: C FIRST, ADJUSTMENT BASED ON ONES OWN EXPERIENCE438: C AND OWN BEST EXPERIENCE IN THE PAST (XX(I))439: DO J=1,M

440: CALL RANDOM(RAND)

441: V1(J)=A1*RAND*(XX(I,J)-X(I,J))

442: C THEN BASED ON THE OTHER COLLEAGUES BEST EXPERIENCE WITH WEIGHT W443: C HERE W IS CALLED AN INERTIA WEIGHT 0.01< W < 0.7444: C A2 IS THE CONSTANT NEAR BUT LESS THAN UNITY445: CALL RANDOM(RAND)

446: V2(J)=V(I,J)

447: IF(F(NFBEST).LT.F(I)) THEN448: V2(J)=A2*W*RAND*(XX(NFBEST,J)-X(I,J))

449: ENDIF450: C THEN SOME RANDOMNESS AND A CONSTANT A3 CLOSE TO BUT LESS THAN UNITY451: CALL RANDOM(RAND)

452: RND1=RAND

453: CALL RANDOM(RAND)

454: V3(J)=A3*RAND*W*RND1

455: C V3(J)=A3*RAND*W456: C THEN ON PAST VELOCITY WITH INERTIA WEIGHT W457: V4(J)=W*V(I,J)

458: C FINALLY A SUM OF THEM459: V(I,J)= V1(J)+V2(J)+V3(J)+V4(J)

460: ENDDO461: ENDDO462: C CHANGE X463: DO I=1,N

464: DO J=1,M

465: RANDS=0.D00

466: C ------------------------------------------------------------------467: IF(NSIGMA.EQ.1) THEN468: CALL RANDOM(RAND) ! FOR CHAOTIC PERTURBATION469: IF(DABS(RAND-.5D00).LT.SIGMA) RANDS=RAND-0.5D00

7/18

Page 19: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 8/1810/16/2006 7:32:50 AM

470: C SIGMA CONDITIONED RANDS INTRODUCES CHAOTIC ELEMENT IN TO LOCATION471: C IN SOME CASES THIS PERTURBATION HAS WORKED VERY EFFECTIVELY WITH472: C PARAMETER (N=100,NN=15,MX=100,NSTEP=9,ITRN=100000,NSIGMA=1,ITOP=2)473: ENDIF474: C -----------------------------------------------------------------475: X(I,J)=X(I,J)+V(I,J)*(1.D00+RANDS)

476: ENDDO477: ENDDO478: DO I=1,N

479: IF(F(I).LT.FMIN) THEN480: FMIN=F(I)

481: II=I

482: DO J=1,M

483: BST(J)=XX(II,J)

484: ENDDO485: ENDIF486: ENDDO487: IF(LCOUNT.EQ.NPRN) THEN488: LCOUNT=0

489: WRITE(*,*)'OPTIMAL SOLUTION UPTO THIS (FUNCTION CALLS=',NFCALL,')'

490: WRITE(*,*)'X = ',(BST(J),J=1,M),' MIN F = ',FMIN

491: C WRITE(*,*)'NO. OF FUNCTION CALLS = ',NFCALL492: IF(DABS(FMIN-GGBEST).LT.EPSI) THEN493: WRITE(*,*)'COMPUTATION OVER'

494: FMINIM=FMIN

495: RETURN496: ELSE497: GGBEST=FMIN

498: ENDIF499: ENDIF500: LCOUNT=LCOUNT+1

501: 100 CONTINUE502: WRITE(*,*)'COMPUTATION OVER:',FTIT

503: FMINIM=FMIN

504: RETURN505: END506: C ----------------------------------------------------------------507: SUBROUTINE LSRCH(A,M,VI,NSTEP,FI)

508: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

509: COMMON /KFF/KF,NFCALL

510: COMMON /RNDM/IU,IV

511: INTEGER IU,IV

512: DIMENSION A(*),B(100),VI(*)

513: AMN=1.0D30

514: DO J=1,NSTEP

515: DO JJ=1,M

516: B(JJ)=A(JJ)+(J-(NSTEP/2)-1)*VI(JJ)

517: ENDDO518: CALL FUNC(B,M,FI)

519: IF(FI.LT.AMN) THEN520: AMN=FI

521: DO JJ=1,M

522: A(JJ)=B(JJ)

523: ENDDO524: ENDIF525: ENDDO526: FI=AMN

527: RETURN528: END529: C -----------------------------------------------------------------530: C THIS SUBROUTINE IS NEEDED IF THE NEIGHBOURHOOD HAS RING TOPOLOGY531: C EITHER PURE OR HYBRIDIZED532: SUBROUTINE NEIGHBOR(I,N,J,K)

533: IF(I-1.GE.1 .AND. I.LT.N) THEN534: J=I-1

535: K=I+1

536: ELSE

8/18

Page 20: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 9/1810/16/2006 7:32:50 AM

537: IF(I-1.LT.1) THEN538: J=N-I+1

539: K=I+1

540: ENDIF541: IF(I.EQ.N) THEN542: J=I-1

543: K=1

544: ENDIF545: ENDIF546: RETURN547: END548: C -----------------------------------------------------------------549: SUBROUTINE FUNC(X,M,F)

550: C TEST FUNCTIONS FOR GLOBAL OPTIMIZATION PROGRAM551: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

552: COMMON /RNDM/IU,IV

553: COMMON /KFF/KF,NFCALL

554: INTEGER IU,IV

555: DIMENSION X(*)

556: NFCALL=NFCALL+1 ! INCREMENT TO NUMBER OF FUNCTION CALLS557: C KF IS THE CODE OF THE TEST FUNCTION558: C -----------------------------------------------------------------559: IF(KF.EQ.1) THEN560: C ZERO SUM FUNCTION : MIN = 0 AT SUM(X(I))=0561: CALL ZEROSUM(M,F,X)

562: return563: ENDIF564: C -----------------------------------------------------------------565: IF(KF.EQ.2) THEN566: C PERM FUNCTION #1 MIN = 0 AT (1, 2, 3, 4)567: C BETA => 0. CHANGE IF NEEDED. SMALLER BETA RAISES DIFFICULY568: C FOR BETA=0, EVERY PERMUTED SOLUTION IS A GLOBAL MINIMUM569: CALL PERM1(M,F,X)

570: return571: ENDIF572: C -----------------------------------------------------------------573: IF(KF.EQ.3) THEN574: C PERM FUNCTION #2 MIN = 0 AT (1/1, 1/2, 1/3, 1/4,..., 1/M)575: C BETA => 0. CHANGE IF NEEDED. SMALLER BETA RAISES DIFFICULY576: C FOR BETA=0, EVERY PERMUTED SOLUTION IS A GLOBAL MINIMUM577: CALL PERM2(M,F,X)

578: return579: ENDIF580: C -----------------------------------------------------------------581: IF(KF.EQ.4) THEN582: C POWER SUM FUNCTION; MIN = 0 AT PERM(1,2,2,3) FOR B=(8,18,44,114)583: C 0 =< X <=4584: CALL POWERSUM(M,F,X)

585: return586: ENDIF587: C -----------------------------------------------------------------588: IF(KF.EQ.5) THEN589: C BUKIN'S 6TH FUNCTION MIN = 0 FOR (-10, 1)590: C -15. LE. X(1) .LE. -5 AND -3 .LE. X(2) .LE. 3591: CALL BUKIN6(M,F,X)

592: return593: ENDIF594: C -----------------------------------------------------------------595: IF(KF.EQ.6) THEN596: C DEFLECTED CORRUGATED SPRING FUNCTION597: C MIN VALUE = -1 AT (5, 5, ..., 5) FOR ANY K AND ALPHA=5; M VARIABLE598: CALL DCS(M,F,X)

599: RETURN600: ENDIF601: C -----------------------------------------------------------------602: IF(KF.EQ.7) THEN603: C M =>2

9/18

Page 21: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 10/1810/16/2006 7:32:50 AM

604: CALL FUNCT7(M,F,X)

605: RETURN606: ENDIF607: C -----------------------------------------------------------------608: IF(KF.EQ.8) THEN609: C HOUGEN FUNCTION 5 VARIABLES : M =3610: CALL HOUGEN(X,M,F)

611: RETURN612: ENDIF613: C -----------------------------------------------------------------614: IF(KF.EQ.9) THEN615: C GIUNTA FUNCTION 2 VARIABLES :M =2616: CALL GIUNTA(M,X,F)

617: RETURN618: ENDIF619: C -----------------------------------------------------------------620: IF(KF.EQ.10) THEN621: C FOR X(1)=0.1928D00; X(2)=0.1905D00; X(3)=0.1230D00; X(4)=0.1356D00622: C FMIN=0.3075D-03 ; -4 <= X(I) <= 4.623: CALL KOWALIK(M,X,F)

624: RETURN625: ENDIF626: C -----------------------------------------------------------------627: IF(KF.EQ.11) THEN628: C FLETCHER & POWELL FUNCTION : F MIN f(0,0,...,0 )=0629: CALL FLETCHER(M,X,F)

630: RETURN631: ENDIF632: C -----------------------------------------------------------------633: IF(KF.EQ.12) THEN634: C NEW FUNCTION 1 : F MIN f(0,0,...,0 )=0635: CALL NFUNCT1(M,X,F)

636: RETURN637: ENDIF638: C -----------------------------------------------------------------639: IF(KF.EQ.13) THEN640: C NEW FUNCTION 2 : F MIN f(0,0,...,0 )=0641: CALL NFUNCT2(M,X,F)

642: RETURN643: ENDIF644: C -----------------------------------------------------------------645: IF(KF.EQ.14) THEN646: C WOOD FUNCTION : F MIN : M=4647: CALL WOOD(M,X,F)

648: RETURN649: ENDIF650: C -----------------------------------------------------------------651: IF(KF.EQ.15) THEN652: C FENTON & EASON FUNCTION : : M=2653: CALL FENTONEASON(M,X,F)

654: RETURN655: ENDIF656: C -----------------------------------------------------------------657: IF(KF.EQ.16) THEN658: CALL TYPICAL(M,X,F)

659: RETURN660: ENDIF661: C -----------------------------------------------------------------662: IF(KF.EQ.17) THEN663: C WILD FUNCTION: FMIN (-15.8151514,..., -15.8151514)= M * 67.4677348664: CALL WILD(M,X,F)

665: RETURN666: ENDIF667: C =================================================================668: WRITE(*,*)'FUNCTION NOT DEFINED. PROGRAM ABORTED'

669: STOP670: END

10/18

Page 22: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 11/1810/16/2006 7:32:50 AM

671: C >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>672: SUBROUTINE ZEROSUM(M,F,X)

673: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

674: COMMON /RNDM/IU,IV

675: INTEGER IU,IV

676: DIMENSION X(*)

677: C ZERO SUM FUNCTION : MIN = 0 AT SUM(X(I))=0678: F=0.D00

679: DO I=1,M

680: IF(DABS(X(I)).GT.10.D00) THEN681: CALL RANDOM(RAND)

682: X(I)=(RAND-0.5D00)*20

683: ENDIF684: ENDDO685: SUM=0.D00

686: DO I=1,M

687: SUM=SUM+X(I)

688: ENDDO689: IF(SUM.NE.0.D00) F=1.D00+(10000*DABS(SUM))**0.5

690: RETURN691: END692: C -----------------------------------------------------------------693: SUBROUTINE PERM1(M,F,X)

694: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

695: COMMON /RNDM/IU,IV

696: INTEGER IU,IV

697: DIMENSION X(*)

698: C PERM FUNCTION #1 MIN = 0 AT (1, 2, 3, 4)699: C BETA => 0. CHANGE IF NEEDED. SMALLER BETA RAISES DIFFICULY700: C FOR BETA=0, EVERY PERMUTED SOLUTION IS A GLOBAL MINIMUM701: BETA=50.D00

702: F=0.D00

703: DO I=1,M

704: IF(DABS(X(I)).GT.M) THEN705: CALL RANDOM(RAND)

706: X(I)=(RAND-0.5D00)*2*M

707: ENDIF708: ENDDO709: DO K=1,M

710: SUM=0.D00

711: DO I=1,M

712: SUM=SUM+(I**K+BETA)*((X(I)/I)**K-1.D00)

713: ENDDO714: F=F+SUM**2

715: ENDDO716: RETURN717: END718: C -----------------------------------------------------------------719: SUBROUTINE PERM2(M,F,X)

720: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

721: COMMON /RNDM/IU,IV

722: INTEGER IU,IV

723: DIMENSION X(*)

724: C PERM FUNCTION #2 MIN = 0 AT (1/1, 1/2, 1/3, 1/4,..., 1/M)725: C BETA => 0. CHANGE IF NEEDED. SMALLER BETA RAISES DIFFICULY726: C FOR BETA=0, EVERY PERMUTED SOLUTION IS A GLOBAL MINIMUM727: BETA=10.D00

728: DO I=1,M

729: IF(DABS(X(I)).GT.1.D00) THEN730: CALL RANDOM(RAND)

731: X(I)=(RAND-.5D00)*2

732: ENDIF733: SGN=X(I)/DABS(X(I))

734: ENDDO735: F=0.D00

736: DO K=1,M

737: SUM=0.D00

11/18

Page 23: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 12/1810/16/2006 7:32:50 AM

738: DO I=1,M

739: SUM=SUM+(I+BETA)*(X(I)**K-(1.D00/I)**K)

740: ENDDO741: F=F+SUM**2

742: ENDDO743: RETURN744: END745: C -----------------------------------------------------------------746: SUBROUTINE POWERSUM(M,F,X)

747: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

748: COMMON /RNDM/IU,IV

749: INTEGER IU,IV

750: DIMENSION X(*)

751: C POWER SUM FUNCTION; MIN = 0 AT PERM(1,2,2,3) FOR B=(8,18,44,114)752: C 0 =< X <=4753: F=0.D00

754: DO I=1,M

755: C ANY PERMUTATION OF (1,2,2,3) WILL GIVE MIN = ZERO756: IF(X(I).LT.0.D00 .OR. X(I).GT.4.D00) THEN757: CALL RANDOM(RAND)

758: X(I)=RAND*4

759: ENDIF760: ENDDO761: DO K=1,M

762: SUM=0.D00

763: DO I=1,M

764: SUM=SUM+X(I)**K

765: ENDDO766: IF(K.EQ.1) B=8.D00

767: IF(K.EQ.2) B=18.D00

768: IF(K.EQ.3) B=44.D00

769: IF(K.EQ.4) B=114.D00

770: F=F+(SUM-B)**2

771: ENDDO772: RETURN773: END774: C -----------------------------------------------------------------775: SUBROUTINE BUKIN6(M,F,X)

776: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

777: COMMON /RNDM/IU,IV

778: INTEGER IU,IV

779: DIMENSION X(*)

780: C BUKIN'S 6TH FUNCTION MIN = 0 FOR (-10, 1)781: C -15. LE. X(1) .LE. -5 AND -3 .LE. X(2) .LE. 3782: IF(X(1).LT. -15.D00 .OR. X(1) .GT. -5.D00) THEN783: CALL RANDOM(RAND)

784: X(1)=-(RAND*10+5.D00)

785: ENDIF786: IF(DABS(X(2)).GT.3.D00) THEN787: CALL RANDOM(RAND)

788: X(2)=(RAND-.5D00)*6

789: ENDIF790: F=100.D0*DSQRT(DABS(X(2)-0.01D0*X(1)**2))+ 0.01D0*DABS(X(1)+10.D0)

791: RETURN792: END793: C -----------------------------------------------------------------794: SUBROUTINE DCS(M,F,X)

795: C FOR DEFLECTED CORRUGATED SPRING FUNCTION796: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

797: COMMON /RNDM/IU,IV

798: INTEGER IU,IV

799: DIMENSION X(*),C(100)

800: C OPTIMAL VALUES OF (ALL) X ARE ALPHA , AND K IS ONLY FOR SCALING801: C OPTIMAL VALUE OF F IS -1. DIFFICULT TO OPTIMIZE FOR LARGER M.802: DATA K,ALPHA/5,5.D00/ ! K AND ALPHA COULD TAKE ON ANY OTHER VALUES803: do i=1, m

804: if(dabs(x(i)).gt.20.d00) then

12/18

Page 24: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 13/1810/16/2006 7:32:50 AM

805: call random(rand)

806: x(i)=(rand-0.5d00)*40

807: endif808: enddo809: R2=0.D00

810: DO I=1,M

811: C(I)=alpha

812: R2=R2+(X(I)-C(I))**2

813: ENDDO814: R=DSQRT(R2)

815: F=-DCOS(K*R)+0.1D00*R2

816: RETURN817: END818: C -----------------------------------------------------------------819: SUBROUTINE FUNCT7(M,F,X)

820: C REF: YAO, X. AND LIU, Y. (1996): FAST EVOLUTIONARY PROGRAMMING821: C MIN F(0, 0, ..., 0) = 0822: IMPLICIT DOUBLE PRECISION (A-H, O-Z)

823: COMMON /RNDM/IU,IV

824: INTEGER IU,IV

825: DIMENSION X(*)

826: F=0.D00

827: DO I=1,M

828: IF(DABS(X(I)).GT.1.28D00) THEN829: CALL RANDOM(RAND)

830: X(I)=(RAND-0.5D00)*2.56D00

831: ENDIF832: ENDDO833: DO I=1,M

834: CALL RANDOM(RAND)

835: F=F+(I*X(I)**4)

836: ENDDO837: CALL RANDOM(RAND)

838: F=F+RAND

839: RETURN840: END841: C ----------------------------------------------------------------842: SUBROUTINE HOUGEN(A,M,F)

843: PARAMETER(N=13,K=3)

844: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

845: COMMON /RNDM/IU,IV

846: INTEGER IU,IV

847: DIMENSION X(N,K),RATE(N),A(*)

848: C ----------------------------------------------------------------849: C HOUGEN FUNCTION (HOUGEN-WATSON MODEL FOR REACTION KINATICS)850: C NO. OF PARAMETERS (A) TO ESTIMATE = 5 = M851: c BEST RESULTS ARE: FMIN=0.298900994

852: C A(1)=1.253031; A(2)=1.190943; A(3)=0.062798; A(4)=0.040063853: C A(5)=0.112453 ARE 2nd BEST ESTIMATES OBTAINED BY ROSENBROCK &854: C QUASI-NEWTON METHOD WITH SUM OF SQUARES OF DEVIATION =0.298900994855: C AND R=0.99945.856: c SECOND BEST RESULTS: fmin=0.298901 for X(1.25258611. 0.0627758222,

857: c 0.0400477567, 0.112414812, 1.19137715) given by DE with ncross=0.

858: C THE NEXT BEST RESULTS GIVEN BY HOOKE-JEEVES & QUASI-NEWTON859: C A(1)=2.475221;A(2)=0.599177; A(3)=0.124172; A(4)=0.083517860: C A(5)=0.217886; SUM OF SQUARES OF DEVIATION = 0.318593458861: C R=0.99941862: C MOST OF THE OTHER METHODS DO NOT PERFORM WELL863: C -----------------------------------------------------------------864: DATA X(1,1),X(1,2),X(1,3),RATE(1) /470,300,10,8.55/

865: DATA X(2,1),X(2,2),X(2,3),RATE(2) /285,80,10,3.79/

866: DATA X(3,1),X(3,2),X(3,3),RATE(3) /470,300,120,4.82/

867: DATA X(4,1),X(4,2),X(4,3),RATE(4) /470,80,120,0.02/

868: DATA X(5,1),X(5,2),X(5,3),RATE(5) /470,80,10,2.75/

869: DATA X(6,1),X(6,2),X(6,3),RATE(6) /100,190,10,14.39/

870: DATA X(7,1),X(7,2),X(7,3),RATE(7) /100,80,65,2.54/

871: DATA X(8,1),X(8,2),X(8,3),RATE(8) /470,190,65,4.35/

13/18

Page 25: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 14/1810/16/2006 7:32:50 AM

872: DATA X(9,1),X(9,2),X(9,3),RATE(9) /100,300,54,13/

873: DATA X(10,1),X(10,2),X(10,3),RATE(10) /100,300,120,8.5/

874: DATA X(11,1),X(11,2),X(11,3),RATE(11) /100,80,120,0.05/

875: DATA X(12,1),X(12,2),X(12,3),RATE(12) /285,300,10,11.32/

876: DATA X(13,1),X(13,2),X(13,3),RATE(13) /285,190,120,3.13/

877: C WRITE(*,1)((X(I,J),J=1,K),RATE(I),I=1,N)878: C 1 FORMAT(4F8.2)879: DO J=1,M

880: IF(DABS(A(J)).GT.5.D00) THEN881: CALL RANDOM(RAND)

882: A(J)=(RAND-0.5D00)*10.D00

883: ENDIF884: ENDDO885: F=0.D00

886: DO I=1,N

887: D=1.D00

888: DO J=1,K

889: D=D+A(J+1)*X(I,J)

890: ENDDO891: FX=(A(1)*X(I,2)-X(I,3)/A(M))/D

892: C FX=(A(1)*X(I,2)-X(I,3)/A(5))/(1.D00+A(2)*X(I,1)+A(3)*X(I,2)+893: C A(4)*X(I,3))894: F=F+(RATE(I)-FX)**2

895: ENDDO896: RETURN897: END898: C ----------------------------------------------------------------899: SUBROUTINE GIUNTA(M,X,F)

900: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

901: COMMON /RNDM/IU,IV

902: INTEGER IU,IV

903: DIMENSION X(*)

904: C GIUNTA FUNCTION905: C X(I) = -1 TO 1; M=2906: DO I=1,M

907: IF(DABS(X(I)).GT.1.D00) THEN908: CALL RANDOM(RAND)

909: X(I)=(RAND-0.5D00)*2.D00

910: ENDIF911: ENDDO912: C=16.D00/15.D00

913: f=0.d00

914: do i=1,m

915: F=f + DSIN(C*X(i)-1.D0)+DSIN(C*X(i)-1.D0)**2+

916: & DSIN(4*(C*X(i)-1.D0))/50

917: enddo918: f=f+0.6d0

919: RETURN920: END921: C -----------------------------------------------------------------922: SUBROUTINE KOWALIK(M,X,F)

923: PARAMETER(N=11)

924: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

925: COMMON /RNDM/IU,IV

926: INTEGER IU,IV

927: DIMENSION X(*),A(N),BI(N)

928: DATA (A(I),I=1,N) /0.1957D0,0.1947D0,0.1735D0,0.1600D0,0.0844D0,

929: & 0.0627D0, 0.0456D0, 0.0342D0, 0.0323D0, 0.0235D0, 0.0246D0/

930: DATA (BI(I),I=1,N)/0.25D0, 0.5D0, 1.D0, 2.D0, 4.D0, 6.D0, 8.D0,

931: & 10.D0, 12.D0, 14.D0, 16.D0/

932: C KOWAKIK, J & MORRISON, JF (1968) : ANALYSIS OF KINETIC DATA FOR933: C ALLOSTERIC ANZYME REACTION AS A NONLINEAR REGRESSIO PROBLEM934: C MATH. BIOSC. 2: 57-66.935: C NOTE: FOR LARGER L AND U LIMITS THIS FUNCTION MISGUIDES DE, BUT936: C RPS IS QUITE ROBUST. DE with ncross=1 FAILS TO FIND MINIMUM, but937: C DE with ncross=0 SUCCEEDS. RPS SUCCEEDS.938: DO I=1,M

14/18

Page 26: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 15/1810/16/2006 7:32:50 AM

939: IF(DABS(X(I)).GT.4.D00) THEN940: CALL RANDOM(RAND)

941: X(I)=(RAND-0.5D00)*8

942: ENDIF943: ENDDO944: C FOR X(1)=0.1928D00; X(2)=0.1905D00; X(3)=0.1230D00; X(4)=0.1356D00945: C FMIN=0.3075D-03 ; -4 <= X(I) <= 4.946: F=0.D00

947: DO I=1,N

948: F1=X(1)*(BI(I)**(-2)+X(2)/BI(I))

949: F2=BI(I)**(-2)+X(3)/BI(I)+X(4)

950: F=F+(A(I)-F1/F2)**2

951: ENDDO952: f=f*1000.d00

953: RETURN954: END955: C ----------------------------------------------------------------956: SUBROUTINE NFUNCT1(M,X,F)

957: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

958: COMMON /KFF/KF,NFCALL

959: COMMON /RNDM/IU,IV

960: INTEGER IU,IV

961: DIMENSION X(*)

962: C MIN F (1, 1, ..., 1) =2963: DO I=1,M

964: IF(X(I).LT.0.D00 .OR. X(I).GT.1.D00) THEN965: CALL RANDOM(RAND)

966: X(I)=RAND

967: ENDIF968: ENDDO969: S=0.D00

970: DO I=1,M-1

971: S=S+X(I)

972: ENDDO973: X(M)=(M-S)

974: F=(1.D00+X(M))**X(M)

975: RETURN976: END977: C -----------------------------------------------------------------978: SUBROUTINE NFUNCT2(M,X,F)

979: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

980: COMMON /KFF/KF,NFCALL

981: COMMON /RNDM/IU,IV

982: INTEGER IU,IV

983: DIMENSION X(*)

984: C MIN F (1, 1, ..., 1) =2985: DO I=1,M

986: IF(X(I).LT.0.D00 .OR. X(I).GT.1.D00) THEN987: CALL RANDOM(RAND)

988: X(I)=RAND

989: ENDIF990: ENDDO991: S=0.D00

992: DO I=1,M-1

993: S=S+(X(I)+X(I+1))/2.D00

994: ENDDO995: X(M)=(M-S)

996: F=(1.D00+X(M))**X(M)

997: RETURN998: END999: C -----------------------------------------------------------------

1000: SUBROUTINE FLETCHER(M,X,F)

1001: C FLETCHER-POWELL FUNCTION, M <= 10, ELSE IT IS VERY MUCH SLOW1002: C SOLUTION: MIN F = 0 FOR X=(C1, C2, C3,...,CM)1003: PARAMETER(N=10) ! FOR DIMENSION OF DIFFERENT MATRICES AND VECTORS1004: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

1005: COMMON /KFF/KF,NFCALL

15/18

Page 27: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 16/1810/16/2006 7:32:50 AM

1006: COMMON /RNDM/IU,IV

1007: INTEGER IU,IV

1008: DIMENSION X(*),A(N,N),B(N,N),AA(N),BB(N),AL(N),C(N),C1(N)

1009: PI=4*DATAN(1.D00)

1010: C GENERATE A(I,J) AND B(I,J) BETWEEN (-100, 100) RANDOMLY.1011: C C(I) = BETWEEN (-PI, PI) IS EITHER GIVEN OR RANDOMLY GENERATED.1012: C DATA (C(I),I=1,10)/1,2,3,-3,-2,-1,0,1,2,3/ ! BETWEEN -PI AND PI1013: DATA (C1(I),I=1,N)/-3,-3.02,-3.01,1,1.03,1.02,1.03,-.08,.001,3/

1014: C DATA (C1(I),I=1,N)/0,0,0,0,0,0,0,0,0,0/ ! another example c1 = 01015: NC=1 ! DEFINE NC HERE 0 OR 1 OR 21016: C IF NC=0, C1 FROM DATA IS USED (THAT IS FIXED C);1017: C IF NC=1, C IS MADE FROM C1 BY ADDING RANDOM PART - THAT IS C=C1+r1018: C IF NC=2 THEN C IS PURELY RANDOM THAT IS C= 0 + r1019: C IN ANY CASE C LIES BETWEEN -PI AND PI.1020: C ----------------------------------------------------------------1021: C FIND THE MAX MAGNITUDE ELEMENT IN C1 VECTOR (UPTO M ELEMENTS)1022: CMAX=DABS(C1(1))

1023: DO J=2,M

1024: IF(DABS(C1(J)).GT.CMAX) CMAX=DABS(C1(J))

1025: ENDDO1026: RANGE=PI-CMAX

1027: C -----------------------------------------------------------------1028: DO J=1,M

1029: DO I=1,M

1030: CALL RANDOM(RAND)

1031: A(I,J)=(RAND-0.5D00)*200.D00

1032: CALL RANDOM(RAND)

1033: B(I,J)=(RAND-0.5D00)*200.D00

1034: ENDDO1035: IF(NC.EQ.0) AL(J)=C1(J) ! FIXED OR NON-STOCHASTIC C1036: IF(NC.EQ.1) THEN1037: CALL RANDOM(RAND)

1038: AL(J)=C1(J)+(RAND-0.5D0)*2*RANGE ! A PART FIXED, OTHER STOCHASTIC1039: ENDIF1040: IF(NC.EQ.2) THEN1041: CALL RANDOM(RAND)

1042: AL(J)=(RAND-0.5D00)*2*PI ! PURELY STOCHASTIC1043: ENDIF1044: ENDDO1045: DO I=1,M

1046: AA(I)=0.D00

1047: DO J=1,M

1048: AA(I)=AA(I)+A(I,J)*DSIN(AL(J))+B(I,J)*DCOS(AL(J))

1049: ENDDO1050: ENDDO1051: C -----------------------------------------------------------------1052: DO I=1,M

1053: IF(DABS(X(I)).GT.PI) THEN1054: CALL RANDOM(RAND)

1055: X(I)=(RAND-0.5D00)*2*PI

1056: ENDIF1057: ENDDO1058: DO I=1,M

1059: BB(I)=0.D00

1060: DO J=1,M

1061: BB(I)=BB(I)+A(I,J)*DSIN(X(J))+B(I,J)*DCOS(X(J))

1062: ENDDO1063: ENDDO1064: F=0.D00

1065: DO I=1,M

1066: F=F+(AA(I)-BB(I))**2

1067: ENDDO1068: RETURN1069: END1070: C -----------------------------------------------------------------1071: SUBROUTINE FENTONEASON(M,X,F)

1072: IMPLICIT DOUBLE PRECISION (A-H, O-Z)

16/18

Page 28: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 17/1810/16/2006 7:32:50 AM

1073: DIMENSION X(*)

1074: C FENTON & EASON FUNCTION M=21075: DO I=1,M

1076: IF(DABS(X(I)).GT.100.D00) THEN1077: CALL RANDOM(RAND)

1078: X(I)=(RAND-0.5D00)*200

1079: ENDIF1080: ENDDO1081: F=1.2D00+0.1*X(1)**2 +(0.1D00+0.1*X(2)**2)/X(1)**2+

1082: & (.1*X(1)**2*X(2)**2+10.D00)/((X(1)*X(2))**4)

1083: RETURN1084: END1085: C -----------------------------------------------------------------1086: SUBROUTINE WOOD(M,X,F)

1087: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

1088: COMMON /RNDM/IU,IV

1089: INTEGER IU,IV

1090: DIMENSION X(*)

1091: C WOOD FUNCTION : M=41092: DO I=1,M

1093: IF(DABS(X(I)).GT.5.D00) THEN1094: CALL RANDOM(RAND)

1095: X(I)=(RAND-0.5D00)*10

1096: ENDIF1097: ENDDO1098: F1=100*(X(2)+X(1)**2)**2 + (1.D0-X(1))**2 +90*(X(4)-X(3)**2)**2

1099: F2=(1.D0-X(3))**2 +10.1*((X(2)-1.D0)**2+(X(4)-1.D0)**2)

1100: F3=19.8*(X(2)-1.D0)*(X(4)-1.D0)

1101: F=F1+F2+F3

1102: RETURN1103: END1104: C -----------------------------------------------------------------1105: SUBROUTINE TYPICAL(M,X,F)

1106: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

1107: COMMON /KFF/KF,NFCALL

1108: COMMON /RNDM/IU,IV

1109: INTEGER IU,IV

1110: DIMENSION X(*)

1111: C A TYPICAL NONLINEAR MULTI-MODAL FUNCTION FMIN=01112: F=0.D00

1113: DO I=1,M

1114: IF(DABS(X(I)).GT.10.D00) THEN1115: CALL RANDOM(RAND)

1116: X(I)=(RAND-0.5D00)*20

1117: ENDIF1118: ENDDO1119: DO I=2,M

1120: F=F+DCOS( DABS(X(I)-X(I-1)) / DABS(X(I-1)+X(I)) )

1121: ENDDO1122: F=F+(M-1.D00)

1123: C IF 0.001*X(1) IS ADDED TO F, IT BECOMES UNIMODAL1124: C F=F+0.001*X(1)1125: RETURN1126: END1127: C -----------------------------------------------------------------1128: SUBROUTINE WILD(M,X,F)

1129: IMPLICIT DOUBLE PRECISION (A-H,O-Z)

1130: COMMON /KFF/KF,NFCALL

1131: COMMON /RNDM/IU,IV

1132: INTEGER IU,IV

1133: DIMENSION X(*)

1134: C WILD FUNCTION: FMIN (-15.8151514,..., -15.8151514)= M * 67.46773481135: DO I=1,M

1136: IF(DABS(X(I)).GT.50.D00) THEN1137: CALL RANDOM(RAND)

1138: X(I)=(RAND-0.5D00)*100

1139: ENDIF

17/18

Page 29: Performance of Differential Evolution and Particle Swarm ... · Annealing Method “ of Kirkpatrick and others (1983) and Cerny (1985), “Tabu Search Method” of Fred Glover (1986),

DEHARD.f 18/1810/16/2006 7:32:50 AM

1140: ENDDO1141: F=0.D00

1142: DO I=1,M

1143: FX=10*DSIN(0.3*X(I))*DSIN(1.3*X(I)**2) +0.00001*X(I)**4 +0.2*X(I)

1144: F=F+ (FX+80.D00)

1145: ENDDO1146: RETURN1147: END1148:

18/18