I did not take an algorithims course so I need your help

Is there an algorithim to solve this problem? .

if I have a set of items and each item has a subset of items with a value.

I want to find the best solution , have an item from each subset where the sum of the items <= a given number

Example:

I have 3 items:

item1 has > p 1 : value =3

p 2 : value = 4

item2 has > p1:value = 5

p2 : value =4

item3 has > p1:value = 3

p2 : value =6

and I have a given number 12

Best Solution : item1 : p2 - item 2 : p1 -item3: p1

Sum=12 <=12

I want an algorithim name that solves this problem similar to Knapsack - Sum of subset .....etc

or any algorithim that helps me solve this solution

I just need the name of algorithim not the code!

Thanks

This post has been edited by **Some1Wow**: 11 September 2009 - 01:04 AM