Sie sind auf Seite 1von 6

2010 Second World Congress on Nature and Biologically Inspired Computing Dec.

15-17, 2010 in Kitakyushu, Fukuoka, Japan

Binary Invasive Weed Optimization


Christian Veenhuis Berlin University of Technology Berlin, Germany veenhuis@googlemail.com

AbstractRecently, a new evolutionary algorithm for optimization in continuous spaces called Invasive Weed Optimization (IWO) was introduced. Since IWO employs a real-valued vector representation, the question arises whether it can also be used for problem domains that need a binary encoding. This paper introduces a binary IWO (BinIWO) concept in which the weeds and seeds are dened as bitstrings. The reproduction operation determines the offspring in a normally distributed neighborhood in the space of bitstrings. Thereby, the normal distribution is not dened over the bitstrings, but over the number of bits to be different in the offspring. BinIWO is applied to four typical benchmark functions known from literature and exhibits promising results.

this, in section III, the Binary Invasive Weed Optimization approach is dened. In sections IV and V the conducted experiments and some results are presented. Finally, in section VI, some conclusions are drawn. II. I NVASIVE W EED O PTIMIZATION In [5] the authors introduced the Invasive Weed Optimization (IWO) algorithm, which is based on the colonization behavior of invasive weeds. Generally speaking, a weed is a plant that grows where it is not desired. In agriculture this term is used especially for plants whose growth habits are a threat to cultivated plants. Weeds exhibit interesting properties as for instance robustness and adaptivity. In IWO a weed is substituted by a point in a search space in which a colony of those points grows to the optima. Let D be the dimension of the problem (i.e., the dimension of the search space D ), Pinit the initial size of the weed colony / population, Pmax the maximum size of the colony (1 Pinit Pmax ) and W the set of weeds W = {W1 , ...,WW }. Each weed Wi D is a point in the search space. To compute the tness of a weed, a tness function F : D is used. Initialization. Firstly, the generation counter G is set to 0. Then, the initial colony W is created by randomly creating Pinit uniformly distributed weeds Wi (Wi U (Xmin , Xmax )D ). The lower and upper bounds (Xmin and Xmax ) of the search space are problem-dependent. Iteration. The iteration works as follows. Each weed Wi in the current colony is reproduced by a certain number of seeds. The number of seeds Snum is determined proportional to the weeds tness, whereby it is linearly mapped based on the colonies best and worse tness Fbest and Fworse : Snum = Smin + F(Wi ) Fworse (Smax Smin ) Fbest Fworse (1)

I. I NTRODUCTION In [5] the authors introduced a new evolutionary algorithm for optimization called Invasive Weed Optimization (IWO). Invasive weeds are an annoyance in agriculture, because of their robustness and adaptivity they can not be removed reliably. But their colonization behavior can be used to solve optimization tasks, as realized by the IWO algorithm. IWO maintains a colony of weeds in a search-space. Weeds reproduce by placing their offspring in their neighborhood. The tter a weed, the more offspring it creates. After a certain time, the colony grows to the optima in the searchspace. The representation used in IWO is a real-valued vector, as typical for most optimizers. This raises the question, whether IWO can also be used for problem domains that need a binary encoding. Other works, as for instance the Binary Particle Swarm Optimization [2], show that optimizers can be successfully transformed from a real-vector to a bitstring representation. This paper introduces the Binary Invasive Weed Optimization (BinIWO) approach. In standard IWO a weed is reproduced by adding a normally distributed step-size, whose standard deviation decreases over time. But a stepsize in a binary space does not make sense. Thus, in BinIWO the normal distribution is dened over the number of bits to be different in the offspring. This favors a less number of differences and the less bits are different, the less the distance to the parental weed. The results obtained are promising. This paper is organized as follows. Section II introduces the Invasive Weed Optimization algorithm. Derived from

The Smin and Smax parameters are the minimum and maximum number of allowed seeds per weed. All Snum seeds S j are created in the neighborhood of the current weed Wi by using a normal distribution with zero mean and varying standard deviation: 1
1 Sometimes in this paper a distribution is used like a function although this is not valid in a strict mathematical sense. In these cases it means what one expects: it returns a draw according to the distribution.

978-1-4244-7376-2/10/$26.00 2010 IEEE

449

2010 Second World Congress on Nature and Biologically Inspired Computing Dec. 15-17, 2010 in Kitakyushu, Fukuoka, Japan

changes from a step-size to a degree of mutation. But S j = Wi + N (0, G )D (1 j Snum ) (2)

N (0, G ) allows also negative values, which make no sense


as numbers of bits. Thus, the random numbers are only sampled out of the positive half denoted as N + (0, G ): 2

The standard deviation G starts at init and is nonlinearly reduced over the whole run to f inal . For the current generation G it is computed as G = f inal + (Niter G)mod (init f inal ) (Niter )mod (3)

whereby Niter denotes the maximum number of iterations and mod a non-linear modulation index. Finally, the next colony is built by a union of the current colony with all created seeds (offspring) of all weeds. If the size of this new colony reaches Pmax , the new colony is sorted according to tness and the Pmax best weeds are kept. The worse ones are removed. III. B INARY I NVASIVE W EED O PTIMIZATION The representation used in IWO is a real-valued vector. To be able to use IWO for problems that need a binary encoding, two aspects of IWO need to be changed. On the one hand, the real vector space D changes to a bitstring space D with = {0, 1}. Each weed Wi D as well as all reproduced seeds are now points in the space of bitstrings. The tness function changes to F : D . On the other hand, the representation dependent operation Wi + N (0, G )D needs to be adapted, too. This includes a re-denition of the + operator and a change in the meaning of N (0, G )D . In IWO, N (0, G )D returns a normally distributed step-size, which is added to the current weed Wi . But a step-size does not make sense if bits are used. Such a stepsize could either be 0 or 1, whereby the question raises what 1 + 1 means for bits or what is a senseful denition of +. Although one can imagine operations for + (e.g., exclusive / inclusive or), the normal distribution is lost here including the (reduction) mechanism of the standard deviation G . To get rid of the + operator, a more general view on the operation is employed and uses the fact that a seed S j = Wi + N (0, G )D = N (Wi , G )D (4)

N + (0, G )

Number of bits to be changed

Based on the number of bits, the probability of a single bit to be changed is computed in a second step. Finally, the given weed Wi is copied to the seed S and all D bits of this seed S are changed according to the pre-computed probability. The core of this procedure resembles the typical mutation operation in genetic algorithms. The difference is that the mutation probability is not pre-dened, but based on a normal distribution whose standard deviation decreases over time. This way the number of bits to be changed reduces, too. The less bits to change, the closer lies the seed to its parental weed. IV. E XPERIMENTS To evaluate the capabilities of BinIWO, four typical benchmark functions as known from literature (Sphere, Rosenbrock, Rastrigin, Griewank), representing all four combinations of unimodal/multimodal with/without dependencies between the variables, were chosen. Sphere is the following simple unimodal function without dependencies between the variables: f (< xi >) =

i=1

xi2

is merely a point in the normally distributed neighborhood of the weed. What is needed is a neighborhood operator N(Wi , G ) that produces seeds being near to the weed Wi , whereby the degree of nearness can be controlled by the G parameter to maintain the reduction mechanism of IWO. (The standard IWO approach uses N(Wi , G ) := N (Wi , G )D .) The Binary Invasive Weed Optimization (BinIWO) denes N(Wi , G ) as presented in Algorithm 1. As rst step, the number of those bits is determined that have to be different in the seed. These numbers of bits are drawn from a normal distribution to keep a senseful standard deviation G . The meaning of the normally distributed random numbers

(Xmin , Xmax ) := (5.12, 5.12) Global minimum : f (< 0, , 0 >) = 0 Rosenbrock is also a unimodal function, but it is a bit more difcult as Sphere, because there are some dependencies between the variables. Its dened as this: f (< xi >) (Xmin , Xmax ) Global minimum =
n1 i=1

(100 (xi+1 xi2 )2 + (xi 1)2 )

:= (2.048, 2.048) : f (< 1, , 1 >) = 0

2 Sampling out of N + (0, ) can be done, e.g., by simply throwing away G all drawn negative values from N (0, G ) or by computing a histogram and using roulette wheel sampling.

978-1-4244-7376-2/10/$26.00 2010 IEEE

450

2010 Second World Congress on Nature and Biologically Inspired Computing Dec. 15-17, 2010 in Kitakyushu, Fukuoka, Japan

Algorithm 1 Binary Neighbor Operator N(Wi , G ) 1: input: Wi 2: input: G


3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21:

rbits N + (0, G ) pchange S Wi // ...and change rbits bits for all d {1, , D} do r U (0, 1) if r < pchange then Sd Sd end if end for return S
rbits D

// Number of bits to be changed // Probability of a bit to be changed // Overtake weed as seed...

// Draw uniform random number

Rastrigin is the following multimodal function without dependencies between the variables: f (< xi >) (Xmin , Xmax ) Global minimum =
2 10 n + (xi 10 cos(2 xi )) i=1 n

weed for an n-dimensional benchmark problem is encoded as: Wi = (v1 , v2 , , vn )T (5)

:= (5.12, 5.12) : f (< 0, , 0 >) = 0

Griewank is a multimodal function with strong dependencies between the variables and is dened as follows: f (< xi >) (Xmin , Xmax ) Global minimum = 1+
n 2 xi xi cos( ) i i=1 i=1 4000 n

To evaluate a binary weed, its bitstring needs to be converted to a real-valued vector. This is realized by performing the following steps for each vi : 1) The bitstring of a value vi is interpreted as a natural number ni and converted by this: 1: ni (vi )1 // Start with rst bit... 2: // ...and append all others 3: for all d {2, , Nbits } do 4: ni ni 1 // Shift all one to left 5: ni ni + (vi )d // Add next bit 6: end for 2) Then, this natural number ni is divided by the maximum possible value that can be represented by the bitstring to normalize it to the interval [0, 1]. Afterwards, it is mapped to the problem-specic interval [Xmin , Xmax ]. The whole procedure is dened as the function Nat2Real : : Nat2Real(n) = Xmin + n (Xmax Xmin ) 2Nbits 1 (6)

:= (600, 600) : f (< 0, , 0 >) = 0

For each of these benchmark functions, the BinIWO approach, the standard IWO method as well as the Binary PSO method were conducted. The Binary PSO [2] is the Particle Swarm Optimization as introduced by Kennedy and Eberhart [1] [4], which uses a binary encoding. BinIWO is compared to the typical gbest and lbest variants, i.e., the particle neighborhood topologies used are the star and ring structures [3]. Since the used benchmark functions are dened for realvalued vectors, a real value is encoded as a vector of Nbits bits, e.g.: vi = (0, 1, 1, 1, 0, 0, 1, 0, 1, 1)T if Nbits = 10. Thus, the dimension of D is computed as Nbits times the dimension of the benchmark problem. A binary

Of course, encoding reals as bitstrings leads to some imprecision. Two successive natural numbers n and n + 1 produce a difference of

978-1-4244-7376-2/10/$26.00 2010 IEEE

451

2010 Second World Congress on Nature and Biologically Inspired Computing Dec. 15-17, 2010 in Kitakyushu, Fukuoka, Japan

Xmax Xmin Nat2Real(n + 1) Nat2Real(n) = N 2 bits 1

(7)

Thus, it can be expected that not all problems are perfectly solvable. Increasing the length of the bitstrings increases the precision, but increases also the computational cost and feeds the curse of dimensionality. In this work, the trade-off used is a length of Nbits = 20 bits per real-value throughout all experiments and methods. The experiments were conducted with the dimensions 10, 20, , 50 for each benchmark function. For each benchmark function 100 independent runs with 1000 iterations were performed. The parameters used for the BinIWO approach were: Pinit Pmax Smin Smax init f inal mod Nbits = = = = = = = = 5 20 1 10 D 1.0 3.0 20

Note that the dimension D is the dimension of the weed bitstrings, i.e., D is the dimension of the benchmark problem multiplied by Nbits bits for each real-value. For Binary PSO, the following parameters were used: Num. of Particles Vmax Inertia Weight Cognitive Weight Social Weight Radius of Neighb. Nbits gbest 20 6 1 2 2 20 lbest 20 6 1 2 2 1 20

The plots in Figure 1 reveal that BinIWOs performance is close to the appropriate best PSO variant (three times gbest and one time lbest). Two times (Sphere, Griewank), the PSO variant is slightly better than BinIWO. In the other two cases (Rosenbrock, Rastrigin), BinIWO performs comparable to the best PSO variant. Among the two PSO variants, the gbest PSO is the winner in 3 of 4 cases. The standard IWO approach with a real-valued representation is better than all binary approaches, as would one expect. Merely, for one benchmark (Rastrigin), all binary approaches outperformed the real-valued one. The Tables I and II present numerical results for the dimensions D = 10 and D = 30. An eye-catching aspect is that no one of the used methods could solve the problems exactly (leading to a perfect hit rate of 0% for all). This can be observed for all dimensions (not all presented due to space limitations). On the one hand, even the real-valued IWO has a perfect hit rate of 0%, so it is not surprising that the binary approaches with a lower precision cannot nd perfect hits, too. On the other hand, another reason is that the minimizers of the used benchmark functions are either or vectors. Thus, a perfect hit needs to nd bitstrings 0 1 that represent the real-values 0 or 1. But if we take the Nat2Real(n) = r mapping and use its inverse function Nat2Real 1 (r) = n = r Xmin (2Nbits 1) Xmax Xmin (8)

to determine the natural number (or bitstring) that is mapped to a specic real, we nd the following naturals for the given benchmarks: Sphere: Rosenbrock: Rastrigin: Griewank: / Nat2Real 1 (0) = 524287.50 / Nat2Real 1 (1) = 780287.26 / Nat2Real 1 (0) = 524287.50 / Nat2Real 1 (0) = 524287.50

The range [Xmin , Xmax ] is set according to the benchmark functions (see above). V. R ESULTS In Figure 1 the results over all considered dimensions are presented. Additionally, the numerical results for dimensions D = 10 and D = 30 are presented in Tables I and II. There, the column Perfect hits (%) shows how many of the runs could nd a perfect solution. The column Avg. Gen. presents the average number of needed generations to nd a solution and is computed the following way. Assumed,
( 9.8 1 , , , , 0.3 g-1 , , 0.1 g , , 0.1 g+1 , , , , 0.1 ) 1000

Since Nat2Real 1 (0) and Nat2Real 1 (1) deliver nonnaturals, there are no bitstrings that represent 0 or 1. (The fact that 3 benchmark functions have the same natural is due to the symmetry of the used bounds.) Thus, perfect hits are not possible. In Table I the Sphere benchmark for 10 dimensions is solved by all binary methods with a standard deviation of 0.0 and the same tness. If one of both closest bitstring approximations to 0 is taken (524287 or 524288) and the best possible real-value is used as minimizer for the Sphere benchmark, one obtains

is the convergence graph of a single run with 1000 iterations. Then, g is the generation, where the best tness of this run (0.1) occurred. A value in column Avg. Gen. is the average g value over 100 runs.

i=1

xi2 = Nat2Real(524287)2 = 0.000000000238


i=1

10

10

which is the solution found by all binary methods. This solution is a perfect hit according to the imprecision caused by the encoding.

978-1-4244-7376-2/10/$26.00 2010 IEEE

452

2010 Second World Congress on Nature and Biologically Inspired Computing Dec. 15-17, 2010 in Kitakyushu, Fukuoka, Japan

Table I R ESULTS FOR ALL BENCHMARK PROBLEMS FOR dimension D = 10. T HE COLUMN AVG . F ITNESS IS THE BEST FITNESS VALUE REACHED ON AVERAGE , S . D . THE APPROPRIATE STANDARD DEVIATION , P ERFECT HITS (%) THE PERCENTAGE OF PERFECT SOLUTIONS (F(Wi ) = 0) AND AVG . G EN . THE AVERAGE NUMBER OF NEEDED GENERATIONS FOR THE BEST SOLUTION OF A RUN . W ITHIN EACH BENCHMARK FUNCTION THE METHODS ARE RANKED ACCORDING TO AVG . F ITNESS . Benchmark Sphere Sphere Sphere Sphere Rosenbrock Rosenbrock Rosenbrock Rosenbrock Rastrigin Rastrigin Rastrigin Rastrigin Griewank Griewank Griewank Griewank Method BinPSO (gbest) BinIWO BinPSO (lbest) IWO IWO BinPSO (lbest) BinIWO BinPSO (gbest) BinIWO BinPSO (lbest) IWO BinPSO (gbest) IWO BinPSO (lbest) BinIWO BinPSO (gbest) Avg. Fitness 0.000000000238 0.000000000238 0.000000000238 0.000000070369 2.884085958674 7.057624284281 9.527573774841 24.525359415933 6.481830805268 11.163435732997 11.601224275027 12.434003743979 0.067283835514 0.115230752441 0.120559346051 0.183255949024 s.d. 0.0 0.0 0.0 0.000000016380 0.757662691348 2.074808695492 9.473119685946 27.806654167004 3.874385446716 3.566266355693 5.137714264290 4.876940119625 0.029956724761 0.093981767718 0.070853902972 0.117605271792 Perfect hits (%) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Avg. Gen. 459.25 660.89 749.40 985.62 999.00 881.40 791.28 533.45 835.17 878.42 984.89 563.06 984.65 844.24 771.20 516.69

Table II R ESULTS FOR ALL BENCHMARK PROBLEMS FOR dimension D = 30. T HE COLUMN AVG . F ITNESS IS THE BEST FITNESS VALUE REACHED ON AVERAGE , S . D . THE APPROPRIATE STANDARD DEVIATION , P ERFECT HITS (%) THE PERCENTAGE OF PERFECT SOLUTIONS (F(Wi ) = 0) AND AVG . G EN . THE AVERAGE NUMBER OF NEEDED GENERATIONS FOR THE BEST SOLUTION OF A RUN . W ITHIN EACH BENCHMARK FUNCTION THE METHODS ARE RANKED ACCORDING TO AVG . F ITNESS . Benchmark Sphere Sphere Sphere Sphere Rosenbrock Rosenbrock Rosenbrock Rosenbrock Rastrigin Rastrigin Rastrigin Rastrigin Griewank Griewank Griewank Griewank Method IWO BinPSO (gbest) BinIWO BinPSO (lbest) IWO BinIWO BinPSO (lbest) BinPSO (gbest) BinPSO (gbest) BinIWO BinPSO (lbest) IWO IWO BinPSO (gbest) BinIWO BinPSO (lbest) Avg. Fitness 0.000001395091 0.000001613151 0.000015015993 0.001061702228 27.316101657106 68.443839274939 71.078311634243 123.200027882953 50.244865545201 51.340225946420 52.427209396743 75.049852115054 0.009591044672 0.109664950282 0.117438932557 0.493473253314 s.d. 0.000000206383 0.000001444926 0.000041989707 0.001416908213 1.110612090161 53.005876557490 43.643981351458 62.600389953540 10.092224937911 9.430066007963 8.878241293134 19.590889108129 0.009164015524 0.142093859528 0.120543247779 0.241482425977 Perfect hits (%) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Avg. Gen. 993.08 996.93 997.99 995.87 998.90 998.06 995.80 996.93 997.37 997.99 995.60 991.74 993.99 997.21 998.09 995.42

VI. C ONCLUSIONS In this paper an Invasive Weed Optimization with binary encoding (BinIWO) was introduced and applied to four typical benchmark functions. BinIWO determines its binary seeds (offspring) in a normally distributed neighborhood in the space of bitstrings. The normal distribution is realized over the number of different bits. The results indicate that IWO can also be used for binary problems. Compared to PSO, its performance is more or less comparable to the best PSO variant used. Neither BinIWO nor BinPSO could solve the problems exactly, comparable to the standard IWO. One reason is the inherent imprecision of encoding reals as bitstrings. A possible solution (at least for lower dimensions) could be to use asymmetric bounds in

a way that Nat2Real 1 (0), Nat2Real 1 (1) . But in realworld applications one did not know, which real-values a minimizer needs. Thus, a binary approach should also work, if the needed real-values are not represented exactly, but only approximately. Because BinIWO performs not worse than the Binary PSO method, it fullls this demand. Since the performance of BinIWO is merely comparable to BinPSO for the used benchmarks, one may wonder why BinIWO should be used in place of BinPSO. Although BinIWO has no signicant benet for the four problems used as benchmarks, this needs not to be true in general. According to the No Free Lunch theorem, there is no algorithm that performs best in all possible problem domains. Thus, there will be problems, where BinPSO is not better

978-1-4244-7376-2/10/$26.00 2010 IEEE

453

2010 Second World Congress on Nature and Biologically Inspired Computing Dec. 15-17, 2010 in Kitakyushu, Fukuoka, Japan

Fitness for Sphere Benchmark 0.12 Binary IWO Real-valued IWO Binary PSO (g-best) Binary PSO (l-best) 200 0.08 150 Fitness Fitness 0.06 250 Binary IWO Real-valued IWO Binary PSO (g-best) Binary PSO (l-best)

Fitness for Rosenbrock Benchmark

0.1

0.04

100

0.02 50 0

-0.02 10 20 30 Dimension 40 50

0 10 20 30 Dimension 40 50

Fitness for Rastrigin Benchmark 200 180 160 1 140 120 Fitness 100 80 0.4 60 40 20 0 10 20 30 Dimension 40 50 10 20 0.2 Fitness 0.8 Binary IWO Real-valued IWO Binary PSO (g-best) Binary PSO (l-best) 1.4 Binary IWO Real-valued IWO Binary PSO (g-best) Binary PSO (l-best)

Fitness for Griewank Benchmark

1.2

0.6

30 Dimension

40

50

Figure 1.

The averaged tness values obtained for all benchmark functions.

than BinIWO. Future works should work out, which sort of problem domains clearly benet from BinIWO and which not. R EFERENCES
[1] J. Kennedy and R.C. Eberhart, Particle Swarm Optimization, IEEE International Conference on Neural Networks, Perth, Australia, IEEE Service Center, Piscataway, NJ, 1995 [2] J. Kennedy and R.C. Eberhart, A Discrete Binary Version of the Particle Swarm Algorithm, In: Proc. of the World Multiconference on Systemics, Cybernetics and Informatics, pp. 4104-4109, 1997 [3] J. Kennedy, Small worlds and mega-minds: Effects of neighborhood topology on particle swarm performance, Proceedings of the 1999 Conference on Evolutionary Computation, Volume 3, pp. 1931-1938, 1999 [4] J. Kennedy and R.C. Eberhart, Swarm Intelligence, Morgan Kaufmann Publishers, ISBN: 1-55860-595-9, 2001 [5] A.R. Mehrabian and C. Lucas, A novel numerical optimization algorithm inspired from weed colonization, Ecological Informatics, vol. 1, pp. 355-366, 2006

978-1-4244-7376-2/10/$26.00 2010 IEEE

454

Das könnte Ihnen auch gefallen