搜索资源列表
myknapsack
- a) 0-1背包问题采用的是动态规划法,该算法思想简介如下: 有些问题常常没有办法把它们分成较小数目的子问题,在这种情况下,可以试着把问题分成必要多的子问题,每个子问题又可以分成数目不确定的必要多的子子问题,这样就会产生大量的子问题。如果分得的子问题界限不清,互相交叉,则在大量的子问题中会存在一些完全相同的子问题,因而在解这类问题时,将可能重复多次解同一个子问题。这种重复当然是不必要的,避免的方法可以在解决一个子问题后把它的解(包括其子子问题的解)保留下来,若遇到求解与之相同的子问题的时候,
背包问题2 递归
- 一个0-1背包问题的C++实现,背包的容量为t,各物品的重量分别为w1,w2。。。wn,找一个能装下最大重量的物品组合,用递归形式的贪心法实现-a 0-1 knapsack problem of C achieved, the capacity for backpack t, the weight of the items were w1, w2. . . Wn, one can find the largest installed under the weight of goods portf
beibao
- 通过贪心算法实现背包问题,可实现小规模背包问题-Through the greedy algorithm knapsack problem, enabling small-scale knapsack problem
0-1bag
- 实现0—1背包问题的分支限界搜索,为控制台应用程序,编译环境为vs2008-0-1 knapsack problem to achieve the branch and bound search for the console application, compile environment for vs2008
tanxi
- 这是算法中的背包问题。是大三时做的一个程序,如何输入,忘记了。不过很简单,只是给大家参考-This is the algorithm of the knapsack problem. Is the junior year to do a program, how to enter, forgotten. But it is simple, but for your reference
backpack
- 对背包问题进行的求解,能够处理体积相同,但是不同物品的问题-The solution on the knapsack problem that can handle the same volume, but the problem of different items
22
- 算法分析设计中背包问题,非常实用,在vc++6.0成功编译-Knapsack Algorithm design, very practical, successful in compiling vc++6.0
Ten-classic-algorithms
- 包含了十余个经典的算法问题,如背包问题,多段图等-Contains more than a dozen classic algorithms, such as the knapsack problem, Multistage Graph
box
- 基于动态规划法的0-1背包问题,本代码实现了背包问题的详细过程。-0-1 knapsack problem based on dynamic programming, the code to achieve the detailed process of the knapsack problem.
Knapsack
- 算法设计与分析中背包问题。 首先将最优解矩阵的第一行和第一列均赋值为0;然后从上至下、从左至右依次计算m[i][j]的值,如果第i个物品 的重量大于j的值,即第i个物品不放入背包中,则将m[i][j]赋值为m[i-1][j],否则取第i个物品放入背包和不放入背 包所得价值的最大值;最后从后往前计算最优解向量的值,如果m[i][j]=m[i-1][j],则将x[i]赋值为0,否则将x[i] 赋值为1,并将j减去第i个物品的重量。-The knapsack problem al
