3. Particle swarm optimization with a bio-inspired aging model (BAM-PSO)

The ALC-PSO variant [24] suggests an interesting approach using aging factors to define when to remove non-useful characteristics of the algorithm. However, this variant proposes a simple aging model with the following characteristics:


Consequently, there are several points that can be improved in ALC-PSO. For instance, including aging mechanisms to the rest of the particles within the swarm may help exploration without affecting the convergence. Moreover, in order to alleviate premature convergence in the PSO, there is an urgent need to include means of measuring the premature convergence in real time allowing the swarm to discard non-useful particles and to explore new candidate solutions without losing the convergence inertia toward the global minimum.

Based on previous observations, we propose a variant of the PSO named Particle Swarm Optimization with a Bio-inspired Aging Model (BAM-PSO). Our proposed algorithm considers the aging leader and challengers in the same fashion as ALC-PSO, but it applies senescence to each particle within the swarm by using the mathematical model that describes aging dynamics in Eq. (1).

For BAM-PSO to implement senescence efficiently, it is necessary to implement a mechanism that allows the algorithm to interpret when the swarm has reached a local minimum; this can be achieved by means of premature convergence measurement.

The proposed scheme in Eq. (1) can provide PSO the same self-regulation capabilities during swarm's concentration around a local minimum (known as premature convergence) if we consider the swarm as lymphocytes, and particle concentration around a local minimum as T cells concentration. Finally, senescence of the particle will be translated as a new randomgenerated particle, replacing the unresponsive one. For this to be achieved, a given particle within the swarm will have a limited number of iterations to exist within the swarm, similar to telomere length at p0, and senescence of this particle will occur when particle's capacity for search space-exploitation approaches to 0 and swarm's concentration around a local minimum has exceeded a given limit (premature convergence indicator), similar to T cells in human

**TELOMERE AT SENESCENCE**

**TELOMERE**

**TELOMERE SHORTENS AFTER MULTIPLE REPLICATIONS**

Based on this aging mechanism, it is possible to include senescence to a given particle within the swarm, and the lifespan of each particle will be adjusted according to the error produced

by its candidate solution and the premature convergence indicator of the swarm.

immune systems [35].

Figure 1. Telomere division process in human T cells.

12 Particle Swarm Optimization with Applications

In the aging model represented by Eq. (1), the number of cells can be interpreted as a measure of the particles numbers around the same one-dimensional location. In this sense, measuring the standard deviation among the swarm in each particle dimension can be computed as follows:

$$k\_{\vec{j}} = \frac{k\_{\min}}{\sqrt{\frac{\sum\_{i=1}^{N} \sum\_{j=1}^{D} \left(\mathbf{x}\_{\vec{y}} - \mathbf{x}\_{\vec{j}}^{\tau}\right)^{2}}}} \tag{2}$$

where D ∈ R is the dimension of the problem; kmin represents the deviation minimum for all dimensions; kj is the premature convergence around j-th element of the dimension D. Note that xij is the particle within the swarm and xj represents the mean value of all j-th elements of the swarm. This scheme provides a premature convergence measurement mechanism around each element of the problem dimension.

#### 3.1. Lifespan controller

The BAM-PSO algorithm considers Eq. (2) to evaluate swarm's efficiency, and to control the lifespan of each particle, the aging mechanism proposed by [33] is adapted to the algorithm, satisfying the next criteria:

$$L\_{i\circ} = L\_{i\circ} - \alpha k\_{\circ} \tag{3}$$

$$\text{With } : \ 0 \le L\_{i\circ} \le L\_{\text{max}}$$

Step 3: Evaluate the leader or generate new challengers for leadership according to leadership

� � � f pgjð Þ <sup>t</sup> � <sup>1</sup>

M

i¼1

f pijð Þ t � 1

δLeader ¼ f leader t ð Þ� ð Þ f leader t ð Þ ð Þ � 1 ≤ 0 (9)

� � <sup>≤</sup> <sup>0</sup> (7)

http://dx.doi.org/10.5772/intechopen.71791

15

Particle Swarm Optimization Algorithm with a Bio-Inspired Aging Model

� � <sup>≤</sup> <sup>0</sup> (8)

δgBest ¼ f pgjð Þt

f pijð Þt � � �<sup>X</sup>

M

i¼1

term according to lifespan controller defined in [24]:

with leadership term: θ ¼ 1, 2, …, Θ:

Figure 2. BAM-PSO flow diagram.

<sup>δ</sup>lBest <sup>¼</sup> <sup>X</sup>

where Lij is the lifespan of the i-th particle with j-th element of dimension D. Lmax represents the maximum lifespan of any particle within the swarm.

The error improvement of the particle with respect to the iteration t is calculated by:

$$\alpha = \frac{e\_i(t)}{e\_i(t-1)}\tag{4}$$

The error of the i-th particle eið Þt is computed within the swarm at iteration t.

This scheme completes the bio-inspired, population-broad aging mechanism and will allow us to propose the final algorithm.

The steps involved in the BAM-PSO algorithm are as follows:

Step 1: Initialization. The initial positions of all particles are generated randomly within the n-dimensional search space, with velocities initialized to 0. The best particle among the swarm is selected as the leader. The age of the leader and all particles within the swarm is initialized to 0.

Step 2: Velocity and position updating. Every particle follows the velocity update rule and the position update rule presented in [8]:

$$\upsilon\_{\vec{\eta}}(t+1) = \upsilon\_{\vec{\eta}}(t) + c\_1 \mathsf{R}\_1 \left( p\_{\vec{\eta}}(t) - \mathsf{x}\_{\vec{\eta}}(t) \right) + c\_2 \mathsf{R}\_2 \left( p\_{\vec{\eta}}(t) - \mathsf{x}\_{\vec{\eta}}(t) \right) \tag{5}$$

$$\mathbf{x}\_{\vec{\eta}}(t+1) = \mathbf{x}\_{\vec{\eta}}(t) + \boldsymbol{\upsilon}\_{\vec{\eta}}(t+1) \tag{6}$$

with:

$$i = 1, 2, \ldots, \mathcal{S} \qquad j = 1, 2, \ldots, D$$

where i is the ith particle of a swarm that satisfies S∈ R<sup>D</sup>, and j is the jth element of dimension problem D. Also t represents the iteration counter, R<sup>1</sup> and R<sup>2</sup> are random, normalized and uniformly distributed values. c1, c<sup>2</sup> represents the social and cognitive parameter, xijð Þt is the particle ij position for t iteration, xijð Þ t þ 1 is the particle ij position for t þ 1 iteration, vijð Þt is the particle's ij velocity for t iteration. pijð Þt represents the local best position for particle ij in iteration t and pgjð Þt represents the global best position for entire swarm in iteration t.

Step 3: Evaluate the leader or generate new challengers for leadership according to leadership term according to lifespan controller defined in [24]:

$$\delta\_{\mathcal{S}}Best = f\left(p\_{\mathcal{S}\bar{\mathcal{Y}}}(t)\right) - f\left(p\_{\mathcal{S}\bar{\mathcal{Y}}}(t-1)\right) \le 0 \tag{7}$$

$$\delta \phi \text{Best} = \sum\_{i=1}^{M} f\left(p\_{\vec{\eta}}(t)\right) - \sum\_{i=1}^{M} f\left(p\_{\vec{\eta}}(t-1)\right) \le 0 \tag{8}$$

$$\delta\_{\text{Lender}} = f(leader(t)) - f(leader\ (t-1)) \le 0\tag{9}$$

with leadership term: θ ¼ 1, 2, …, Θ:

swarm. This scheme provides a premature convergence measurement mechanism around each

The BAM-PSO algorithm considers Eq. (2) to evaluate swarm's efficiency, and to control the lifespan of each particle, the aging mechanism proposed by [33] is adapted to the algorithm,

With : 0 ≤ Lij ≤ Lmax

where Lij is the lifespan of the i-th particle with j-th element of dimension D. Lmax represents the

<sup>α</sup> <sup>¼</sup> eið Þ<sup>t</sup>

This scheme completes the bio-inspired, population-broad aging mechanism and will allow us

Step 1: Initialization. The initial positions of all particles are generated randomly within the n-dimensional search space, with velocities initialized to 0. The best particle among the swarm is selected as the leader. The age of the leader and all particles within the swarm is initialized to 0. Step 2: Velocity and position updating. Every particle follows the velocity update rule and the

i ¼ 1, 2, …,S j ¼ 1, 2, …, D

where i is the ith particle of a swarm that satisfies S∈ R<sup>D</sup>, and j is the jth element of dimension problem D. Also t represents the iteration counter, R<sup>1</sup> and R<sup>2</sup> are random, normalized and uniformly distributed values. c1, c<sup>2</sup> represents the social and cognitive parameter, xijð Þt is the particle ij position for t iteration, xijð Þ t þ 1 is the particle ij position for t þ 1 iteration, vijð Þt is the particle's ij velocity for t iteration. pijð Þt represents the local best position for particle ij in

iteration t and pgjð Þt represents the global best position for entire swarm in iteration t.

The error improvement of the particle with respect to the iteration t is calculated by:

The error of the i-th particle eið Þt is computed within the swarm at iteration t.

The steps involved in the BAM-PSO algorithm are as follows:

vijð Þ¼ t þ 1 vijð Þþ t c1R<sup>1</sup> pijð Þ� t xijð Þt

Lij ¼ Lij � αkj (3)

eið Þ <sup>t</sup> � <sup>1</sup> (4)

þ c2R<sup>2</sup> pgjð Þ� t xijð Þt 

xijð Þ¼ t þ 1 xijð Þþ t vijð Þ t þ 1 (6)

(5)

element of the problem dimension.

14 Particle Swarm Optimization with Applications

maximum lifespan of any particle within the swarm.

3.1. Lifespan controller

satisfying the next criteria:

to propose the final algorithm.

position update rule presented in [8]:

with:

Figure 2. BAM-PSO flow diagram.

where <sup>f</sup> <sup>∗</sup>ð Þ represents the objective function value for the best candidate solution, <sup>θ</sup> the remaining leadership's term, Θ represents the maximum leadership term, δ<sup>g</sup> Best defines the entire swarm improvement factor, δ<sup>l</sup> Best represents the individual particle improvement factor, leader represents the particle within the swarm that is the acting leader (not necessarily pgjð Þt ) and whose all particles will follow according to Eqs. (5) and (6); finally, δLeader represents the leader's individual improvement factor.

minima, complex non-linear structure, or have bowl-shaped/plate-shaped structure [36, 37]; even some of them have a steep ridge and drops structure. From the literature, a list of 18 functions was considered relevant enough to test BAM-PSO performance. The selected bench-

For comparison purposes, all algorithms were configured in similar vein when it was possible, e.g. the ACS algorithm [6] uses ant-type vectors which can be considered particles in a swarm like those found in the PSO [8, 21], ALC-PSO [24] and the proposed BAM-PSO algorithms. Nevertheless, the behavior and setting are very different, since ant-type vectors behavior is determined by a mathematical model that simulates the pheromone attraction between biological ants. The DE algorithm [34] does not have a swarm-based mathematical model for the dynamics of particles, but instead the mathematical model used to simulate evolution is based on vectors and mutation factors. Finally, SSO algorithm [20] does not consider linear equations

> 4000 P<sup>n</sup> <sup>i</sup>¼<sup>1</sup> <sup>x</sup><sup>2</sup> <sup>i</sup> � <sup>Q</sup><sup>n</sup> i¼1 cos xi ffi i p � �

�20<sup>e</sup> �0:<sup>2</sup>

<sup>i</sup>¼<sup>1</sup> <sup>x</sup><sup>2</sup> i

<sup>i</sup>¼<sup>1</sup> <sup>x</sup><sup>2</sup> <sup>i</sup> <sup>þ</sup> <sup>P</sup><sup>n</sup>

<sup>i</sup>¼<sup>1</sup> ix<sup>2</sup> i

<sup>i</sup>¼<sup>1</sup> <sup>A</sup> <sup>þ</sup> <sup>P</sup><sup>n</sup>

i¼1 P<sup>n</sup> <sup>j</sup>¼<sup>1</sup> <sup>x</sup><sup>i</sup> j � � � bi h i<sup>2</sup>

i¼1 P<sup>i</sup> <sup>j</sup>¼<sup>1</sup> xj � �<sup>2</sup>

P<sup>n</sup> i¼1 P<sup>n</sup> <sup>j</sup>¼<sup>1</sup> <sup>j</sup>

<sup>i</sup>¼<sup>1</sup> <sup>106</sup><sup>i</sup>�<sup>1</sup> <sup>d</sup>�1x<sup>2</sup> i

<sup>i</sup>¼<sup>1</sup> <sup>100</sup> xiþ<sup>1</sup> � <sup>x</sup><sup>2</sup>

<sup>i</sup>¼<sup>1</sup> sen xð Þ<sup>i</sup> sen<sup>2</sup><sup>m</sup> ixi

þð Þ <sup>ω</sup><sup>n</sup> � <sup>1</sup> <sup>2</sup>

P<sup>n</sup>�<sup>1</sup>

<sup>i</sup>¼<sup>2</sup> <sup>i</sup> <sup>2</sup>x<sup>2</sup>

2 P<sup>n</sup> <sup>i</sup>¼<sup>1</sup> <sup>x</sup><sup>4</sup> <sup>i</sup> � <sup>16</sup>x<sup>2</sup>

<sup>i</sup>¼<sup>1</sup> <sup>x</sup><sup>2</sup>

<sup>i</sup>¼<sup>1</sup> ð Þ xi � <sup>1</sup> <sup>2</sup> � <sup>P</sup><sup>n</sup>

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 1 n P<sup>n</sup> <sup>i</sup>¼<sup>1</sup> <sup>x</sup><sup>2</sup> i � � p

Particle Swarm Optimization Algorithm with a Bio-Inspired Aging Model

http://dx.doi.org/10.5772/intechopen.71791

17

� <sup>e</sup> <sup>1</sup> n P<sup>n</sup> <sup>i</sup>¼<sup>1</sup> cos 2πxi � �

<sup>i</sup>¼<sup>1</sup> xixi�<sup>1</sup>

<sup>i</sup> � A cos 2πxi � � �

<sup>i</sup> þ A cos 2πxi � �

<sup>i</sup>¼<sup>1</sup> <sup>0</sup>:5ixi � �<sup>2</sup> <sup>þ</sup> <sup>P</sup><sup>n</sup>

<sup>i</sup> þ 5xi � �

i � �<sup>2</sup> <sup>þ</sup> ð Þ xi � <sup>1</sup> <sup>2</sup> h i

> <sup>i</sup> <sup>þ</sup> <sup>β</sup> � � xi j � �<sup>i</sup> � 1

� � � � <sup>2</sup>

π � �

<sup>i</sup> � xi � <sup>1</sup> � �<sup>2</sup>

<sup>i</sup>¼<sup>1</sup> ð Þ <sup>ω</sup><sup>i</sup> � <sup>1</sup> <sup>2</sup> <sup>1</sup> <sup>þ</sup> <sup>10</sup>sen<sup>2</sup>ð Þ πω<sup>i</sup> <sup>þ</sup> <sup>1</sup> �

<sup>½</sup><sup>1</sup> <sup>þ</sup> sen2πxn��; <sup>ω</sup> <sup>¼</sup> <sup>1</sup> <sup>þ</sup> xi � <sup>1</sup>

4

<sup>i</sup>¼<sup>1</sup> xisen ffiffiffiffiffiffi xi j j � � <sup>p</sup>

<sup>i</sup>¼<sup>1</sup> <sup>x</sup><sup>2</sup>

þ 20 þ e

<sup>i</sup>¼<sup>1</sup> <sup>0</sup>:5ixi � �<sup>4</sup>

mark functions are shown in Table 1.

f <sup>2</sup> Ackley

<sup>f</sup> <sup>1</sup> Griewank <sup>1</sup> <sup>þ</sup> <sup>1</sup>

f <sup>3</sup> Sphere P<sup>n</sup>

f <sup>5</sup> Zakharov P<sup>n</sup>

f <sup>6</sup> Trid P<sup>n</sup>

f <sup>7</sup> Sum of squares P<sup>n</sup>

f <sup>8</sup> Sum of exponential squares P<sup>n</sup>

f <sup>9</sup> Styblinski-Tang <sup>1</sup>

f <sup>10</sup> Shifted Rastrigin P<sup>n</sup>

f <sup>11</sup> Schwefel 1.2 P<sup>n</sup>

f <sup>12</sup> Elliptical P<sup>n</sup>

f <sup>13</sup> Rosenbrock P<sup>n</sup>

<sup>f</sup> <sup>16</sup> Michalewicz �P<sup>n</sup>

<sup>f</sup> <sup>17</sup> Levy sen<sup>2</sup>ð Þþ πω<sup>1</sup>

<sup>f</sup> <sup>18</sup> Dixon-Price ð Þ xi � <sup>1</sup> <sup>2</sup> <sup>þ</sup> <sup>P</sup><sup>n</sup>

Table 1. Benchmark functions used in algorithm performance comparison for BAM-PSO.

f <sup>15</sup> Perm D, 0, β-function

<sup>f</sup> <sup>14</sup> Schwefel <sup>418</sup>:9829<sup>d</sup> � <sup>P</sup><sup>n</sup>

<sup>f</sup> <sup>4</sup> Rastrigin An <sup>þ</sup> <sup>P</sup><sup>n</sup>

Eqs. (7), (8) and (9) indicate the leading performance of the leader. The lifespan controller utilizes these performance evaluations to adjust the leading term of leader according to the following decision tree:


θ ¼ θ � 1 leader term<sup>0</sup> ð Þ s reduction :

When the leading term of leader reaches θ ¼ 0 the leader is considered exhausted and replaced by newly generated challengers as described in [24].

Step 4: Adjust lifespan of all particles within the swarm according to Eqs. (2)–(4) and replace particles with random ones for every depleted lifespan.

Step 5: Terminal condition check. If the number of iterations is larger than the predefined or the error has reached a minimum expected value, the algorithm terminates. Otherwise go to Step 2 for a new round of iteration.

Figure 2 shows the flow chart for BAM-PSO algorithm.
