Jump to content

Continuous knapsack problem

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Faridani (talk | contribs) at 04:27, 5 October 2009. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Continuous knapsack problem also known as fractional knapsack problem is similar to the classic Knapsack problem but in this problem fractions of an item can be put into the knapsack.

The problem is as following: Given a knapsack with capacity R and materials of different values per unit volume, find the most valuable combination of materials which fit in a knapsack of fixed volume R.

We are allowed to take fractions of materials. A greedy algorithm can find the optimum solution to the Continuous knapsack problem.

Solution Technique

Start with the material that is most valuable per unit volume and take as much as possible until you run out. If there is still space available take the second most valuable per unit volume item and take as much as possible. Continue this procedure until you run out of room in the knapsack.