Python icon indicating copy to clipboard operation
Python copied to clipboard

Unbounded Knapsack problem

Open paraggoyal28 opened this issue 4 years ago • 2 comments

Feature description

Given a knapsack weight W and a set of n items with certain value vali and weight wti, we need to calculate the maximum amount that could make up this quantity exactly. This is different from classical Knapsack problem, here we are allowed to use unlimited number of instances of an item.

Examples: Input : W = 100 val[] = {1, 30} wt[] = {1, 50} Output : 100 There are many ways to fill knapsack.

  1. 2 instances of 50 unit weight item.
  2. 100 instances of 1 unit weight item.
  3. 1 instance of 50 unit weight item and 50 instances of 1 unit weight items. We get maximum value with option 2.

Input : W = 8 val[] = {10, 40, 50, 70} wt[] = {1, 3, 4, 5}
Output : 110 We get maximum value with one unit of weight 5 and one unit of weight 3.

Would you like to work on this feature?

  • [X] Yes, I want to work on this feature!

paraggoyal28 avatar Oct 02 '22 15:10 paraggoyal28

I want to work on this issue. Please assign this to me!

paraggoyal28 avatar Oct 02 '22 15:10 paraggoyal28

can you assign this issue to me

deepakchowdary19 avatar Oct 11 '22 16:10 deepakchowdary19