2.2.2. Separating Operator

The separating process whereby male elephants leave their family group can be modeled into separating operator when solving optimization problems. The separating operator is implemented by the elephant individual with the worst fitness in each generation, as shown in Equation (4).

$$\mathbf{x}\_{\text{nrosst},xi} = \mathbf{x}\_{\text{min}} + (\mathbf{x}\_{\text{max}} - \mathbf{x}\_{\text{min}} + \mathbf{1}) \times rand \tag{4}$$

where *x*max represents the upper bound of the individual and *x*min indicates lower bound of the individual. *xworst,ci* indicates the worst individual in clan *ci*. *Rand* [0, 1] is a stochastic distribution between 0 and 1.

According to the description of the clan-updating operator and separating operator, the mainframe of EHO is summarized. The corresponding flowchart is shown as follows. *MaxGen* is the maximum generation. The MATLAB code of EHO can be found on the website: https://www.mathworks.com/ matlabcentral/fileexchange/53486. The basic steps of the EHO is shown as follows (Algorithm 1). The corresponding flowchart can also be seen in Figure 3.

**Figure 3.** Flowchart of the EHO algorithm.


(1) **Begin**

(2) **Initialization.** Set the initialize iterations *G* = 1; initialize the population *P* randomly; set maximum generation *MaxGen*.


**if**

```
(7) Generate xnew, ci,j and update xci,j by Equation (1).
(8) If xci,j = xbest,ci then
```
(9) Generate *xnew, ci,j* and update *xci,j* by Equation (2).

```
(10) End
```
(11) **End for**

```
(12) End for
```

```
(13)Forall
```

```
   clans ci do
(14) Replace the worst individual ci by Equation (4).
(15) End for
(16) Evaluate each elephant individual according to its position.(17) T = T + 1.
(18) End while
(19)End.
```
#### 2.2.3. Analysis of Algorithm Complexity

The computational complexity of the EHO algorithm is analyzed according to the steps in the EHO algorithm. Let the population size and dimension be *NP* and *D*, respectively. Obviously, sort the population according to the fitness of individuals in step (4) with time complexity *O*(*NP*). In steps (5)–(12), execute clan-updating operator for all clans *ci* with time complexity *O*(*NP* × *D*). In steps (13)–(15), execute separating operator for all clans *ci* with time complexity *O*(*NP*). Evaluate each elephant individual according to its position in step (16) with time complexity *O*(*NP*). To do so, the total time complexity of elephant herding optimization is *O*(*T* × *NP* × *D*). From the above results, after omitting the low-order terms, the total time complexity of the EHO algorithm is *O*(*T* × *NP* × *D*), which is only related to *T*, *NP*, and *D*.

#### **3. Di**ff**erent Variants of EHO**

Several EHO variants have been proposed to solve different optimization problems. The variants of EHO can be generally divided into three groups: improved EHO algorithms, hybrid EHO algorithms, and variants of EHO.

#### *3.1. Improved EHO Algorithms*

A list of the improved EHO algorithms is given in Table 1 and Figure 4. An overview of each of these methods is given below.
