Monday, July 16, 2012

packit4me.com (2D/3D Bin Packing)

(UPDATE 06/04/2013) This project is now available @ http://www.packit4me.com/
3D/2D bin packing. Given multiple bins and items to be packed into the bins, the algorithm attempts to find a good solutions of how to pack. I got so many requests for this that I made it into a real life project. Check out the site. It has comprehensive documentation on how to call the API with all the popular languages (Java, php, C#, ruby, python). I hope it works for you! If not just email me or make some posts here. I'll try to setup some ticket system soon to take requests.

13 comments:

  1. Would you consider a version for 3D Bin Packing as follows:

    - Given a set of bin sizes, assume unlimited number of bins. Sort bins by volume DESCENDING

    1) Start with smallest bin that has total volume larger than total volume of items
    2) Sort items by volume ASCENDING
    3) place items to first bin until next item won't fit (applying rotation per constraints)
    4) Repeat from step 1 using total volume of remaining items to determine which bin size to continue with.

    The idea is that by sorting the items by volume Ascending, you don't have to check back to prior bins to see if subsequent items will fit, so it should be faster. When an item won't fit in any orientation in the current bin, you know none of the others will fit either without having to burn CPU trying them.

    Given a lot of items and unlimited bins, the result should be to fill and close each bin until you run out of items. When you get to an item whose volume is larger than that of the largest available bin, exit as done, as this item and all the remaining items must be oversized.

    ReplyDelete
  2. Clarifying Step 1 above:
    If total volume of items exceeds largest bin, start with largest bin.

    Clarifying step 4:
    For subsequent bins for remaining items, start comparing total remaining item volume with the last bin volume you just filled, as the remaining items will not need a larger bin, but may require a same size bin to finish, or a smaller bin may suffice (case of many small items, large bin full, very small bin for last couple items), so you don't have to re-evaluate the larger bins.

    Additionaly constraint: weight limit per bin and weights for items. If the next item would exceed the weight limit for the bin, assume all the remaining items would as well, since we know they're all the same or larger volume based onthe ascending sort. I realize this isn't optimal for small dense items mixed with larger light items (cushions and paper weights, for example), but I think you should ignore that because this issue can be solved upstream by the calling application as suits their needs, such as calling your component a 2nd time with a different set of bins and only those small dense items.

    ReplyDelete
    Replies
    1. very good points. I've been trying to open some time for this project. Please add your requests to the issues in github. The weight limit per bin is definitely going to get done

      Delete
    2. Project now handles weight limits. Not hosted on github anymore as it is now a service.

      Delete
  3. This looks exactly what I needed, thank you very much Arash!

    ReplyDelete
    Replies
    1. BTW your API examples all use www.packit4.me but it should be www.packit4me.com

      Delete
    2. Thx so much for your reply. I will update! All comments/criticism are welcome!

      Delete
  4. Hello Arash. I am very interested in this, but it seems the website www.packit4me.com is not working. Is this temporary or is their another site for this now?

    ReplyDelete
    Replies
    1. Hi Chad, It should be back up now. Try again. Thanks!

      Delete
  5. Hi Arsah and all,
    Actually, i really need your help on how representing-3d-bin-packing +Vehicle using java. For example, i have some box (3d) and would like to packing it into a vehicle. So please could you help with this matter ?
    I really appreciate your help in advance.
    Thanks again
    Alex

    ReplyDelete
  6. Is packit4me.com down or has it moved? Find this feature super useful for my reselling business. Would be interested in hosting the code if it's been abandoned or paying for the service.

    ReplyDelete
  7. @ArashSharif Please, can an option be added to this service so it will pack all items in one bin (if a large enough bin is available) rather than across multiple smaller bins (even if this is more efficient.
    If used in a shipping service, one larger box is cheaper to ship than multiple smaller boxes.

    ReplyDelete
  8. Is packit4me.com down or has it moved? Would be interested in hosting the code if it's been abandoned or paying for the service.

    ReplyDelete