我在努力实施一个项目时,会解决这个问题,我将在问题的真正领域之外再谈这个问题(我相信,我可以谈论烟火和形状的解冻,但会使理解更加复杂化)。 I m 寻求一种(可能大致)算法解决。
我有
我的目的是把所有物体装入集装箱内(即已经知道可能的话),这样每集装箱的彩色种类就会减少到最低限度。 由于“各种颜色被减至最低”,我指的是每个集装箱不同颜色的数量少之又少。
例如。 我有2个大小的集装箱和4个物体,其颜色为{红}、{红、绿色}、{蓝色}、{蓝色、绿色}。 1. 导言 最好的解决办法是[参数}、{红、绿色}]、[参数}、{蓝色、绿色}],其总量为2+2=4。 更糟糕的解决办法是[{red},{blue}], [{red, Green},{blue, Green}],其总品种为2+3=5。
My guess is that the problem is NP hard, since it sounds more difficult than the knapsack problem: the value of objects is transformed in a negative value which moreover depends on the other objects inside the same container. But I have no good idea as how to tackle the problem for an approximate solution, which would be more than welcome anyway.