Is it the goal to have as many bins as possible while having as many of THOSE as close to capacity? My algorithm ends up reporting (7,3), (4,2,2), (6), (5). I'm not sure I'm solving the right problem.
Jeff japhy Pinyan,
P.L., P.M., P.O.D, X.S.:
Perl,
regex,
and perlhacker How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart
japhy,
This solution is valid AFAICT since it produces 4 bins and if you were filling them left to right none of the remaining items could fit in the current bin. In the event of ties (different arrangements producing the same number of bins) either solution is acceptable.