有多项式算法来呢?也许动态规划方法?多项式、算法、方法、动态

2023-09-11 04:05:05 作者:淡若輕風

假设您将得到一组的 A 的= {1,2,..., M 的}和一组的 B 的= {1 ,2,...,的 N 的},使得的从该组的甲的每个元素必须从乙 的。每个元素的下列参数的我的起订的 A 的每个元素的Ĵ的起订的 B 的是众所周知的:

Assume you are given a set A = {1, 2, ..., m} and a set B = {1, 2, ..., n}, such that each element from the set A has to be assigned to some element from B. The following parameters for each element i from the set A and each element j from the set B are known:

的取值 IJ 的是分配的成本要素的我应用于元素的Ĵ的大于或等于零; 的 T IJ 的是元素的最小preference的我应用于元素的Ĵ的大于或等于零; 的 T IJ 的是元素的最大preference的我应用于元素的Ĵ的大于或等于零。 Sij is the cost of assignment an element i to element j greater or equal to zero; tij is the minimal preference of element i to element j greater or equal to zero; Tij is the maximal preference of element i to element j greater or equal to zero.

对于每一个固定的我的,的的 T IJ 的 T IJ (适用于所有的Ĵ)是不同的。的米的和的 N 的是大于0的整数,并且其它变量都是非负实数。

For each fixed i, all values of tij, Tij (for all j's) are different. m and n are integers greater than 0, and the other variables are non-negative real numbers.

从集合中元素的 A 的从分配给元素的 B 的根据自己的preferences的 T IJ (或 T IJ 的)。例如,如果的 T IJ 的< T IK 的(preferences的 T IJ 或 T IK 的可能,在任何情况下使用,而不是进一步读取),那么元素的我的将被分配到的Ĵ的而不是 K 的。出的明尼苏达州的的preferences,完全的研究的他们不得不使用的 T IJ 的价值作为一种价值的preference,和其余的明尼苏达州 - R的的必须使用的 T IJ 的(这是较低的值,然后的 T IJ 的)。

Elements from the set A are assigned to elements from B according to their preferences tij (or Tij). For example, if tij < tik (preferences Tij or Tik might be used in any case instead, read further), then element i will be assigned to j rather then k. Out of mn preferences, exactly r of them have to use value of Tij as a value of preference, and remaining mn - r have to use value of tij (which is lower value then Tij).

如果元素的我的被分配给一个元素的Ĵ的,则成本的小号 IJ 的被添加到分配元件总成本的Ĵ的,即 C Ĵ = C Ĵ 的+ 取值 IJ 的。让我们的最大的是最大在所有成本的 C Ĵ 和最小的最低所有成本中的 C Ĵ 的。我们的目标是选择哪个$ P $ assignment元素的pferences的我应用于元素的Ĵ的将采取的 T IJ ,并且preferences将采取的值的 T IJ 的,这样的值:

If element i is assigned to an element j, then the cost Sij is added to the total cost of assignment to element j, i.e., Cj = Cj + Sij. Let Max be the maximum among all costs Cj and Min the minimum among all costs Cj. The goal is to choose which preferences of assignment element i to element j will take the value of Tij, and which preferences will take the value of tij, such that the value of:

的最大的是最小的; 的最大值 - 最小值的最小 Max is minimal; Max - Min is minimal.

我觉得有一些动态规划算法,但我不知道。有谁知道如何通过DP的办法,或任何其他解决呢?它可能不是多项式,但是,但是我认为它是。

I think there is some dynamic programming algorithm, but I'm not sure. Does anybody know how to solve this by DP approach, or any other? It might not be polynomial, however, but I think it is.

例。让我们的 M = 3, N = 2,即 A 的= {1,2, 3}和的乙 = {1,2,3}。让我们的研究 = 2,和矩阵的取值的 T 和 T 的被指定为

Example. Let m = 3, n = 2, i.e. A = {1, 2, 3} and B = {1, 2, 3}. Let r = 2, and matrices S, t and T be given as

    |5 9|      |1 3|      |10  7|
S = |7 1|, t = |4 2|, T = | 5  4|.
    |8 4|      |3 4|      | 9 12|

解决方案等于5 的最小化的最大的值的情况。类似的例子可能最小化来构建的最大 - 最小的

Solution is equal to 5 in the case of minimizing the value of Max. Similar example might be constructed for minimizing Max - Min.

推荐答案

这个问题是NP难的,这可以通过减少的分区它。

The problem is NP-hard, which can be shown by reducing Partition to it.

让我们假设有一个算法的 M 的是最佳解决您的问题。

Let's assume we have an algorithm M that solves your problem optimally.

我们都获得了分区实例的 X 的= { X 1 ,X 2 ,...,X 米 的},并希望找到的取值的一个分区分成两个亚群的最低金额差异。我们定义的 N = 2,S IJ = X 我,T IJ = -j,T IJ = j的的。现在我们只遍历所有可能的研究的并调用的 M 的作为一个子程序来找到全局最小值的最大的。我们可以证明,分配,结果在最小的最大的是一个最佳的2分区的 X 的。

We are given a Partition instance X = {x1, x2, ..., xm} and want to find a partition of S into two subsets with minimum sum difference. Let's define n = 2, Sij = xi, tij = -j, Tij = j. Now we just iterate over all possible r and call M as a subroutine to find the global minimum for Max. We can show that the assignment that results in the minimum Max is an optimal 2-partition of X.

既然你不工作整数成本,但与真正的成本,因为你的问题很可能获得较硬的 N> 2 的(我们也可以减少的装箱,提供的 N 的垃圾箱在一个直接的方式你的问题),这似乎不大可能,存在着针对您的问题,即使是pseudopolyonomial解决方案,除非 P = NP 的。你应该考虑使用启发式获得良好的近似解。一个好的起点是看的装箱的近似方案,并试图把它们适应你的问题。也许一个简单的一合适的方法是足够满足您的需求。两件事你应该记住的:

Since you're not working with integer costs but with real costs and since your problem is likely to get harder for n > 2 (we can also reduce Bin packing with n bins to your problem in a straight-forward way), it seems highly unlikely that there exists even a pseudopolyonomial solution for your problem unless P = NP. You should consider using heuristics to get a good approximative solution. A good starting point would be to look at the approximation schemes for Bin packing and try to adapt them to your problem. Maybe a simple first-fit approach is enough for your needs. Two more things you should keep in mind:

您可以二进制搜索的最大的,然后把它作为一个固定的上限为您的垃圾桶 的吨 IJ 的和的 T IJ 的可降低到它们各自的argmins对于固定的我的。你有一组preferences的 T I,1 的(摘自 T IJ 的)和替代一套preferences的 T I,2 的(摘自 T IJ 的),为每一位的我的。没有点甚至考虑非最小preferences。 You can binary search for Max and then use it as a fixed upper bound for your "bins" tij and Tij can be reduced to their respective argmins for a fixed i. You have a set of preferences Ti,1 (extracted from tij) and an alternative set of preferences Ti,2 (extracted from Tij) for every i. No point even considering the non-minimal preferences.