什么是算法,以一组项目分为3个独立的组相当?算法、独立、项目

2023-09-11 04:41:22 作者:不必在乎太多

我在我的书这个问题: 给定一组n个项目,每一个不同的值V(I),什么是将项目分为3组,这样的组与最高值最小化的最佳方法是什么?给这个最大的群体的价值。

I have this problem in my textbook: Given a group of n items, each with a distinct value V(i), what is the best way to divide the items into 3 groups so the group with the highest value is minimIzed? Give the value of this largest group.

我知道该怎么做这个问题的2堆变体:它只是需要在这个问题上运行的背包算法倒退。不过,我是pretty的困惑,如何解决这个问题。任何人都可以给我任何指针?

I know how to do the 2 pile variant of this problem: it just requires running the knapsack algorithm backwards on the problem. However, I am pretty puzzled as how to solve this problem. Could anyone give me any pointers?

答:pretty的同样的事情为0-1背包,虽然2D

Answer: Pretty much the same thing as the 0-1 knapsack, although 2D

推荐答案

艰难的家庭作业的问题。这实质上是3-划分问题的优化版本。

Tough homework problem. This is essentially the optimization version of the 3-partition problem.

http://en.wikipedia.org/wiki/3-partition_problem

这是密切相关的装箱,分区和子森(而且,正如你提到的,背包)。然而,它正好是强烈NP完全,这使得它比其表亲更硬。无论如何,我建议你先来看看动态规划解决方案的相关问题(我会从分区,但发现DP解决方案的非维基百科的解释)。

It is closely related to bin packing, partition, and subset-sum (and, as you noted, knapsack). However, it happens to be strongly NP-Complete, which makes it a harder than its cousins. Anyway, I suggest you start by looking at dynamic programming solutions to the related problems (I'd start with partition, but find a non-wikipedia explanation of the DP solution).

更新:我向你道歉。我有误导你。三分区的问题把输入到台3,不是3套。我所说的其余部分仍然适用,但随着新的希望,你的变体是不是强NP完全问题。

Update: I apologize. I have mislead you. The 3-partition problem splits the input into sets of 3, not 3 sets. The rest of what I said still applies, but with the renewed hope that your variant isn't strongly np-complete.