[英]What is the optimal solution for minimum cost storage assignment optimisation problem?
I have been trying to find a solution for the following assignment problem:我一直在尝试为以下分配问题找到解决方案:
The problem is to assign the packages to the storage room so as to minimise the total cost.问题是将包裹分配到储藏室以最小化总成本。
My thoughts:我的想法:
This problem is NP-hard by a reduction from the set partition problem.这个问题是 NP 难的,通过减少集合划分问题。 In that problem, you're given a set S of positive integers, and the goal is to split it into two sets that have the same sum.在那个问题中,给定一组正整数 S,目标是将它分成两个总和相同的集合。
You can reduce that problem to this one as follows.您可以按如下方式将该问题简化为这个问题。 Given a set S, sum up its elements to get their total 2n, which we assume is even.给定一个集合 S,将其元素相加得到它们的总数 2n,我们假设它是偶数。 Now create three storage rooms, two of size n and one of size 2n.现在创建三个储藏室,两个大小为 n,一个大小为 2n。 Call the two rooms of size n the “main rooms,” and the room of size 2n the “overflow room.”将大小为 n 的两个房间称为“主房间”,将大小为 2n 的房间称为“溢出房间”。 For each element of the set S, create an item to store whose size is equal to its value.对于集合 S 的每个元素,创建一个要存储的项目,其大小等于其值。 Finally, assign costs as follows: the cost of placing any item into one of the two main rooms is zero, and the cost of placing any item into the overflow room is 1.最后,分配成本如下:将任何物品放入两个主要房间之一的成本为零,将任何物品放入溢出房间的成本为 1。
Now, think about the cheapest way to place items.现在,想想最便宜的放置物品的方式。 If there is a partition of S into two equal sets, then you can place the items in the main rooms at cost 0 using that partition.如果将 S 分成两个相等的集合,那么您可以使用该分区以成本 0 将物品放置在主房间中。 Similarly, if you can place the items into the rooms at cost 0, then you must not have put any items into the overflow room, and so you have split the items in a way that perfectly fills the two main rooms - a partition.类似地,如果您可以以 0 的成本将物品放入房间,那么您一定没有将任何物品放入溢出房间,因此您以完美填充两个主要房间的方式拆分物品 - 一个分区。
A Mixed-Integer Programming model can look like:混合整数编程 model 可以如下所示:
min sum((p,s),T[p,s]*x[p,s])
sum(p, Z[p]*x[p,s]) <= C[s] ∀s
sum(s, x[p,s]) = 1 ∀p
x[p,s] ∈ {0,1}
This can be solved with any MIP solver.这可以用任何 MIP 求解器来解决。 These assignment models tend to be fairly easy to solve.这些分配模型往往相当容易解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.