Research Article

Enhancing Hyperheuristics for the Knapsack Problem through Fuzzy Logic

Algorithm 1

Solving a set of instances.
Input: a set of instances
Output: a set of knapsacks, one per instance
(1)for each instance in the set do
(2) Create a new empty knapsack
(3)while knapsack not full OR there are items in the instance do
(4)  Compute the features from the instance.
(5)  Give the features as input to the FIS
(6)  The FIS processes the features and gives an output
(7)  Use the output to select a heuristic.
(8)  Apply the heuristic to select and remove an item from the instance to be packed into the knapsack
(9)end while
(10) Save the knapsack of the solved instance
(11)end for