Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. (10 pts.) Greedy choice Recall that in the 0-1 knapsack problem, you are given a backpack with capacity W. There are n items and

image text in transcribed
4. (10 pts.) Greedy choice Recall that in the 0-1 knapsack problem, you are given a backpack with capacity W. There are n items and the i-th item has weight w; and value vi. The goal is to pick some items with total weight at most W that maximize the total value. More formally, you need to find an assignment (*...) with x; (0.1) (ie.. .; is either 0 or 1), where x; = 1 means the i-th item is picked and x; = 0 otherwise. The goal is to maximize E%* subject to the constraint E. SW. As we have discussed in the class, this 0-1 knapsack problem does not have the greedy choice property. Now consider the fractional knapsack problem, where you can take a fraction of an item. More formally, you need to find an assignment (1...) with x 10,11(. can be any real number inclusively between 0 and 1). The goal is to maximize subject to the constraint EXW, SW. The greedy heuristic for each step is to find the item with the largest value per pound and take as much of it as possible. Suppose the j-th item has the largest value-per-pound. Prove that there exists an optimal solution that contains as much of the j-th item as possible. (This shows the greedy choice property.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions