Research Article

A Hybrid Harmony Search Algorithm with Distribution Estimation for Solving the 0-1 Knapsack Problem

Algorithm 3

Distribution estimation algorithm.
Initialize the harmony library
Calculate fitness
For i = 1 to HMS
The fitness value of the harmony is obtained by adding the unit price of the value of the harmony that meets the conditions
End
% Sort harmonies by fitness value
  [Fitness, index] = sort (Fitness_ Value);
%Select the dominant harmony
  for i = 1 to Advantages of
    According to the sorted fitness value, the harmony with relatively high fitness value is searched and selected
  end
%Update Probability Model
A mathematical model is used to update the probability, and new probability values are generated.
% Determine if the conditions are met
If the stop condition is not met, the updated probability is substituted into the loop until the condition is met