最好的策略分配数量成团均匀 [英] Best strategy to distribute number into groups evenly

查看:111
本文介绍了最好的策略分配数量成团均匀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您有整数A = {1,3,60,24}和两个列表B = {14,54,3},顺序和列表的长度是不确定的。 什么是把号码一到B,因此导致B的变化是尽可能平衡的最佳策略。你不必把A中的所有号码为B,如果没有可用的空间。但是你得把号码,如果有可用空间

You have two list of integer number A={1,3,60,24} and B={14,54,3}, the order and list length is undetermined. What is the best strategy to put numbers in A into B so that the variance of result in B is as balanced as possible. You do not have to put all numbers in A into B if there is no space available. But you have to put number if there is space available

我想申请分枝限界,以及但是,我不知道如何找到一个剪枝条件,例如计算子问题的方差(未完全充满)告诉削减哪支?

I am thinking of applying Branch and Bound, and however, I am not sure how to find a prune condition such as calculating variance of the sub-problem(not completely filled) to tell which branch to cut?

任何想法?

推荐答案

您所描述的问题是分区的问题(的 http://en.wikipedia.org/wiki/Partition_problem )。找到最优的解决方案是NP完全然而有许多近似值,其是几乎完美的大多数情况下的

The problem you are describing is the partition problem(http://en.wikipedia.org/wiki/Partition_problem). Finding an optimal solution is NP-complete however there are a number of approximations that are almost perfect for most cases.

其实,您所描述的算法是这样的操场上孩子们会挑选球队。此贪婪算法显着地表现良好,如果该集合中的数字是大小相似的订单。当然,这不是最好的解决办法,但考虑到的问题是如何NP完全问题,这是pretty的天哪该死的好,它的简单。

In fact, the algorithm you described is the way playground kids would pick teams. This greedy algorithm performs remarkably well if the numbers in the set are of similar orders of magnitude. Sure, it's not the best solution, but considering how the problem is NP-complete, it's pretty gosh darned good for it's simplicity.

本文章美国科学家给出了这个问题的一个很好的分析,你应该通过阅读它:最简单的难题(的 http://www.americanscientist.org/issues/pub/2002/3/the-easiest-hard-problem )。

This article in American Scientist gives an excellent analysis of the problem and you should go through and read it: The Easiest Hard Problem(http://www.americanscientist.org/issues/pub/2002/3/the-easiest-hard-problem).

这篇关于最好的策略分配数量成团均匀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆