Research Article

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

Algorithm 5

Repair operator.
(1)While  > C
(2)Randomly select a certain number of dimensions
(3)Sorts the selected dimensions out of order
(4)If B (dd(i)) == 1
(5)B (dd(i)) = 0;
(6) =  − W (dd(i));
(7)end
(8)Determines whether the selected dimension is exceeded
(9)end