Knapsack / Bin Packing Problem with a twist?

197 Views Asked by At

So, I've been searching far and wide and I'm still not sure what the correct classification of the problem that I'm dealing with is, so I can't really search for solutions to it.

I have x amount of different objects (of which I know their H/W/L) and I want to fit them into boxes, but I don't want to fit as many in one box as possible, one object goes into one box. I want to decide on how many different sizes of boxes I would need to fit those objects into them, while also minimizing the amount of different sized boxes. One thing that makes the problem a little easier is that the width and height of the objects are the same for all objects, so length is the only issue.

To give a more practical idea of what my use case would be, the problem at hand is how does a company determine, which different box sizes they should have in order to fit all their different products into them, without having unnecessarily many different box sizes.

Example: I have an object that has a length of 1200 mm and another one that has a length of 1150 mm, both share the same width and height. Since the difference in length is so small, it would make sense to not have an extra box size just for that 1150 mm object and use the same box for both.

My idea to solve the problem was to cluster the objects using an algorithm and playing around with the number or the center of clusters.

What type of problem am I looking at and what type of algorithm would be best to cluster my objects?

1

There are 1 best solutions below

0
On

Clustering is a good solution for this problem. Find the clusters but then get the max length from the cluster because a smaller object from the cluster will be able to fit into a big box but it will not be possible for the big object to fit into a small box.

The number of clusters will indicate the number of box sizes you will have. But you might also have some outliers for example you might have a cluster with heights from 1 to 15 but only one height is 15 while the rest are less than 10. So, in that case you will have to decide if you want a box of size 15 or you want two boxes of 10 and 15 height.