# An Improved Novel Global Harmony Search Algorithm Based on Selective Acceptance
## 2 HS, IHS, SGHS, and NGHS Algorithms
### Noval Global Harmony Search Algorithm
In other words, the key to improving the searching ability of evolutionary algorithms is to enhance the extent of balance between diversification and intensification capabilities. It can be seen that, in Section 2, Step 3 (Improvise a new harmony) in the IHS, SGHS, or NGHS algorithm is gradually improved to balance the diversification and intensification capabilities. However, in Step 4, the mechanism of updating the HM is different in these algorithms. Accept-the-better-only mechanism is used in the HS, IHS, and the SGHS algorithm. The accept-everything mechanism is used in the NGHS algorithm. This difference inspired us to explore whether the mechanism in Step 4 could affect the balance of diversification and intensification capabilities and improve the searching ability of the NGHS algorithm. However, in the process of finding a good mechanism in Step 4, the mechanism that is used in the SA algorithm attracted our attention. The SA algorithm used Boltzmann distribution to calculate the acceptable probability dynamically in each iteration and determine to accept the new solution or not by the value of acceptable probability. Therefore, in this paper, we proposed the selective acceptance novel global harmony search (SASHS) algorithm, which combined the selective acceptance mechanism with the NGHS algorithm. The main difference between the SANGHS and the NGHS algorithms is that the SANGHS algorithm will accept and replace the worst harmony in the HM with the new harmony according to the selective acceptance mechanism. In this mechanism, the selective acceptance formula as shown in Equation (6), which is also dynamically adjusted in the optimization process as in the SA algorithm, is used to further balance the diversification and intensification capabilities. However, the selective acceptance formula is different from the Boltzmann distribution in the SA algorithm and does not need to use additional parameters. In Equation (6), \(AP^{k}\) represents the acceptable probability in the current iteration \(k\). \(F_{new}^{k}\) represents the fitness value of the new harmony in the current iteration \(k\). \(F_{best}^{k}\) and \(F_{tworse}^{k}\) represent the fitness values of the best and the worst harmonies in the HM in the current iteration \(k\), respectively. According to the selective acceptance formula in the SANGHS algorithm, if the fitness of the new harmony is better than the worst harmony in the HM, the AP is equal to 1. It means that the worst harmony will be replaced by the new harmony in the HM. However, if the fitness of the new harmony is worse than the worst harmony in the HM, the SANGHS algorithm will accept the new harmony according to the AP, which is calculated by the proportion formula. Proportion formula is the most important part of the selective acceptance formula. In proportion formula, \(F_{tworse}^{k}-F_{best}^{k}\) represents the convergence degree of all harmonies in the HM. In the early iterations, all harmonies in the HM are dispersed in a large solution space, and the value of \(F_{tworse}^{k}-F_{best}^{k}\) is a large value. Thus, it is more likely to accept a worse harmony and thereby expand the range of truth region in the SANGHS algorithm, which would contribute to improve the diversification capabilities. Conversely, in the late iterations, all harmonies in the HM have converged in a small solution space; the value of \(F_{tworse}^{k}-F_{best}^{k}\) is a small value. The HM is less likely to accept a worse harmony and thereby reduce the range of truth region, which makes the SANGHS algorithm have strong intensification capabilities:  
\[AP^{k}= \begin{cases}1&if\;F_{new}^{k}\leq F_{tworse}^{k}\\ \frac{\left(F_{tworse}^{k}-F_{best}^{k}\right)}{\left(F_{tworse}^{k}-F_{best}^ {k}\right)}&if\;F_{new}^{k}>F_{tworse}^{k}\end{cases}  \tag{6}\]  
In general, the SANGHS algorithm contains the following steps:  
* Step 1: Initialize the algorithm and problem parameters  
The genetic mutation probability (\(p_{m}\)), the current iteration \(k\), and the maximum iteration (NI) are set in this step.