Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started