Question: Consider the following greedy algorithm Alg 1 to solve the Knapsack prob lem: Order all the items ai in non - increasing order of their
Consider the following greedy algorithm Alg to solve the Knapsack prob lem:
Order all the items ai in nonincreasing order of their density, which is the ratio of value to size, vi Make a single pass through the list, from highest to lowest density.
si
For each item encountered, if it still fits, include it otherwise exclude it
Prove that algorithm Alg does not guarantee any constant approximation ratio. That
is for any positive integer k there is an input to the algorithm for which the total value
of the set of items returned by the algorithm is at most vOpt
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
