in reply to Help with Space Efficency algorithim
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help with Space Efficency algorithim
by Limbic~Region (Chancellor) on Dec 27, 2007 at 19:38 UTC | |
by MidLifeXis (Monsignor) on Dec 27, 2007 at 20:26 UTC | |
by dragonchild (Archbishop) on Dec 27, 2007 at 21:06 UTC | |
by MidLifeXis (Monsignor) on Dec 27, 2007 at 23:17 UTC | |
by dragonchild (Archbishop) on Dec 28, 2007 at 04:32 UTC | |
by jkhunt (Initiate) on Dec 28, 2007 at 15:56 UTC | |
by Limbic~Region (Chancellor) on Dec 28, 2007 at 18:33 UTC |