Stacking Algorithm - Stack of 3D objects in the smallest possible area

I am trying to solve the problem of packing objects in the most convenient size for mail. The size and shape of the objects will vary. The length, width and height of all objects are known.

For example, a customer can order an object (length x width x height) 200x100x10cm (wide, long and flat) together with 2 objects 50x50x50cm (cubes). If I packed this, I would put a flat, wide object on the bottom and two cubes on top, side by side.

Does anyone have or have a reasonable, efficient algorithmic solution? Or even an approach to how I should think about it. I prescribed all week, late, and my brain is fried. I'm not desperate yet, but I just want to spend the day off tomorrow.

As I suppose, this will be the creation of an array representing three-dimensional space, each element of the array representing 1 square / cm in this space. The length and width of the three-dimensional space will be based on the longest object and the widest objects. Then you simply work from the largest object to the smallest object, find enough “holes” and fill them when you go.

Although I am sure there will be a mathematical formula that makes this much more efficient.

Any ideas?

+3
source share
4 answers

The first tip is to step back from the keyboard, stop coding, start thinking!

- ( , ) - . , , , , , .

- Google -, , .

, , : -)

+5

, , NP-hard. , , ! Knapsack, .

+2

, . , , Google , ( 3- D, ).

? (.. TEU, , , Fedexing), , , .

+2

, , , :

1) , , 14% ( 34%? !) . - ", " .

2) .

There are also companies like Logen Solutions and MaxLoad that do this for a living, so if you are willing to pay, you can also use your web services.

+1
source

Source: https://habr.com/ru/post/1713946/


All Articles