14 Replies Latest reply on Aug 12, 2009 7:46 PM by etripoli

# Help in calculating box size needed for multiple items

### Title

Help in calculating box size needed for multiple items

### Post

I'm hoping this isn't a unique situation.  I have the need for setting up a database to calculate the number of shipping containers ( boxes ) needed for a given set of items.  The items are identified with weight and dimensions, and the shipping containers come in pre-determined sizes.  Multiple items with different dimensions and weights can, and should be grouped together in one box.  Are there any scripts, formulas, calculations, databases out there that can solve this?

• ###### 1. Re: Help in calculating box size needed for multiple items
Hi.  I don't if there is a " good " Container stuffer out there.  I am new to FM, and one of my first projects is to write one. I have Container stowing experience.  Perhaps we could chat.  John
• ###### 2. Re: Help in calculating box size needed for multiple items

Quite an ambitious first project!  But I still think that someone has written a program, or at least has worked on a formula, to figure this problem out.

My first thoughts are, given a limited number of Container/box sizes:

Start with summing the volume of the all the individual items that need to ship together, and eliminate all the boxes that have less volume

- If all the items won't fit in the largest box, the next step is the start

Find the maximum dimension of the largest item, and eliminate any boxes that have dimensions that are smaller

This is where it gets tricky, because you need to work in three dimensions at once, with multiple objects, and each object takes away space from the box, and splits the remaining space up into smaller spaces.

It would seem to need a branching algorithm...

http://en.wikipedia.org/wiki/Branch_and_bound

• ###### 3. Re: Help in calculating box size needed for multiple items

The only similar thing that came to my mind was a thread on cut sheets that Mike Hackett ended up writing some custom functions for. However, they are for cut sheets and not area, but perhaps it can get it started in the right direction.

http://www.fmforums.com/forum/showtopic.php?tid/170643/

• ###### 4. Re: Help in calculating box size needed for multiple items

Is Mike on this forum, or still over at FMForums?  He might want to get in on this!

I wonder if a recursive CF, that evaluates 1 item at a time, rotated in 3 dimensions, could be used.  The other thing that makes this problem a little different, is not just how many items we can fit in a box, but, given a fixed number of items, 1) can all the items fit in a single box & the smallest size possible, or 2) if the items can't fit into a single box, what size boxes are needed, using the smallest possible boxes.

• ###### 5. Re: Help in calculating box size needed for multiple items

Can the objects be treated as rectangular solids, some other regular solid or are they irregular in shape?

• ###### 6. Re: Help in calculating box size needed for multiple items
He started floating around here a few days ago. Actually I will be seeing him tommorow so I will pass the message on to him.
• ###### 7. Re: Help in calculating box size needed for multiple items

@Phil - yes, I think it's safe to say that the items are all rectangular solids.  Also, a co-worker brought up the same point mentioned in the linked thread - even if the calculation can find the 'perfect' configuration, a person might not be able to figure out the config, without a drawing/guide.  So this could actually help, such as requiring that the item be placed with it's longest edge horizontal, and perhaps requiring the rest of the items to be placed with their longest edge parallel to the first item.

@mr_vodka - thanks!

Also, I'm thinking that instead of starting with the object with the longest edge, to start with the item that has the greatest volume.  Or, if there is group of items with the same exact dimensions, treat them as one item.

• ###### 8. Re: Help in calculating box size needed for multiple items

This is an interesting problem! My instinct would not to be determining the sizes of the smallest or largest items. Instead I would determine the smallest unit of volume common to all sizes (cubic inch, cubic centimeter, 2 inches cubed, 3 inches cubed etc.) and work upward/outward from there. If an item, and this is assuming regular shapes, is 5" x 7" x 2" that's 70 cubic inches. If your box is 20 x 20 x 20" (8000 cubic inches) the program needs to determine WHICH set of units is occupied by each item to most efficiently fill the box. Using the size of the smallest item may not allow for the most efficient use of space since the size of a larger item is not necessarily a multiple of the smallest. However, all items would necessarily be a multiple of the smallest common unit of volume. Some items will end up on-end etc. It seems difficult, but not impossible.

Re-reading what I just wrote I can see that  I may be "taking the long way around". I'm not sure.

• ###### 9. Re: Help in calculating box size needed for multiple items

This sounds like one of those problems where you can easily produce a solution that's worse than the problem.

Consider the situation where the "box packer" is handed a print out that identifies the smallest possible box for the shipping bill and a "map" diagramming how to pack it. They then spend the next 15-20 minutes matching the "map" to the items in the shipping bill, packs them to match and finally ships them out the door.

Compare that to a person simply grabbing a box that is a bit larger than the "best" choice, packs it in 5 minutes because they no longer need the map, tops it with a bit more packing material than required for the "best" box and goes on to pack the next shipment.

In many cases, the difference in time/labor cost in option 2 will far outweigh the savings in materials and reduced shipping weight from option 1.

Thus, expending a lot of time and effort producing an algorithm that determines the smallest possible box might not be as useful as a simpler algorithm that identifies a box that should be "big enough" to hold all the items.

• ###### 10. Re: Help in calculating box size needed for multiple items

Definitely agree.  It's obvious that Amazon must be not be using a very sophisticated program, based on the packages I've received from them!  And while the 'best' box may not be the smallest, most efficent one, it's just as important to estimate the number of boxes, to then calculate total shipping charges for the group of items.

So how does this sound:

1. Total the volume of items, determine if they are close to, or greater than, the largest box available ( from a box size table!)

2. Sort/Group items, attempting to match dimensions - meaning, if items need to be stacked, put all the items with the same height in the same layer.

3. Treating grouped items as one unit, place items one layer at a time

4. If there is no more room left in the box, try the next largest

• ###### 11. Re: Help in calculating box size needed for multiple items

etripoli wrote:

Is Mike on this forum, or still over at FMForums?  He might want to get in on this!

Greetings etripoli,

I've pondered the problem for three dimensions, but haven't worked out CFs for it yet.  If the items are all the same size, then I think the algorithm we came up with in the other thread can be adjusted fairly easily for adding the third dimension.  If you know how many can fit in the container's base layer (area), then computing the number of layers that will fit the height is just a matter of a little arithmetic.

To find the best fit for all items then becomes a matter of trying the inputs in different order (H,W,D, then W,H,D.)  The algorithm already does this for two dimensions, so I'd guess only one additional call with a different order would be necessary.

--Mike

• ###### 12. Re: Help in calculating box size needed for multiple items

Thanks for stopping by Mike!  In my situation, it's likely that no two items will have the exact same dimensions, but it's possible that they would share a dimension, e.g. the width of one item may be the same as the height of another.  And, I could be dealing with any combination of items, from about a total possible selection of 1000.  I think your idea of trying to make layers would work, but I'm beginning to think that the process needs to be scripted rather than CF.

I've posted a test database, using simple calculations to determine if an item, and groups of items, could 'theoretically' fit in a selected box size.  I made some enforceable assumptions, such as the smallest dimension should always be the box/item height, and the largest dimension should always be the width.  This might also help reduce the complexity of any calculations.

Box Compactor, V1

• ###### 13. Re: Help in calculating box size needed for multiple items

Guys, this all sounds too complicated.  I'm sure the answer lies in something a lot simpler.  I have configured loads, and stowed Containers for around 40 years.  Consolidating Industry sources tell me that currently they expect an FAK usage of 24.00 to 25.00 m3 in a standard 6.00 ml Container.  My personal records show a high percentage usage of 30.00 to 31.00 m3., per Container, with only a few falling below that, and very few at 24.00 m3,  -  but I controlled everything,  -  and made my own decisions.

I'm going to quietly work away at devising a method to do this job on a computer. Talk to you all later.  Johnmc

• ###### 14. Re: Help in calculating box size needed for multiple items
I'm not too familiar with the terms and amounts you're referring to johnmc, can you elaborate?  Are you working with large boxes, being placed in defined spaces - like a truck or warehouse - or, as I am, smaller boxed items put into 1 - 3 cubic foot shipping boxes?