2. Harmony Search
Harmony Search (HS) is a search heuristic based on the improvisation process of jazz musicians (Geem et al., 2001). In jazz music the different musicians try to adjust their pitches, such that the overall harmonies are optimized due to aesthetic objectives. Starting with some harmonies, they attempt to achieve better harmonies by improvisation. This analogy can be used to derive search heuristics, which can be used to optimize a given objective function instead of harmonies. Here the musicians are identified with the decision variables and the harmonies correspond to solutions. Like jazz musicians create new harmonies by improvisation, the HS algorithm creates iteratively new solutions based on past solutions and on random modifications. While this framework leaves a lot of space for interpretation, the basic HS algorithm is always described in the literature in the following way.
The HS algorithm initializes the Harmony Memory (HM) with randomly generated solutions. The number of solutions stored in the HM is defined by the Harmony Memory Size (HMS). Then iteratively a new solution is created as follows. Each decision variable is generated either on memory consideration and a possible additional modification, or on random selection. The parameters that are used in the generation process of a new solution are called Harmony Memory Considering Rate (HMCR) and Pitch Adjusting Rate (PAR). Each decision variable is set to the value of the corresponding variable of one of the solutions in the HM with a probability of HMCR, and an additional modification of this value is performed with a probability of PAR. Otherwise (with a probability of 1-HMCR), the decision variable is set to a random value. After a new solution has been created, it is evaluated and compared to the worst solution in the HM. If its objective value is better than that of the worst solution, it replaces the worst solution in the HM. This process is repeated, until a termination criterion is fulfilled. More detailed descriptions of this algorithm can be found in Geem et al. (2005c), Mahdavi et al. (2007), and Geem (2005a). Algorithm 1 gives an overview about the HS algorithm using pseudo code.
Algorithm 1. Harmony Search Algorithm