Research Article

Fast Polynomial Time Approximate Solution for 0-1 Knapsack Problem

Algorithm 2

Approximate Algorithm for (KP).
Step 1 Input the capacity c, size n, weights and profits of items.
Step 2 Obtain the critical item by (10).
Step 3 Let .
Step 4 Obtain the upper bound and its solution by (8).
Step 5 If , then . Otherwise, .
Step 6 If , then exit.
Step 7 Obtain the initial solution by (18).
Step 8 Obtain the best solution in the neighborhood and its objective value by Algorithm 1.
Step 9 If , then .
Step 10 If , then , get and its solution by (8); else, , get and its solution by (8). Go to Step 5.