Question: 1 . 1 Fractional Knapsack [ 8 points ] Consider the fractional knapsack problem discussed in class. Suppose that for a given fractional knapsack instance
Fractional Knapsack points
Consider the fractional knapsack problem discussed in class. Suppose that for a given fractional
knapsack instance Ww b
wn bn we have already obtained an optimal solution x
x
x
n using the greedy algorithm discussed in class.
i points If the capacity of the knapsack doubles from W to W how can we modify the
existing greedy solution xx
x
n to obtain a new optimal solution
x x
x
n
Explain your idea first and then give your algorithm in pseudo code.
ii points If the capacity of the knapsack shrinks from W to W how can we modify the
existing greedy solution xx
x
n to obtain a new optimal solution
x x
x
n
Explain your idea first and then give your algorithm in pseudo code.
For both questions above, assuming that you cannot rerun the greedy algorithm with an updated
capacity otherwise both questions would be trivial
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
