If there is no ordering requirement, the OP soultion is not stable: I can move the 5 and the 2 to the fourth bin, the 3 to the first bin and the 4 to the third bin to eliminate a bin. So, the OP must be thinking about the ordered case.
Simialrly, suppose 2-stable allows both sinlge moves and transpositions. Then the 2 and 3 of the first and third bins can be excahnged and then 2 in the fourth bin can be moved into the third bin, reducing the number of bins. So the OP must be only thinking about single moves.
To solve the ordered 1-stable problem, I suggest, sorting the gifts from smallest to largest and then fill up bins using sequential elements from the sorted list. For the OP example, (2, 2, 3, 4, 5, 6, 7) this would give
which gives the same maximum number of bins, but spreads the gifts about more evenly. Intuitively, by using up all the smallest elements that could be used to fill up the interstices first, the remaining bins will be taken up by larger elements with lots of empty space.1: 2,2,3 2: 4,5 3: 6 4: 7
-Mark
In reply to Re: Challenge: Twist On Bin Packing
by kvale
in thread Challenge: Twist On Bin Packing
by Limbic~Region
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |