## 2 Harmony Search Algorithm and Selected Variants
### Improved Harmony Search (IHS)
Furthermore, a dynamic fine-tuned \(BW\) is introduced and it depends on the standard deviation \(S\) of the objective function, \(f\text{std}\,=\,S(f(\mathbf{x}^{\prime})),\forall j=1,2,...,HMS\). \(BW\) diminishes in stages according to the iteration number \(t\), while increasing with a larger range of decision variables. The improvisation step in NSHS generates a new harmony within the narrow range of \([x_{i}^{\text{\emph{worst}}},x_{i}^{\text{\emph{best}}}]\) based on conditions of \(HMCR\) and \(f\)std. Algorithm 6 outlines the computational procedure of NSHS. ```
1: Set \(HMS\), \(HMCR\), \(PAR\) using (9), and \(MaxImp\)
2:\(x_{i}^{j}=LB_{i}+U(0,1)\times(UB_{i}-LB_{i})\), \(\forall i=1,2,...,n\) and \(\forall j=1,2,...,HMS\)
3: Compute \(f(\textbf{x}),\forall j=1,2,...,HMS\)
4:while\((t\leq MaxImp)\)do
5:for each \(i\in[1,n]\)do
6:if\(U(0,1)\leq HMCR\)then
7:\(x_{i}^{\prime}=x_{i}^{j}\) where \(j\sim U(1,HMS)\)
8:if\(U(0,1)\leq PAR\)then
9:\(f^{\text{\emph{worst}}}=\text{\emph{mean}}(f(\textbf{x}))\)
10:endif (\(f(x_{i}^{\prime})\leq f^{\text{\emph{mean}}}\)) then %Group 1
11:if\((U(0,1)\leq 0.5)\)then
12:\(x_{i}^{\prime}=x_{i}^{\text{\emph{best}}}-(x_{i}^{\prime})\times U(0,1)\)
13:else %Group 2
14:\(x_{i}^{\prime}=x_{i}^{\text{\emph{best}}}+(x_{i}^{\text{\emph{worst}}}-x_{i} ^{\prime})\times U(0,1)\)
15:endif
16:else
17:\(m=integer(1+(n-1))\times U(0,1)\)
18:\(x_{m}^{\text{\emph{best}}}=x_{m}^{\text{\emph{best}}}\times\frac{\text{\emph{ \emph{UB}}}}{\text{\emph{LB}}_{n}}\)
19:\(x_{i}^{\prime}=x_{i}^{\prime}+(x_{m}^{\text{\emph{best}}}-x_{i}^{\prime}) \times U(0,1)\)
20:endif
21:\(x_{i}^{\prime}=min(max(x_{i}^{\prime},LB_{i}),UB_{i})\)
22:endif
23:else
24:\(x_{i}^{\prime}=LB_{i}+U(0,1)\times(UB_{i}-LB_{i})\)
25:endif
26:endfor
27:if\(f(\textbf{x}^{\prime})<f(\textbf{x}^{\text{\emph{worst}}})\)then
28: replace \(\textbf{x}^{\text{\emph{worst}}}\) in HM with \(\textbf{x}^{\prime}\)
29:endif
30:endwhile
```
**Algorithm 6**Novel Self-Adaptive Harmony Search

### Global Dynamic Harmony Search (GDHS)

Based on IHS [50], the Global Dynamic Harmony Search (GDHS) [58] further improves the improvisation step of HS with dynamic parameters, as well as dynamic upper and lower bounds of the decision variables. The iterative values of \(HMCR\) and \(PAR\) are made to be both decreasing and increasing in the search of global optima, as given by:

\[HMCR_{t} =0.9+0.2\times\sqrt{(\frac{t-1}{MaxImp-1})\times(1-\frac{t-1}{MaxImp-1})}, \tag{11}\] \[PAR_{t} =0.85+0.3\times\sqrt{(\frac{t-1}{MaxImp-1})\times(1-\frac{t-1}{ MaxImp-1})}. \tag{12}\]

For \(BW\), the dynamic adjustment is adapted from IHS, but with a few modifications, as follows:

\[BWden=20\times|1+\log_{10}(UB_{i}-LB_{i})|,\quad BWmax=\frac{UB_{i}-LB_{i}}{ BWden},\quad BWmin=0.001\times BWmax, \tag{13}\]

and, based on Equation (6) from IHS, the equation reduces to,

\[BW_{t}=(0.001)^{\frac{t}{MaxImp}}. \tag{14}\]

Next, a correction coefficient, \(coef\), is introduced at each iteration by:

\[coef_{t}=(1+(HMS-j))\times(1-\frac{t-1}{MaxImp-1}), \tag{15}\]

where \(j\) is the index of the selected harmony in the memory consideration step. Finally, the dynamic lower and upper bounds are obtained for the random selection step. Algorithm 7 provides the computational steps of GDHS.