Research Article
An Improved Hybrid Encoding Cuckoo Search Algorithm for 0-1 Knapsack Problems
Algorithm 1
Greedy transform method.
| Input: | | Step1: sort | | The items are sorted according to the value-to-weight ratio in | | descending order, then a queue of length n is formed. It means that: | | , for | | Step2: repair stage | | ; Tempc = ; | | While (Tempc ≤ C) | | if then | | ; Tempc = Tempc + ; | | end if | | end while | | Step 3: optimize stage | | For to | | Tempc = Tempc + ; | | if (Tempc ≤ C) then | | ; | | Else | | ; | | end if | | end for | | Output: , computation is terminated. |
|