# Adaptive Imitation Scheme for Memetic Algorithms

Ehsan Shahamatnia, Ramin Ayanzadeh, Rita A. Ribeiro, Saeid Setayeshi

<figure><img src="image_1.png" /></figure>

## To cite this version:

Ehsan Shahamatnia, Ramin Ayanzadeh, Rita A. Ribeiro, Saeid Setayeshi. Adaptive Imitation Scheme for Memetic Algorithms. 2nd Doctoral Conference on Computing, Electrical and Industrial Systems (DoCEIS), Feb 2011, Costa de Caparica, Portugal. pp.109-116, 10.1007/978-3-642-19170-1_12. hal-01566558

HAL Id: hal-01566558

https://inria.hal.science/hal-01566558

Submitted on 21 Jul 2017

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>
# Adaptive Imitation Scheme for Memetic Algorithms

Ehsan Shahamatnia¹, Ramin Ayanzadeh², Rita A. Ribeiro¹, Saeid Setayeshi³

¹ UNINOVA-CA3, UNL-FCT Campus, 2829-516 Caparica, Portugal
E.Shahamatnia@fct.unl.pt, rar@uninova.pt

² Islamic Azad University, Science and Research Campus, Tehran, Iran
ayanzadeh@srbiau.ac.ir

³ Amirkabir University of Technology, setayesh@aut.ac.ir

**Abstract.** Memetic algorithm, as a hybrid strategy, is an intelligent optimization method in problem solving. These algorithms are similar in nature to genetic algorithms as they follow evolutionary strategies, but they also incorporate a refinement phase during which they learn about the problem and search space. The efficiency of these algorithms depends on the nature and architecture of the imitation operator used. In this paper a novel adaptive memetic algorithm has been developed in which the influence factor of environment on the learning abilities of each individual is set adaptively. This translates into a level of autonomous behavior, after a while that individuals gain some experience. Simulation results on benchmark function proved that this adaptive approach can increase the quality of the results and decrease the computation time simultaneously. The adaptive memetic algorithm proposed in this paper also shows better stability when compared with the classic memetic algorithm.

**Keywords:** Optimization, Evolutionary computing, Memetic algorithm, Imitation operator, Adaptive imitation

## 1 Introduction and related works

Increasingly, complex systems in different domains raise challenging problems which cannot efficiently be solved with conventional methods. The quest for a solution to these kinds of problems has led researches to use soft computing techniques, by which they can obtain near optimal solutions [5,6]. Genetic algorithm (GA) is one of the earliest and most renowned metaheuristics successfully applied on many real world problems [13-16]. Genetic algorithms, like many other metaheuristics, such as particle swarm optimization, explore large areas of search space and locate local minima in early iterations but slack off in trying to find the global optimum [1]; this behavior is demonstrated in Fig. 1. Another major problem these metaheuristics face is their instability. Due to their stochastic nature they may produce quite different results in different runs of algorithm [5]. Among many contributions made to overcome these problems and aiming to improve their performance, another family of metaheuristics, called memetic algorithms, has attracted many researchers. A memetic algorithm, henceforth called MA, is a hybridization of a global optimization technique with a cultural evolutionary stage
which is responsible for local refinements [17,26]. It is reported in the literature that the marriage between global and local search is almost always beneficial [1-3,18,23-25]. Memetic algorithms are also known in the literature as Hybrid Evolutionary Algorithms, Hybrid GAs, Baldwinian or Lamarckian Evolutionary Algorithms, Cultural Algorithms or Genetic Local Searchers.

<figure><img src="image_3.png" /><figcaption>Fig. 1. Sample performance of a genetic algorithm in minimizing a test function.</figcaption></figure>

As biologists put it, a gene is the unit of heredity in a living organism via which the physiological characteristics such as eye and hair color is passed from parents to offsprings. First used in 1976 by Richard Dawkins [4], memes are cultural analogues to genes, in that they are responsible for transmitting the behavioral characteristics such as beliefs and traditions [2]. Biologists believe that genes in a chromosome are (normally) intact during their life span, while psychologists argue that memes are from a more dynamic nature, and they can improve and change under the influence of the environment they are exposed to. Actually the cornerstone of memetic algorithms is that individuals can improve their fitness by means of imitation.

To implement this concept in the computational framework, several approaches have been suggested such as multi-meme MA [17,19], coevolving and self generation MA [20] and multi-agent MA [21], but the mainstream is to conduct a type of local search around each possible solution's neighborhood within a predefined radius [5-7]. In the rest of this paper we will consider GA based memetic algorithm but the results can be extended to the most MAs as well. Regarding the interaction of genes and memes in the memetic algorithm evolution process, two main strategies can be witnessed; in memetic algorithms based on Lamarckian theory, the results obtained from imitation operator overwrite the genes. In other words, individuals are strongly affected by the environment and the change in their aptitude is disseminated via the alteration in their genes. In Baldwinian memetic algorithms genes and memes are stored separately [3] as illustrated in figure 2. In this strategy, genes are utilized in the reproduction and memes are utilized in the process of choosing the chromosomes. Hence, among chromosomes with similar fitness, those who have better solutions in their neighborhood have higher chance of reproduction [3].
<figure><img src="image_4.png" /><figcaption>Fig. 2. Sample chromosome in Baldwinian MA</figcaption></figure>

It is well established that pure genetic algorithms cannot easily fine tune the solutions in a complex search space [1], whereas if they are coupled with an individual learning procedure capable of performing local refinements the results will be promising [8,9,22]. Benefitting from both Darwinian evolution and domain specific heuristics, memetic algorithms not only balance the generality and problem specificity, but also render a good methodology to trade off between the exploration capacities of underlying GA and the exploitation capabilities of local search heuristic. In the other hand this translates into more computations, more time and loss of diversity within population [10]. As an example, with a classic hill climbing algorithm, for a chromosome with *n* genes if each gene can take 3 different values, then in each iteration 3ⁿ different neighbors must be checked. To ameliorate these drawbacks, we first propose an adaptive imitation scheme and then we study the performance of variations of hill climbing search strategy in conjunction with the adaptive imitation.

Beside their strengths, memetic algorithms also have their limitations. This paper addresses two major issues related to memetic algorithm design and performance. First issue is designing an appropriate local search scheme for the problem at hand. For some problems it is very difficult to define a neighborhood mechanism for a point in the search space. Furthermore, local search strategies usually bear high computational time [11]. Second issue is setting the imitation operator parameters. In this paper first we propose an adaptive scheme to define the intensity of imitation operator. Then the effect of this adaptive scheme has been studied on different variations of hill climbing local search.

The rest of the paper is organized as follows. In Section 2, we discuss the technological innovation of this paper for sustainability. In section 3, the proposed adaptive imitation operator is evaluated and different local search strategies are studied. The simulation results are also discussed in this section. Finally, Section 4 concludes this paper.

## 2 Technological Innovation for Sustainability

This work impacts on sustainability when we are challenged by finding optimal solutions for increasingly complex systems (mostly in terms of dimension of the search space) in different domains, which cannot be efficiently solved with conventional optimization methods. These problems can range from water resource optimization, control and optimization of renewable energy systems, supply chain management and risk management in sustainability proactive strategies. The quest for a solution to these kinds of problems has led researches to use soft computing techniques, by which they can obtain near optimal solutions [13-16]. Memetic algorithms are a class of meta-heuristic algorithms which combine a global optimization technique with a cultural evolutionary stage responsible for local refinements [5]. In this paper, we propose a novel adaptive memetic algorithm,
where the influence factor of the environment, on the learning abilities of each individual, is set adaptively. This translates into a level of autonomous behavior. In summary, we first propose a memetic algorithm, which includes an adaptive imitation scheme, and then we study the performance of variations of hill climbing search strategy in conjunction with the adaptive imitation. With the improved performance achieved by proposed memetic algorithm we can solve the above mentioned problems more efficiently and achieve better results.

## 3 Research contributions and simulation results

As mentioned earlier, the structure of local search algorithms imposes a high computational cost, which is exponential. Simulation results verify that the performance of memetic algorithms is highly dependent to the neighborhood size. For example in a problem with continuous values for genes, smaller neighborhood radius (up to a threshold) leads to better solution, but the price is increased number of evaluations and much computational time. Hence, a dynamic imitation rate in which the neighborhood size is adjusted based on the iteration can guide the searching strategy more wisely. To calculate the imitation rate in continuous search space, equations below are presented:

$$imitation\_rate\_I = \left(1 - \frac{t-1}{T}\right)^a \qquad (1)$$

$$imitation\_rate\_II = e^{-\frac{1}{2} \left( \frac{(t-1)^2}{aT} \right)} \qquad (2)$$

where t is the current iteration, T is the maximum number of iterations and a is the adaption coefficient. Imitation rate diagram for different values of a is illustrated in figure 3.

The metaphorical concept suggests that imitation can be feckless in some situations, i.e. impulsive imitation misleads the evolution process. Each person during his life span benefits from the interactions with the environment as means to improve his competency in the society, but the scale to which he is influenced from the environment usually decreases as he grows older. In the proposed imitation adaption scheme, diversity of the population is estimated by the iteration number. In the first iterations population should be as diverse as possible to cover all searching space, but achieving final iterations diversity of solutions decreases. In this scheme the imitation rate of individuals decreases along the evolution process. This will not only reduce the unnecessary evaluation of neighbors, i.e. increase the speed, but it also regulates the exploitation rate and leads to improved solutions.
<figure><img src="image_5.png" /><figcaption>Fig. 3. Imitation rate for different values of a. Left: Equation 1, Right: Equation 2</figcaption></figure>

Hill climbing local search has been one of the most used canonical imitation operators, suitable for continuous search space [3,18,25]. In the following section different variations of hill climbing algorithm is evaluated and the simulation results are discussed. In these simulations the imitation rate is calculated adaptively using equation 1 and equation 2. To make comparisons we use Ackley test function. Numerous local minima in the search space of this function have made it one of the popular benchmark functions for the assessment of evolutionary algorithms [5,7]. Equation 3 represents the Ackley function in n-dimensional space:

$$f(X) = -ae^{-b\left(\sqrt{\frac{1}{n}\sum_{i=1}^{n}(x_i)^2}\right)} - e^{-b\left(\sqrt{\frac{1}{n}\sum_{i=1}^{n}\cos(cx_i)}\right)} + a + e \quad (3)$$
$$a = 20, b = 0.2, c = 2\pi$$

Taking into account the stochastic nature of evolutionary algorithms, for each simulation we run the algorithm 30 times and get the best solution and average of the solutions to compare the algorithm performance. Variance of the solutions is also presented to assess the stability of algorithms; smaller variance indicates that solutions obtained from different runs of the algorithm are closer to the average index. Time index indicates the average time a single run of algorithm takes. For all memetic algorithms used in our study, properties of GA part are the same.

**Complete hill climbing imitation**-- In this algorithm all possible neighbors of a chromosome are generated and evaluated and the best neighbor replaces the current chromosome. The search continues until there is no any neighbor better than current state of the chromosome. The simulation results obtained from 30 runs of the algorithm are provided in table 1. To calculate the imitation rate equation 1 and equation 2 are used. Adaption coefficient is set empirically for each problem space. Since the number of iterations required for imitation operator is not predictable and the computational cost is exponential, running time for this algorithm differs in various runs and even the algorithm may end up acting like a complete search.

<table><caption>**Table. 1.** Simulation results for complete hill climbing with adaptive imitation</caption><thead><tr><th>Adaption equation</th><th>a</th><th>Time (s)</th><th>Solution average</th><th>Solution variance</th><th>Best solution</th></tr></thead><tbody><tr><td>Eq. 1</td><td>3</td><td>16.02</td><td>4.368 × 10<sup>-8</sup></td><td>3.174 × 10<sup>-14</sup></td><td>0.000 × 10<sup>-3</sup></td></tr><tr><td>Eq. 2</td><td>5</td><td>16.02</td><td>8.839 × 10<sup>-8</sup></td><td>4.329 × 10<sup>-14</sup></td><td>3.553 × 10<sup>-15</sup></td></tr></tbody></table>
**First-best hill climbing imitation--** Contrary to the complete hill climbing search, this algorithm stops the search procedure as soon as a neighbor better than current chromosome is found. In the worst case first-best hill climbing search is like complete hill climbing search, but the simulation results in table 2 show that the running time of this algorithms is improved compared to the previous one.

<table><caption>**Table. 2.** Simulation results for first-best hill climbing with adaptive imitation</caption><thead><tr><th>Adaption equation</th><th>a</th><th>Time (s)</th><th>Solution average</th><th>Solution variance</th><th>Best solution</th></tr></thead><tbody><tr><td>Eq. 1</td><td>3</td><td>10.23</td><td>5.310 × 10<sup>-9</sup></td><td>6.672 × 10<sup>-14</sup></td><td>0.000 × 10<sup>-3</sup></td></tr><tr><td>Eq. 2</td><td>4</td><td>10.22</td><td>3.199 × 10<sup>-9</sup></td><td>5.648 × 10<sup>-14</sup></td><td>3.553 × 10<sup>-15</sup></td></tr></tbody></table>

**Single-step hill climbing imitation--** This imitation operator considers a hill climbing search with only a single step (iteration). After all the neighbors of a chromosome are evaluated, best neighbor (if any) replaces the current chromosome and search stops. Since each imitation operation is a single step forward, the computational time of the algorithm in different runs is the similar. Simulation results are provided in table 3.

<table><caption>**Table. 3.** Simulation results for single-step hill climbing with adaptive imitation</caption><thead><tr><th>Adaption equation</th><th>a</th><th>Time (s)</th><th>Solution average</th><th>Solution variance</th><th>Best solution</th></tr></thead><tbody><tr><td>Eq. 1</td><td>5</td><td>6.43</td><td>3.165 × 10<sup>-9</sup></td><td>4.677 × 10<sup>-17</sup></td><td>3.553 × 10<sup>-15</sup></td></tr><tr><td>Eq. 2</td><td>2</td><td>6.43</td><td>1.701 × 10<sup>-11</sup></td><td>3.032 × 10<sup>-22</sup></td><td>0.000 × 10<sup>-3</sup></td></tr></tbody></table>

Table 4 provides the simulation results to compare an enhanced GA with elitism, standard GA based memetic algorithm (MGA) and single-step memetic algorithm (SSMGA) together. It can be seen that the memetic algorithm with single-step hill climbing search and using the adaptive imitation outperforms other algorithms both in computational time and in the performance.

<table><caption>**Table. 4.** Simulation results comparing GA and variations of MA with adaptive imitation</caption><thead><tr><th>Algorithm</th><th>a</th><th>Time (s)</th><th>Solution average</th><th>Solution variance</th><th>Best solution</th></tr></thead><tbody><tr><td>GA</td><td>-</td><td>4.32</td><td>4.09 × 10<sup>-6</sup></td><td>2.70 × 10<sup>-10</sup></td><td>5.58 × 10<sup>-15</sup></td></tr><tr><td>MGA</td><td>10<sup>-1</sup></td><td>11.2</td><td>1.10 × 10<sup>-6</sup></td><td>3.61 × 10<sup>-11</sup></td><td>5.55 × 10<sup>-15</sup></td></tr><tr><td>MGA</td><td>10<sup>-3</sup></td><td>285.2</td><td>7.49 × 10<sup>-7</sup></td><td>9.33 × 10<sup>-12</sup></td><td>3.55 × 10<sup>-15</sup></td></tr><tr><td>MGA</td><td>10<sup>-6</sup></td><td>3892</td><td>1.81 × 10<sup>-8</sup></td><td>1.67 × 10<sup>-13</sup></td><td>2.51 × 10<sup>-15</sup></td></tr><tr><td>MGA</td><td>10<sup>-9</sup></td><td>∞</td><td>----------</td><td>----------</td><td>----------</td></tr><tr><td>SSMGA</td><td>2</td><td>6.43</td><td>1.70 × 10<sup>-11</sup></td><td>3.02 × 10<sup>-22</sup></td><td>0.00 × 10<sup>-3</sup></td></tr></tbody></table>

## 4 Conclusions and Future Works

Memetic algorithms, being the most famous hybridization method, successfully improve the performance of their underlying global search algorithm. They
effectively improve the stability and fine tune the algorithm to converge to the global optimum. Two major issues that MAs suffer from are increased computational time and designing appropriate imitation operator which defines the neighborhood function. Points that are locally optimal with respect to one neighborhood structure may not be with respect to another [12]. In this paper first we introduced an adaptive scheme to determine the imitation rate. In this scheme the capacity of individuals to be influenced by the environment is reduced as they grow older. By studying different imitation structures, we introduce a single-step hill climbing search strategy coupled with adaptive imitation.

Improvements in quality of results and computation time are usually conflicting objectives. Simulation results show that the proposed approach not only improves the efficiency of the memetic algorithm, by fewer neighbor evaluations and less computing time, but it also improves the performance by achieving better results. This verifies that excessive imitation can potentially distract the algorithm from global convergence.

Proposed contributions have been developed for problems with continuous search space, using genetic algorithm and variation of hill climbing algorithm, but the concepts can be extended to discrete domain and using other metaheuristics. Future research will further address the automatic fine tuning of the adaption coefficient.

## References

1. Krasnogor, N., Smith, J.: A memetic algorithm with self-adaptive local search: TSP as a case study. In proc. of GECCO, pp. 987--994. Morgan Kaufman, (2000)

2. Ong, Y., Keane, A.: Meta-Lamarckian Learning in memetic algorithms. In: IEEE Trans. Evol. Comput, Vol. 8, No. 2, pp. 99--110. (2004)

3. Ong, Y. S., Lim, M. H., Zhu, N., Wong, K. W.: Classification of Adaptive Memetic Algorithms: A Comparative Study. In: IEEE Transactions On Systems, Man and Cybernetics - Part B, Vol. 36, No. 1, pp. 141--152, (2006)

4. Dawkins, R.: The Selfish Gene. Oxford University Press, New York (1976)

5. Eiben, A. E., Smith, J. E.: Introduction to evolutionary computing. Springer, (2003)

6. Engelbrecht, A. P.: Fundamentals of computational swarm intelligence. John Wiely (2005)

7. Guimares, F. G., Campelo, F., Igarashi, H., Lowther, D. A., Ramrez, J. A.: Optimization of Cost Functions Using Evolutionary Algorithms With Local Learning and Local Search, Magnetics. In: IEEE Transactions, (2007)

8. Freisleben, B., Merz, P.: New Genetic Local Search Operators for the Traveling Salesman Problem. In: Lecture Notes in Computer Science, Vol.1141, pp. 890--900. Springer, (1996).

9. Mariano, A., Moscato, P., Norman, M.: Arbitrarily large planar etsp instances with known optimal tours. Pesquisa Operacional, (1995)

10. Araujo, M. et. al.: Constrained Optimization Based on Quadratic Approximations in Genetic Algorithms. In: Studies in Computational Intelligence. Vol. 198, pp.193--217. Springer, (2009)

11. Gallardo, J. E., Cotta, C., Fernández, A. J.: On the Hybridization of Memetic Algorithms with Branch-and-Bound Techniques. In: IEEE Transactions On System, Man, and Cybernetics, Part B: Cybernics, Vol. 37, No. 1, pp.77--83. (Feb. 2007)

12. Smith, J. E.: Coevolving Memetic Algorithms: A Review and Progress Report. In: IEEE Transactions on Systems Man and Cybernetics, Vol. 37, No. 1, pp.6--17, (2007)
13. Arabi, M., Govindaraju, R. S. and Hantush, M. M.: Cost-effective allocation of watershed management practices using a genetic algorithm, In: Water Resource Research, Vol. 42, (2006)

14. Donslund, G. B., Østergaard, P. A.: Energy system analysis of utilizing hydrogen as an energy carrier for wind power in the transportation sector in Western Denmark. In: Utilities Policy, Vol. 16, pp. 99-106, (2008)

15. McKinney, D. C., Lin, M. D.: Genetic algorithm solution of groundwater management models. In: Water Resource Research, Vol. 30, No.6, pp.1897--1906, (1994)

16. Reca, J., Martinez, J.: Genetic algorithms for the design of looped irrigation water distribution networks. In: Water Resources Research, Vol. 42, (2006)

17. Ong, Y. S., Lim, M. H., Chen, X.: Memetic Computation—Past, Present & Future [Research Frontier], In: IEEE Compu. Intel. Mag., Vol. 5, No. 2, pp.24--31, (2010)

18. Liu, B. Wang, L., Jin, Y. H.: An effective PSO-based memetic algorithm for flow shop scheduling. In: IEEE Trans. Syst., Man, Cybern. B, Vol. 37, No. 1, pp. 18--27, (2007)

19. Krasnogor, N., Blackburne, B., Burke, E. K., Hirst, J. D.: Multimeme algorithms for the structure prediction. In: PPSN VII, LNCS 2439, pp. 769--778, (2002)

20. Krasnogor, N., Gustafson, S.: Toward truly 'memetic' memetic algorithms: discussion and proof of concepts. In: Advances in Nature-Inspired Computation: The PPSN VII Workshops, pp. 21--22, (2002)

21. Ullah, A. B., Sarker, R., Cornforth, D., Lokan, C.: An agent-based memetic algorithm (AMA) for solving constrained optimization problems. In: IEEE Congress on Evolutionary Computation, pp. 999--1006, (2007)

22. Ishibuchi, H., Yoshida, T., Murata, T.: Balance between genetic search and local search in memetic algorithms for multiobjective permutation flow shop scheduling. In: IEEE Trans. Evol. Comput., Vol. 7, pp. 204--223, (2003)

23. Moscato, P.: On evolution, search, optimization, genetic algorithms and martial arts: toward memetic algorithms. In: Tech. Rep. Caltech Concurrent Computation Program, Rep. 826, California Inst. Technol., Pasadena, CA, (1989)

24. Hart, W. E.: Adaptive Global Optimization With Local Search. In: Ph.D. dissertation, Univ. California, San Diego, CA, (1994)

25. Bersini, H., Renders, B.: Hybridizing genetic algorithms with hill-climbing methods for global optimization: two possible ways. In: Proc. IEEE Int. Symp. Evolutionary Computation, Orlando, FL, pp. 312--317, (1994)

26. Ayanzadeh, R., Shahamatnia, E., Setayeshi, S.: Determining Optimum Queue Length in Computer Networks by Using Memetic Algorithms. In: Journal of Applied Sciences, Vol. 9, No. 15, pp. 2847--2851, (2009)