## 4 Hybrid Harmony Search-Simulated Annealing Algorithm  
### Harmony Search  
Harmony Search (HS) is a population-based metaheuristic algorithm that mimics the music improvisation of a group orchestra. The musicians will improvise their harmonies with these three options: (1) select any pitch in the recorded harmony memory; (2) select and fix any previous pitch in memory; or (3) search a new music harmonisation within the range of the pitch. The process of obtaining the optimal solution is similar to this efficient search for a perfect state of harmony [32; 33]. There are five main steps in the proposed HS:_Step 1: Initialisation_  
In HS, several solutions are generated to produce an initial population. The solutions can be generated either randomly or by the heuristics. A random initial population called harmony memory (HM) is created and sorted according to their fitness values. The number of solutions in the HM is the harmony memory size (HMS). An HM can be described in the following matrix:  
\[HM = \left(\begin{array}{cccc}x_{1}^{1}&x_{2}^{1}&\cdots&x_{n}^{1}\\ x_{1}^{2}&x_{2}^{2}&\cdots&x_{n}^{2}\\ \vdots&\vdots&\ddots&\vdots\\ x_{1}^{HMS}&x_{2}^{HMS}&\cdots&x_{n}^{HMS}\\ \end{array}\right)\, \tag{21}\]  
where,  
\(x_{i}^{j}=\) decision variable of \(i=1,2,\ldots,n\) and \(j=1,2,\ldots,HMS\),  
\(f\!\left(x^{j}\right)=\) fitness function of \(x^{j}\) for \(j=1,2,\ldots,HMS\).  
_Step 2: Parameter Setting_  
Harmony memory considering rate (HMCR) and pitch adjustment rate (PAR) are two main parameters used in the HS algorithm. An appropriate value of HMCR will lead to the choices of good solutions as an element of new solutions. The convergence will be slow if the value of HMCR is too high. Some potential good solutions will not be well explored. But if it is too low, only a few good solutions are selected for the next iteration. Therefore, to use memory effectively, the value of HMCR should be between 0.7 and 0.95 [34]. The speed of convergence in a standard HS algorithm may be slow if the value of PAR is too small. Besides, a high value of PAR is also not recommended. It can cause solutions to be stuck around a few potential optimal and easily get trapped in local optima. Due to this, [34] stated that the value of PAR is suggested to be between 0.1 and 0.5. However, this range may be suitable and valid for some problems only.  
To balance the exploration and exploitation, instead of using a fixed value, in this paper, the proposed HS uses a dynamic value of \(H\!M\!CR_{it}\) and \(PAR_{it}\) introduced by [35]. The reason for reducing the \(H\!M\!CR_{it}\) slowly is to increase the probability of exploring more solution space, not in the HM. Hence, the global optimal can be attained [36]. The dynamic value of \(H\!M\!CR_{it}\) and \(PAR_{it}\) can avoid the solutions getting trapped in the local optimum quickly as well. With a slight modification, the proposed \(H\!M\!CR_{it}\) and \(PAR_{it}\) are reduced gradually when there is no improvement found in the solution. In this paper, the range values of \([H\!M\!CR_{min},H\!M\!CR_{max}]\) and \([PAR_{min},PAR_{max}]\) are set to be [0.7, 0.95] and [0.3, 0.9], respectively. Equations (23) and (24) below are the formulation of dynamic \(H\!M\!CR_{it}\) and \(PAR_{it}\):  
\[H\!M\!CR_{it} = H\!M\!CR_{max}-\frac{(H\!M\!CR_{max}-H\!M\!CR_{min})\times it}{ Maxlt} \tag{22}\] \[PAR_{it} = PAR_{max}-\frac{(PAR_{max}-PAR_{min})\times it}{Maxlt}\, \tag{23}\]  
where,  
\(it=\) current iteration,  
\(Maxlt=\) maximum number of iterations,  
\(H\!M\!CR_{max}=\) maximum value of HMCR,  
\(H\!M\!CR_{min}=\) minimum value of HMCR,  
\(PAR_{max}=\) maximum value of PAR,  
\(PAR_{min}=\) minimum value of PAR.