Do anyone knows how to solve this dp problem?

Revision en1, by flyingfist, 2025-01-30 12:42:19

This is a modified 0/1 knapsack problem. The first line contains n, the number of array elements. The next n lines contain the array elements. There are three things given for each element. 1) Type 2) Weight 3) Value and W which is the maximum limit of total weight. So, here we have to maximize the total value, by taking each type of element atmost one time. The constraints are 1<=W,Type,Weight,Value<= 5000. How to solve this problem? What would be the states?

Tags dynamic programming

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English flyingfist 2025-01-30 12:42:19 520 Initial revision (published)