Look up the knapsack problem. This is one of the classical solutions to this NP Complete problem.
Update: Also see the Bin Packing Problem, which is probably more appropriate for your problem.
Update-II(can you tell I enjoy algorithms? :-): Usually sorting the data in decending order of size, and putting the largest item from your list that is smaller than the space left in your "bin" into the bin (repeat as necessary) gives "good enough" results.
--MidLifeXis
In reply to Re: Help with Space Efficency algorithim
by MidLifeXis
in thread Help with Space Efficency algorithim
by jkhunt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |