Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The mixed knapsack problem. In class, we talked about the knapsack problems. There were two pure versions of the knapsack problem, the fractional knapsack problem

image text in transcribed
The mixed knapsack problem. In class, we talked about the knapsack problems. There were two "pure" versions of the knapsack problem, the fractional knapsack problem (dealing with items that are infinitely divisible) and the 0-1 knapsack problem (dealing with items where you must take either all or none of an item). 2 Consider a hybrid knapsack problem, in which some of the items are indivisible (as in the 0-1 knapsack problem) and others are "infinitely" finely divisible (as in the fractional knapsack problem). Our objective here is to maximize the value of the goods in the knapsack subject to the maximum weight W (in grams, for instance) that the knapsack can hold. Assume that there is enough of each item that you could fill up the knapsack with it and it alone. There are two types of items: "Infinitely divisible items": f1,f2,fm. Each of these has a value per unit weight of u2,u2,,um. For each of these you can put as much or as little of the item as you wish into the knapsack. These correspond to the inputs of the fractional knapsack problem All-or-nothing items: Items g1g2,g0. These have values per unit weight of v2,v2,,v0. The weight of one individual item is w1w2,w0, and you must put an integer number of items into the knapsack. These correspond to the inputs of the 01 knapsack problem. The question is on the next page. (But you don't necessarily need a lot of space to give the answer. Part A: Propose an algorithm for solving the mixed knapsack problem with unlimited repetition (or at least the amount of every item). Please describe your algorithm generally and carefully

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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

1st Edition

1597496251, 978-1597496254

More Books

Students also viewed these Databases questions