The following is known as the KNAPSACK problem. You have a knapsack and a collection of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The following is known as the KNAPSACK problem. You have a knapsack and a collection of valuable objects. Each object O has a weight O.W and a value O.V. There is a m on the total weight that you can carry. You have a target value T. The question is, can you choose objects to pack so that their total value is at least T and their total weigh M. For instance, suppose that T = 20, M = 10 and you have the following objects Object ABCDE Value 108764 Weight 8 4331 The only solution here is {B,C,D } with a total value of 21 and a total weight of 10. Note that the solution includes neither the most valuable item (A) nor the item with the value per weight (E). Consider the following state space solution. Assume that the objects have names that can be listed alphabetically. A state is an alphabetical list of the objects with a total weight at most M. For instance [C] is one state; [B,E] is another state. Given a state L, an operator on L is to add an object O at the end of L. To preserve the alphabetical order, O must be alphabetically later than the last element in L. T weight must be less than M. For instance, the operators on the state [C] are to add D, forming [C,D] or to add E forming [C,E]. The start state is the empty list. A state satisfies the goal if the total value is at least T. A. Show the complete state space for the above example. B. Suppose that you use a depth-first search to explore the state space. Which of the states in (A) will you generate, and in what order? C. Suppose that you use a breadth-first search to explore the state space. Which of the states in (A) will you generate, and in what order? The following is known as the KNAPSACK problem. You have a knapsack and a collection of valuable objects. Each object O has a weight O.W and a value O.V. There is a m on the total weight that you can carry. You have a target value T. The question is, can you choose objects to pack so that their total value is at least T and their total weigh M. For instance, suppose that T = 20, M = 10 and you have the following objects Object ABCDE Value 108764 Weight 8 4331 The only solution here is {B,C,D } with a total value of 21 and a total weight of 10. Note that the solution includes neither the most valuable item (A) nor the item with the value per weight (E). Consider the following state space solution. Assume that the objects have names that can be listed alphabetically. A state is an alphabetical list of the objects with a total weight at most M. For instance [C] is one state; [B,E] is another state. Given a state L, an operator on L is to add an object O at the end of L. To preserve the alphabetical order, O must be alphabetically later than the last element in L. T weight must be less than M. For instance, the operators on the state [C] are to add D, forming [C,D] or to add E forming [C,E]. The start state is the empty list. A state satisfies the goal if the total value is at least T. A. Show the complete state space for the above example. B. Suppose that you use a depth-first search to explore the state space. Which of the states in (A) will you generate, and in what order? C. Suppose that you use a breadth-first search to explore the state space. Which of the states in (A) will you generate, and in what order?
Expert Answer:
Related Book For
Chemistry The Central Science
ISBN: 978-0321696724
12th edition
Authors: Theodore Brown, Eugene LeMay, Bruce Bursten, Catherine Murphy, Patrick Woodward
Posted Date:
Students also viewed these programming questions
-
Give Correct ANSWERS Human-Computer Interaction (a) If you had been one of the original inventors of the WIMP interface, and engineers on the technical team had been sceptical about the advantages...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
There are 38 numbers in the game of roulette. They are 00, 0, 1, 2, . . ., 36. Each number has an equal chance of being selected. In the game, the winning number is found by a spin of the wheel. Say...
-
Define entitling and enhancement.
-
A 4.20-g lead bullet at 34.0C is fired at a speed of 230 m/s into a large block of ice at 0C, in which it becomes embedded. What quantity of ice melts? 0.2725 What are the sources of energy that can...
-
The following expenses budget has been prepared for Zuri Health Ltd for the year ending 30 June 2025. Required Prepare a schedule of estimated cash payments for expenses for Zuri Health Ltd for the...
-
A firm wants to select one new research and development project. The following table summarizes six possibilities. Considering expected return and risk, which projects are good candidates? The firm...
-
After the tangible assets have been adjusted to current market prices, the capital accounts of Elayne Summers and Murv Newcomb have balances of $86,000 and $146,000, respectively. Rose Clayton is to...
-
39. "Proof: Suppose r and s are rational numbers. If r +s is rational 39. "Proof: Supposer and s are rational numbers. If r + s is rational, then by definition of rational r + s = a/b for some...
-
Health care in the United States might be more effective and efficient if the system was based on the concept of the natural history of disease and the levels of prevention. Instead, there is more...
-
i- Draw sketches showing the relations between the fracture toughness Kic and each of the following:- Thickness, Tensile Strength Temperature Grain size ii- A long closed cylinder is made of a steel...
-
How does the unfamiliar trade (forex) market influence worldwide monetary administration for a situation study, and what are the key factors that impact trade rates and money risk in worldwide...
-
Solve the following linear program using the graphical method (graph sheet on next page). Identify the decision variables. Compute the value of the decision variables and the objective function at...
-
How in all actuality does exchange highlight in worldwide monetary administration contextual analyses, and which job does it play in exploiting cost differences in worldwide business sectors?
-
Accountants have the ability to choose different ways to report accounting information and this choice can have an impact on the reported financial performance and position of an entity. 1. Identify...
-
Name some of the various types of financial intermediaries described in the chapter and indicate the primary reason(s) each was created.
-
Which of Lees junior analysts three statements is correct? A. Statement 1 B. Statement 2 C. Statement 3 Elaine Lee is an analyst at an investment bank covering the energy sector. She and her junior...
-
Titian faces long-term risk from ____ due to potential regulatory changes in the developing economies. Theresa Blass manages the Toptier Balanced Fund (the Fund) and recently hired John Yorkton, a...
-
Which of the statements made by Yorkton on ESG factors in investment analysis is correct? A. Statement 1 B. Statement 2 C. Statement 3 Theresa Blass manages the Toptier Balanced Fund (the Fund) and...
Study smarter with the SolutionInn App