title: C# algorithm for figuring out different possible combinations
body: <p>I have 10 boxes, each box can hold one item from a group/type of items, each 'group' type only fits in one of the 10 box types. The item pool can have n number of items. The groups have completely distinct items. Each item has a price, i want an algorithm that will generate all the different possibilities, so i can figure out different price points vs custom rank/weight assignment to each of the items, based on item attributes.</p>
  <p>so a smaller picture of the problem</p>
  <blockquote>
  <p>BOX A - can have item 1,2,3,4 in it</p>
  <p>BOX B - can have item 6,7,8,9,10,11,12</p>
  <p>BOX C - can have item 13,15,16,20,21</p>
  </blockquote>
  <p><strong>More Detail</strong><br/>
  The solution would be a set of BOX A, BOX B, AND BOX C, having the greatest rank based on the set of boxes. Each box can only contain ONE of the designated items for that box.
  An item is an object, the object has 3 attributes(firmness, elasticity, strength). Each attribute can have 1-100 for a score. The goal is to enter a weight for each attribute, then the logic will run through ALL items and determine the top ranked item combinations based on the weights for each attribute. I have used 3 attributes for each item for ease of explanation, but items can have about 10 different attributes.</p>
  <p>The items are stored in a db, they have a column which denotes which box they can go in. All box types are stored in an array, and I can put the items in a generic list. Anyone see a straightforward way to do this.</p>
  <p>I have tried doing 10 nested foreach's to see if i could find a simpler way. The nested loops will take MANY hours to run. the nested for each's basically pull all combinations, then calculate a rank for each combination, and store the top 10 ranked combination of items for output</p>