
1. Re: Help in calculating box size needed for multiple items
johnmc Aug 11, 2009 10:04 PM (in response to etripoli)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
etripoli Aug 12, 2009 9:11 AM (in response to etripoli)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...

3. Re: Help in calculating box size needed for multiple items
mrvodka Aug 12, 2009 9:38 AM (in response to etripoli)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.

4. Re: Help in calculating box size needed for multiple items
etripoli Aug 12, 2009 10:17 AM (in response to etripoli)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
philmodjunk Aug 12, 2009 11:08 AM (in response to etripoli)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
mrvodka Aug 12, 2009 11:11 AM (in response to etripoli)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
etripoli Aug 12, 2009 11:43 AM (in response to etripoli)@Phil  yes, I think it's safe to say that the items are all rectangular solids. Also, a coworker 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
RickWhitelaw Aug 12, 2009 11:57 AM (in response to etripoli)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 onend etc. It seems difficult, but not impossible.
Rereading 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
philmodjunk Aug 12, 2009 1:43 PM (in response to etripoli)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 1520 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
etripoli Aug 12, 2009 3:33 PM (in response to etripoli)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
Ender Aug 12, 2009 4:02 PM (in response to etripoli)
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
etripoli Aug 12, 2009 4:40 PM (in response to etripoli)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.

13. Re: Help in calculating box size needed for multiple items
johnmc Aug 12, 2009 6:10 PM (in response to etripoli)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
etripoli Aug 12, 2009 7:46 PM (in response to etripoli)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?