Question

the table is for 0-1 knapsack problem given for the following items, each labeled with weight...

the table is for 0-1 knapsack problem given for the following items, each labeled with weight and value. Assume the total weight limit W is 8 lbs.

Item

1

2

3

4

Value ($)

8

40

30

54

Weight (lb)

1

2

3

6

Solve the fractional knapsack problem using the input?

Homework Answers

Answer #1

Greedy algorithm gives the optimal solution for Fractional knapsack problem if you select the object in decreasing order of the ratio Value/Weight. That is we select those object first which has maximum value of the ratio Value/Weight.

The Value/Weight ration for Item 1,2,3 and 4 is

Item

Value($)

Weight(lb)

Value/Weight

1

8

1

8

2

40

2

20

3

30

3

10

4

54

6

9

As the Value/Weight ratio is maximum for Item 2, we will select item 2 first, then item 3 and so on.

Weight limit W = 8lbs

W = 8lbs
W = 8 - 1*2 = 6lbs (Item2)
W = 6 - 1*3 = 3lbs (Item3)
W = 3 - (1/2)*6 = 0lbs (Item4)
Profit = $0
Profit = 0 + 1*40 = $40
Profit = 40 + 1*30 = $70
Profit = 70 + (1/2)*54 = $97

The selected items will be (0, 1, 1, 1/2) and profit is $97.

If you're still having any doubt then please feel free to ask in the comment section.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
KNAPSACK Optimization Problem using Greedy Method Problem 1: Item Weight Value 1    14 20 2...
KNAPSACK Optimization Problem using Greedy Method Problem 1: Item Weight Value 1    14 20 2     6 16 3   10 8 4     5 10 5   4 12 Allowed weight = 24 Kg Problem 2: Item Weight Value 1 6 30 2 8 40 3 15 45 4 22 88 5 25 80 Allowed weight = 60 Kg Problem 3: Item Weight Value 1     6 30 2     8 40 3    15 45 4    22 88...
You are given a knapsack that can carry a maximum weight of 60. There are 4...
You are given a knapsack that can carry a maximum weight of 60. There are 4 items with weights {20, 30, 40, and 70} and values {70, 80, 90, and 200}. Apply the brute force algorithm to find the maximum value of the items you can carry using the knapsack?
A game costs $3 to play. We are given a box with: 4 balls labeled "0",...
A game costs $3 to play. We are given a box with: 4 balls labeled "0", 3 balls labeled "1", and 2 balls labeled "3" We select 2 balls at random at the same time and we win money equal tot he sum of their results. With W a random variable which represents the total amount, we earn on one play of the game. Find the density function of W
Given the following data, develop MRP tables and indicate the Planned order releases for all items....
Given the following data, develop MRP tables and indicate the Planned order releases for all items. A is an MPS item. A needs 2 C's and 3 F’s. F needs 3 C’s. (I eliminated scheduled receipts since the problem did not have scheduled receipts.) Period 6 7 8 GR-A 400 0 300 On hand inventory for all items is 200 and lead time for A is 1 period, and LT for all other items is 2 periods. Use lot-for-lot for...
Given the following data, develop MRP tables and indicate the Planned order releases for all items....
Given the following data, develop MRP tables and indicate the Planned order releases for all items. A is an MPS item. A needs 2 C's and 3 F’s. F needs 3 C’s. (I eliminated scheduled receipts since the problem did not have scheduled receipts.) Period 6 7 8 GR-A 400 0 300 On hand inventory for all items is 200 and lead time for A is 1 period, and LT for all other items is 2 periods. Use lot-for-lot for...
C. Refer to table given below. 1. Fill-in the missing items in the table. 2. Identify...
C. Refer to table given below. 1. Fill-in the missing items in the table. 2. Identify the break-even level of income. Income consumption Saving APC $ 240 ________ $ -4 $ ______ 260 ________ 0 ______ 280 ________ 4 ______ 300 ________ 8 ______ 320 ________ 12 ______ 340 ________ 16 ______ 3. Compute the multiplier (M0 if: a). MPC =0.25, b). MPC=0.75 and c). MPC=0.9 2. Based on the results form question # 1.above, explain how multiplier (M) is...
solve the given initial value problem y''-5y'+6y=0, y(0)=3/5, y'(0)=1
solve the given initial value problem y''-5y'+6y=0, y(0)=3/5, y'(0)=1
Solve the following initial value problem ?′′ + 3??′ + 2? = 0, ?(0) = 1...
Solve the following initial value problem ?′′ + 3??′ + 2? = 0, ?(0) = 1 and ?′(0) = 1 by using a power series ?0 + ?1? + ?2?2 + ?3?3 + ?4?4.
Solve the given initial-value problem. X' = 10   −1 5 8 X,    X(0) = −2 4 X(t)...
Solve the given initial-value problem. X' = 10   −1 5 8 X,    X(0) = −2 4 X(t) =
solve the given initial-value problem y"-100y=15, y(0)=1, y'(0)=0
solve the given initial-value problem y"-100y=15, y(0)=1, y'(0)=0