{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# a4 - the total weight limit(i)If all v i are equal what...

This preview shows page 1. Sign up to view the full content.

Assignment#4: DueSeptember25 1. Exercise 16.2-4 (page 384). 2. Exercise 16.2.5 (page 384). 3. 16.2-7 (page 384) 4. Thefollowingproblemisknownintheliteratureasthe knapsackprob- lem: We are given n objects each of which has a weight and a value. Suppose that the weight of object i is w i and its value is v i . We have a knapsackthatcanaccommodateatotalweightof W . Wewanttoselecta subsetoftheitemsthatyieldsthemaximumtotalvaluewithoutexceeding
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: the total weight limit. (i)If all v i are equal, what would the greedy algorithm yield? Is this optimal? (ii)If all w i are equal, what would the greedy algorithm yield? Is this optimal? (iii) How should the greedy algorithm be designed in the general case? Is this optimal? [we are allowed to select fractional items.] 1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online