Hi everyone!

I have a very interesting challenge for you!

(or at least I hope you’ll see it this way because I’m in a dead end and I need some help hehehe)

I have a series of random sized boxes (presents - green ones) and 3 fixed sized boxes (red ones)

What I’m trying to do is correspond each ‘present’ to the smallest possible ‘box’ it can fit in.

but there is a catch: the ‘presents’ need not be upright in the boxes.

In my mind, the algorithm should order the three dimensions of the presents and find the smallest possible of the boxes whose three dimensions (from big to small) are bigger than (or equal to) the corresponding ordered dimensions of the present.

that should be a watertight algorithm right?

problem is I’ve been struggling for a few hours so far and I go around in circles…

- what I’m looking for, is just a list that tells me how many times each type of box is needed. no need to know which present it corresponds to .

presents.gh (9.4 KB)