Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Challenge: Twist On Bin Packing

by japhy (Canon)
on Apr 07, 2006 at 16:57 UTC ( [id://541920]=note: print w/replies, xml ) Need Help??


in reply to Re: Challenge: Twist On Bin Packing
in thread Challenge: Twist On Bin Packing

I agree; the least-to-greatest gives the highest magnitude (number of bins).

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Replies are listed 'Best First'.
Re^3: Challenge: Twist On Bin Packing
by Anonymous Monk on Apr 07, 2006 at 19:53 UTC
    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
      Well, crap. You should un-anonymize yourself so I know who to hatethank.

      Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
      How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart
      Ack! Neat! Can you describe the algorithm?
        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.
Re^3: Challenge: Twist On Bin Packing
by QM (Parson) on Apr 07, 2006 at 19:05 UTC
    It seems that L~R has some work cut out to compare the Least-to-Greatest method with any other contenders, on a large enough set of random samples, and tell us if there are any interesting anomalies. [Well, it is his problem, and I have to get some work done before home-time ;]

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of

Re^3: Challenge: Twist On Bin Packing
by moklevat (Priest) on Apr 07, 2006 at 19:30 UTC
    This is cool. The least-to-greatest approach will indeed give a larger number of bins than the approach I posted above under some circumstances, so this may be the winner. However, it will also lead to larger variability in the contents of the bins and could lead to more bins being, for example, 51% full. Ultimately the relative importance of "filling the bins as close to capacity as possible" and "maximizing the number of bins" remains somewhat unclear.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://541920]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-20 04:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found