BOX

所属分类:数据结构
开发工具:Visual C++
文件大小:2KB
下载次数:20
上传日期:2011-10-27 15:05:07
上 传 者ljpnndd
说明:  最少背包问题:假设有许多盒子,每个盒子能保存的总重量为1.0。有N个项i1,i2,…,iN,它们的重量分别是w1,w2,…,wN。目的是用尽可能少的盒子放入所有的项,任何盒子的重量不能超过他的容量。例如,如果想的重量为0.4, 0.4, 0.6和0.6,用两个盒子就能解决。 按如下策略解决此问题:按给定的次序扫描每一个项,把每一个项放入能够容纳他而不至于溢出的最满的盒子。用优先级队列选择要装入的盒子。
(Minimum knapsack problem: Suppose there are many boxes, each box can hold a total weight of 1.0. There are N items i1, i2, ..., iN, their weight are w1, w2, ..., wN. Purpose is to use as little as possible of all the items into the box, any box weight can not exceed his capacity. For example, if you want the weight of 0.4, 0.4, 0.6 and 0.6, with the two boxes can be solved. Strategy to solve this problem as follows: given the order by scanning each item, put each item into him and will not be able to accommodate the overflow of the most full of boxes. With a priority queue to select into the box.)

文件列表:
BOX.cpp (4530, 2011-10-27)

近期下载者

相关文件


收藏者