文件名称:GreedyBag
介绍说明--下载内容均来自于网络,请自行研究使用
贪心算法求背包问题,分别求出了三种标准1. 按效益值由大到小取物品. 2. 按重量值由小到大取物品
3.按比值pi/wi的值由大到小取物品
其中第3种是最优解-Greedy algorithm for knapsack problem, respectively, obtained three standard 1. Press-effective value of descending and remove things. 2. By weight the value of items taken from small to big 3. According to the ratio of pi/wi check the value of descending The first of these three kinds of goods is the optimal solution
3.按比值pi/wi的值由大到小取物品
其中第3种是最优解-Greedy algorithm for knapsack problem, respectively, obtained three standard 1. Press-effective value of descending and remove things. 2. By weight the value of items taken from small to big 3. According to the ratio of pi/wi check the value of descending The first of these three kinds of goods is the optimal solution
(系统自动生成,下载前可以参看下载内容)
下载文件列表
GreedyBag.cpp