# Advanced Parameter-Setting-Free Harmony Search Algorithm
## 2 Conventional HS Algorithm
### Conventional Parameter-Setting-Free HS  
HMCR and PAR, which are parameters used in HS, are important parameters that affect the performance of the HS algorithm because they determine whether to use the variable in HM that stores the best value among previously calculated values or to change and use it. It is shown in Figure 2. In general HS algorithm, HMCR and PAR are explicitly set to fixed values. Many reports on adaptive HS [8; 9; 10; 11; 12; 13], which are used to determine HMCR and PAR, have been published, but these only provide the basic values; however, the PSF HS algorithm is proposed for automatically determining such HMCR and PAR.  
The conventional PSF HS algorithm [4] first performs a fixed number of iterations with a fixed HMCR and PAR and then stores information about whether the values stored in HM are random values, existing values (HMCR), or changes to existing values (PAR) in each new memory. Figure 3 shows the change of HMCR and PAR when the periodic function, one of the test functions, is executed with the conventional PSF scheme with four variables. As shown in Equations (1) and (2), the number of times the values stored in HM are divided by HMS is used as the HMCR and PAR.  
\[\text{HMCR}_{i}=\frac{n\big{(}y_{i}^{j}=Memory\big{)}}{\text{HMS}} \tag{1}\]  
\[\text{PAR}_{i}=\frac{n\big{(}y_{i}^{j}=Pitch\big{)}}{\text{HMS}} \tag{2}\]  
Figure 2: Expansion of the “Make new harmony” box from Figure 1.  
The conventional PSF HS has the advantage of changing the HMCR and PAR by determining the current implementation method according to the existing performance. However, as the number of repetitions increases, the HMCR and PAR values of each variable become 1 or 0. After a certain number of repetitions, certain variables use only combinations or random values as the values of HM, and only specific variables are adjusted. This makes it hard to get better results. It also has the disadvantage of requiring additional memory to store the work done for each HM variable.  
PSF HS has the advantage that even when using a variable value for setting HMCR and PAR, the value may be specified without a parameter, unlike other methods where there is at least one part that needs to be determined by the user. However, there is a problem that HMCR and PAR converge to 0 or 1 after a certain number of HS iterations. Due to this problem, some papers [6; 14] using PSF HS have proposed modifying HMCR and PAR as in Equations (3) and (4).  
\[\text{HMCR}_{i}=\min(\frac{n\Big{(}y_{i}^{j}=Memory\Big{)}}{\text{HMS}},\ HMCR_{min}) \tag{3}\]  
\[\text{PAR}_{i}=\max(\frac{n\Big{(}y_{i}^{j}=Pitch\Big{)}}{\text{HMS}},PAR_{max}) \tag{4}\]  
This approach ensures that the HMCR and PAR do not converge to zero or one. \(HMCR_{min}\) is set to a value near 1, and \(PAR_{max}\) is set to a value near 0. All conventional PSF schemes in this study use the results calculated with \(HMCR_{min}=0.99\) and \(PAR_{max}=0.01\). Applying conventional PSF to HS is equivalent to changing the \"Calculate and Compare HM\" box in Figures 1-4.  
Figure 3: Problems of conventional parameter-setting-free harmony memory consideration rate (PSF-HMCR) and PSF-pitch adjustment rate (PAR) that use a 4-dimensional periodic function, 50 harmony memory size (HMS), fixed 0.5 HMCR, and 0.5 PAR for the first 100 test iterations: (**a**) HMCR in 800 iterations and (**b**) PAR in 800 iterations.