in reply to Re^2: Challenge: Twist On Bin Packing in thread Challenge: Twist On Bin Packing
Smallest to largest won't always give the maximum number of bins. Take 1,1,1,2,2,3,4,6,7,7 for example.
Filling them smalles to largest you get 4 bins:
1,1,1,2,2,3
4,6
7
7
But you can get 5 bins by filling it:
6,1,1,1
2,2,3
7
7
4
Re^4: Challenge: Twist On Bin Packing
by japhy (Canon) on Apr 07, 2006 at 20:06 UTC
|
Well, crap. You should un-anonymize yourself so I know who to hatethank.
| [reply] |
Re^4: Challenge: Twist On Bin Packing
by moklevat (Priest) on Apr 07, 2006 at 21:31 UTC
|
Ack! Neat! Can you describe the algorithm? | [reply] |
|
No, I'm still trying to work one out :)
I figured if the smallest to largest wasn't going to work, it would likely be due to combinations of numbers where the smaller numbers add up to 10, but using larger numbers add up to 9.
A little trial and error found it.
I'm kinda thinking about something along the lines of "Use all the 1s to add up to 10, use all the 2s to add up 9, use all the 3s to add up 8, etc.", but I haven't been able to determine whether that is always going to work or not.
| [reply] |
|