Professional Documents
Culture Documents
Fractional KnapSack Problem
Fractional KnapSack Problem
Problem:
Given a Knapsack(a Small Bag that can be carried on a shoulder) with
the limited Weight Capacity ’W’ .
There are ‘n’ items available having weights ‘w’ and with each item
certain ‘Profit or Value’ is associated.
Objective: To fill the Knapsack with those items such that we have
maximum Profit and the selected items weight ‘w’ should not exceed
the Knapsack Capacity Weight ‘W’.
5 kg Limit of Bag
Objective: Maximum Profit and the weight of the items should not
exceed the bag capacity.
Option I :If he goes for the Necklace: weight of necklace is 5 equal to bag
capacity and the Profit he earns is Rs 10000/-
Option 2: But if he goes for Mobile Phone and Gold Platted Clock the
weight of the items is equal to the bag capacity and the Profit
he earns is Rs 1,75,000/-
So He goes for option 2 Maximum Profit with in the Bag Capacity.
Now here the Remaining capacity of the Knapsack after adding item B
and item A is 10.
Next Item to be added according to the sorted order in the Knapsack is ‘C’
having weight 20 with Profit 120.
The Item Weight is greater than the remaining Capacity of the Knapsack
so we cannot take the C as a complete item but we consider only the
fraction of ‘C’ .