(1) Set the harmony memory size , the number of maximum improvisations
   , and other control parameters
(2) Initialize the harmony memory , and perform Algorithm 4 to repair
   the harmony vector of , then evaluate their objective function values
(3) Set // represents the iterative variable
(4) while do
(5) Record the position of the best harmony in the HM, and its index
  is represented by , likewise, denotes the index of the worst
  harmony in the current HM
(6) Calculate the parameter HMCR(FEs) according to (5a)
(7) Perform Algorithm 3 to produce a new harmony vector
(8) Perform Algorithm 4 to repair the new harmony vector
  // Perform a new greedy selection scheme
(9) if is better than or equal to then
(10)   Replace with
(11) else if is better than or equal to then
(12)   Substitute with
(13) end if
(14) Memorize the best harmony achieved so far
(15) Set
(16) end while
Algorithm 5: The DGHS algorithm.