flyingfist's blog

By flyingfist, history, 16 hours ago, In English

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?

Full text and comments »

  • Vote: I like it
  • +7
  • Vote: I do not like it