Another version of the knapsack problem is to let the set U contain a set of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Another version of the knapsack problem is to let the set U contain a set of types of items, and the objective is to fill the knapsack with any number of items of each type in order to maximize the total value without exceeding the knapsack capacity. Assume that there is an unlimited number of items of each type. More formally, let T = {t₁, t2,..., tn} be a set of n types of items, and C the knapsack capacity. For 1 ≤j ≤n, let s; and v; be, respectively, the size and value of the items of type j. Find a set of nonnegative integers X₁, X2,...,xn such that is maximized, subject to the constraint n XiVi XiSi <C i=1 where x₁, x2,..., Xn are nonnegative integers. Note that x; = 0 means that no item of the jth type is packed in the knapsack. 1) (13 points) Rewrite the dynamic programming formula for this version of the knapsack problem. 2) (12 points) Solve the following instance of this version of the knapsack problem. There are four types of items with sizes 2, 3, 5, and 6 and values 4, 7, 9, and 11, respectively, and the knapsack capacity is 10. Activate Windo Go to Settings to ac Hint: Try to solve part b in order to help you in solving part a. Another version of the knapsack problem is to let the set U contain a set of types of items, and the objective is to fill the knapsack with any number of items of each type in order to maximize the total value without exceeding the knapsack capacity. Assume that there is an unlimited number of items of each type. More formally, let T = {t₁, t2,..., tn} be a set of n types of items, and C the knapsack capacity. For 1 ≤j ≤n, let s; and v; be, respectively, the size and value of the items of type j. Find a set of nonnegative integers X₁, X2,...,xn such that is maximized, subject to the constraint n XiVi XiSi <C i=1 where x₁, x2,..., Xn are nonnegative integers. Note that x; = 0 means that no item of the jth type is packed in the knapsack. 1) (13 points) Rewrite the dynamic programming formula for this version of the knapsack problem. 2) (12 points) Solve the following instance of this version of the knapsack problem. There are four types of items with sizes 2, 3, 5, and 6 and values 4, 7, 9, and 11, respectively, and the knapsack capacity is 10. Activate Windo Go to Settings to ac Hint: Try to solve part b in order to help you in solving part a.
Expert Answer:
Answer rating: 100% (QA)
Youve provided a problem statement describing an unbounded knapsack problem an... View the full answer
Related Book For
Data Structures and Algorithm Analysis in Java
ISBN: 978-0132576277
3rd edition
Authors: Mark A. Weiss
Posted Date:
Students also viewed these programming questions
-
a. Example 13-1: Batch Reactor with an Exothermic Reaction Wolfram 1. Adiabatic Case: Use Wolfram to see whether you can find a trajectory that is ready to ignite and whose trajectory looks like a...
-
Use the test of your choice to determine whether the following series converge. 1 + 1.3 1 3.5 + 1 5.7
-
Go to the Web site of the Federal Reserve Bank of St. Louis (FRED) (research.stlouisfed.org/fred2/). a. Find the most recent values for these four variables: (1) Unemployment Level - Men...
-
On December 31, 2014, Alpha Corporation, valued at $10 million, acquired BetaCo when BetaCo was valued at $5 million. BetaCo holds a capital loss carryforward of $220,000 and excess business credits...
-
Consider the mean square error criterion for generalized ridge regression. Show that the mean square error is minimized by choosing \(k_{j}=\sigma^{2} / \alpha_{j}^{2}, j=1\), \(2, \ldots, p\).
-
Sorrento Industries manufactures plastic bottles for the food industry. On average,Sorrento pays $ 71 per ton for its plastics. Sorrentos waste disposal company has increased its waste disposal...
-
More generally, evaluate the new Federal Government policies: 1 What are the pros and the cons of the FDIC guarantee of debt? 2. Pros and cons of executive compensation restrictions? 3. Pros and cons...
-
One-dimensional steady-state conduction, with no internal heat generation, occurs across a plane wall having a constant thermal conductivity of 30 W/m K. The material is 30 cm thick. For each case...
-
Direct electric current of 25 mA is maintained in a circular loop of radius 10 cm and consisting of 100 turns. An external magnetic field, 0.5 T, is directed at an angle of 60 with the plane of the...
-
1) Find out the reaction forces at supports and show their directions. Q2) A bar has subjected to 60 kN load as shown in the figure below. Bar has different cross-sections along its longitudinal...
-
The steel SS1370 with composition must first be carburized and then hardened. It is desired to obtain a hardness HV of 550 at a depth of 2.5 mm below the surface. The carburization takes place in...
-
By using the method of sections, determine the force in members BC, BF, CF and EF of the truss and state if these members are in tension or compression. Set P= 12 kN, P = 15 kN and P3=9 kN. (Note:...
-
Graphically position the links in the automotive front suspension mechanism shown. Then reposition the links as the upper control arm is rotated IO ' counterclockwise. Determine the resulting...
-
What is an acid? How can we differentiate between a strong acid and a weak acid? Describe the key criteria and property requirements to consider when specifying Tubular Goods Why is the pH level of...
-
Provided below is the statement of income for ABC Inc. for the period October 1, 2018 to September 30, 2019 as well as additional information relating to the preparation of this statement. ABC Inc....
-
Find a polar equation for the curve represented by the given Cartesian equation. 4y 2 = x
-
Suppose that line 15 in the binary search routine had the statement low = mid instead of low = mid + 1. Would the routine still work?
-
Suppose that in an attempt to save time, we splay on every second tree operation. Does the amortized cost remain logarithmic?
-
a. Show how to implement the merge operation on splay trees so that any sequence of N1 merges starting from N single-element trees takes O(N log2 N) time. b. Improve the bound to O(N logN).
-
Which of the following does not occur in the small intestine? (a) Bile from the gall bladder breaks fats into small droplets. (b) Nutrients are absorbed into the body. (c) Proteins are broken down....
-
Which blood vessels are responsible for nutrient and waste exchange with tissues?
-
Trace the path of blood through the body, beginning with blood returning from the tissues to the heart. Be sure to name each of the chambers of the heart.
Study smarter with the SolutionInn App