文件名称:BOX
介绍说明--下载内容均来自于网络,请自行研究使用
最少背包问题:假设有许多盒子,每个盒子能保存的总重量为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.
按如下策略解决此问题:按给定的次序扫描每一个项,把每一个项放入能够容纳他而不至于溢出的最满的盒子。用优先级队列选择要装入的盒子。-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