algorithmoptimizationgraphicslinear-algebragraph-algorithm

Packaging red boxes in blue boxes to optimize cost is challenging


This is mainly a packaging problem: Suppose that there are 20 red boxes of various sizes r1 to r8 (so multiple of each size may exist), which are supposed to be shipped using blue packaging boxes which are available in 3 sizes b1, b2 and b3.

Now what would be your approach to solve this problem?


Solution

  • To start you can use a treemap or a kd-tree, you can find an example here: http://www.blackpawn.com/texts/lightmaps/default.html. Maybe you can combine this with a bin-packing algorithm for example first-fit.