Half-approximation algorithm for knapsack

ID: half-approximation-algorithm-for-knapsack

After removing overweight items and handling free items, compare the feasible density-sorted prefix with the best feasible singleton. The fractional knapsack problem optimum is at most the sum of their profits, so the better solution has approximation ratio .

New to topics? Read the docs here!