登录
首页 » 算法 » 01背包问题

01背包问题

于 2022-03-15 发布 文件大小:255.10 kB
0 216
下载积分: 2 下载次数: 1

代码说明:

01背包是在M件物品取出若干件放在空间为W的背包里,每件物品的体积为W1,W2……Wn,与之相对应的价值为P1,P2……Pn。考虑用动态规划的方法来解决,这里的:阶段是:在前N件物品中,选取若干件物品放入背包中; 状态是:在前N件物品中,选取若干件物品放入所剩空间为W的背包中的所能获得的最大价值;决策是:第N件物品放或者不放; 由此可以写出动态转移方程:我们用f[i,j]表示在前 i 件物品中选择若干件放在所剩空间为 j 的背包里所能获得的最大价值f[i, j] = max( f[i-1, j-Wi] + Pi (j >= Wi), f[i-1, j] )

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • Least Soft-thresold Squares Tracking
    we propose a generative tracking method based on a novel robust linear regression algorithm. In con- trast to existing methods, the proposed Least Soft-thresold Squares (LSS) algorithm models the error term with the Gaussian-Laplacian distribution, which can be solved ef- ficiently. Based on maximum joint likelihood of parameters, we derive a LSS distance to measure the difference between an observation sample and the dictionary. Compared with the distance derived from ordinary least squares methods, the proposed metric is more effective
    2022-03-22 17:30:20下载
    积分:1
  • 分析与设计 0-1背包问题四种不同的实现 C语言实现
    算法分析与设计 0-1背包问题四种不同算法的实现 C语言实现 贪心算法总是作出在当前看来是最好的选择,即贪心算法并不从整体最优解上加以考虑,它所作出的选择只是在某种意义上的局部最优解。贪心算法不是对所有问题都能得到整体最优解,但对范围相当广的许多问题它能产生整体最优解。在一些情况下,即使贪心算法不能得到整体最优解,但其最终结果却是最优解的很好近似解。
    2022-02-03 07:48:49下载
    积分:1
  • Apria的实现
    利用C++编写的Apriori算法,可以运行,结果正确。可以挖掘频繁项集以及生成关联规则结果。算法易懂,是一份不错的学习资料。
    2022-07-08 16:00:02下载
    积分:1
  • basic huffman code, visual c
    basic huffman code, visual c-basic huffman code, visual c++
    2022-03-16 14:22:58下载
    积分:1
  • 很多数值分析函数
    很多数值分析算法函数-A lot of numerical analysis algorithm function
    2022-05-21 21:36:22下载
    积分:1
  • 数学建模若干问题的论文
    数学建模若干问题的论文- Mathematics modelling certain questions papers
    2022-04-29 15:18:04下载
    积分:1
  • 雨天比赛
    跳房子游戏-Rainy Game
    2022-03-01 23:18:58下载
    积分:1
  • basic length converter
    这是一个简单的c#编码,用于转换以下长度:
    2022-02-07 15:35:47下载
    积分:1
  • 基于遗传的tsp
    资源描述基于GA的tsp算法结局旅行商问题,该方法高校快捷方便,所需数据简单,代码有注释,易懂,能进行修改,是一套非常不错的算法,用了好多次 稳定性较好。
    2022-06-12 07:26:08下载
    积分:1
  • n皇后问题,亦是经典与分析题目,通过回溯的方,解决此问题...
    n皇后问题,亦是经典算法与分析题目,通过回溯的方法,解决此问题-n queens problem, is also a classical algorithms and analysis of the subject, through the back way to solve this problem
    2022-12-30 04:25:03下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载