Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 25,437 times

Contents

Downloads

Related Categories

Bin Packing - Decreasing Algorithms

Nimpo

Decreasing Algorithms

   There is a method, for all algorithms, to make packing more efficient.  And that is to sort the Elements array in descending order before applying the algorithm in question.  This usually benefits the process because large, bulky Elements get placed at the bottom of the first Bins, allowing the smaller Elements which come at the end of the array to (usually) fit nicely on top of them and to fill or almost fill the Bin (usually).

That is why the following lines of code appear in each algorithm:
      'Sort in descending order if needed
If Me.Decreasing = True Then
Array.Sort(ElementsCopy)
Array.Reverse(ElementsCopy)
End If

Languages I know (from most comfortable with, to least comfortable with): VB.NET, C#, VB6, and C/C++

I'm 19 years old and pursuing a MS in Computer Science at the Colorado School of Mines. My dad introduced me to programming (with Visual Basic 6) when I was about 10. When I was 13 I was accepted and enrolled at Arapahoe Community College for a programming class and continued there during the summers while in high school.


Check me out!
Need a vacation?

Comments

  • Re: [5540] Bin Packing

    Posted by Yak on 22 Jun 2008

    Hi Nimpo


    thank you for this fine sourcecode, it helps me in understanding the problem of bin packing a bit, a porblem i just want to solve in my access datab...

  • Re: [5540] Bin Packing

    Posted by mishoco on 17 Apr 2008

    Hello,


     I really want to thank you for for this great article. However, I am currently working on my last year project, which is about 2 dimensional&nbs...

  • Re: [5540] Bin Packing

    Posted by Roque on 16 Mar 2008

     hallo, i'm from poland.

    can u please send me a C program code for the best, next and first fit algorithms?

     

    my email: roque@poczta.onet.pl 

    thank you:) ...

  • Re: [5540] Bin Packing

    Posted by MisSya on 16 Sep 2007

    Hi,


    i urgently need the codes too before 19/09/07. pls help me. could you send me the C++ and java version of the codes. Tankyou. send to nuranastacia@yahoo.com

  • Re: [5540] Bin Packing

    Posted by kirby on 12 Sep 2007

    can u plz send me a 'C++' or 'C' program code for first fit algorithms....



    i need it urgently.... i need to submit code as my project by saturday 09/15/07...


    example output...