in reply to maximizing value from a set of objects

This is an instance of the knapsack problem or bin packing problem. To get the optimum result, you basically:

If your dataset is more than a handful of items (depending on the size of your hand - the concern is the total time to process all of the combinations that will be generated), you may need to optimize this a bit and shoot for "good enough". One approach would be to sort the population by value and build your combinations starting with the highest value items.

This problem is in the same class of problems as the travelling salesman problem, which is NP Complete (you can read that as 'very hard with large populations').

--MidLifeXis

  • Comment on Re: maximizing value from a set of objects