文件名称:1108
介绍说明--下载内容均来自于网络,请自行研究使用
在0 / 1背包问题中,需对容量为c 的背包进行装载。从n 个物品中选取装入背包的物品,每件物品i 的重量为wi ,价值为pi 。对于可行的背包装载,背包中物品的总重量不能超过背包的容量,最佳装载是指所装入的物品价值最高,即n ?i=1pi xi 取得最大值。约束条件为n ?i =1wi xi≤c 和xi?[ 0 , 1 ] [ 1≤i≤n]。-At 0/1 knapsack problem, there is a need for a capacity of c for the loaded backpack. N items from a backpack loaded, select the items, each item i the weight of wi, the value of pi. Feasible for loading backpack, backpack items total weight of the backpack should not exceed capacity, the best means by loading articles into the highest value, that is, n? I = 1pi xi to obtain the maximum value. Constraint condition for n? I = 1wi xi ≤ c and xi? [0, 1] [1 ≤ i ≤ n].
(系统自动生成,下载前可以参看下载内容)
下载文件列表
1108 0-1背包问题.cpp