登录
首页 » Windows开发 » 1背包问题是NP难题。0

1背包问题是NP难题。0

于 2022-03-25 发布 文件大小:17.38 kB
0 194
下载积分: 2 下载次数: 1

代码说明:

0-l背包问题是子集选取问题。一般情况下,0-1背包问题是NP难题。0-1背包 问题的解空间可用子集树表示。解0-1背包问题的回溯法与装载问题的回溯法十分类 似。在搜索解空间树时,只要其左儿子结点是一个可行结点,搜索就进入其左子树。当 右子树有可能包含最优解时才进入右子树搜索。否则将右子树剪去。设r是当前剩余 物品价值总和;cp是当前价值;bestp是当前最优价值。当cp+r≤bestp时,可剪去右 子树。计算右子树中解的上界的更好方法是将剩余物品依其单位重量价值排序,然后 依次装入物品,直至装不下时,再装入该物品的一部分而装满背包。由此得到的价值是 右子树中解的上界。-0-l knapsack problem is selected subset of the problem. Under normal circumstances, 0-1 knapsack problem is NP-hard. 0-1 knapsack problem the solution space available subset of the tree said. Xie 0-1 knapsack problem with the law retroactively loading the retroactive law very similar. The search solution space trees, as long as their son left node is a viable nodes, the search entered its left subtree. When the right subtree is the optimal solution may contain only son into the right tree search. It will cut right subtrees. Suppose that r is the total value of the remaining items; Cp is the current value; Bestp is currently the best value. When cp r bestp, they can cut right subtrees. Calculation right

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

发表评论

0 个回复

  • 一个计算24点的小游戏 只要给出四个数字就能算出所有结果
    一个计算24点的小游戏 只要给出四个数字就能算出所有结果-a calculation of 24 points in the game as long as a small number will be given four calculate all the results
    2022-11-08 02:40:03下载
    积分:1
  • 用c编写的密码程序DES
    用c编写的密码程序DES-prepared using the password procedures DES
    2023-01-07 22:00:03下载
    积分:1
  • c++习题。包含代码填空试题和习题库两个文件
    c++习题。包含代码填空试题和习题库两个文件-c++ exercises. Contains the code to fill in the blank questions and exercises two documents library
    2022-01-29 03:48:32下载
    积分:1
  • 用C++实现的简单目标识别源代码,特别可以识别红色的目标
    用C++实现的简单目标识别源代码,特别可以识别红色的目标-A system which is realized by c++
    2022-01-26 02:46:04下载
    积分:1
  • IC卡读写软件
    通过VC++实现对IC的读写操作,具体包括:打开IC卡读写设备、关闭IC卡读写设备、读取IC卡号、读取IC扩展区内数据、向IC卡扩展区内写入数据等操作
    2023-06-11 12:25:04下载
    积分:1
  • C++填充源程序,有助于对图形学初期学习的人!
    C++填充源程序,有助于对图形学初期学习的人!-C++ fill scoure code!
    2022-01-25 16:58:28下载
    积分:1
  • 三层体系结构 我们经常会看到许多应聘者在简历上写着“精通数据库编程”的字样,也经常会在招聘网站上看到软件公司的招聘要求中某一项为“精通数据库编程”。于是这些应聘者去这些软件公司面试,于是我们看到了许多“精通”者落选的现象。 一些程序员在设计数据库应用时,通常会采用数据控件绑定的方法实现。用鼠标拉几个控件,再用鼠标设置几个属性,连键盘都不用动,就完成了一个数据库应用的开发!当然,这的确是一种快速的数据库应用开发方式,但快速并不意味着精通。 对于大型的数据库应用系统,或是拥有众多客户端的应用系统,我们需要另外一种“精通”,这就是几乎每个程序员都听说过的“三层体系结构”。-three-tier architecture we often see many candidates in the curriculum vitae reads "proficient Database Programming" message, often in recruitment website software companies see the recruitment of a request for a "proficient database programming." So these candidates to interview these software companies, so we see a lot of "proficient" who lost the phenomenon. Some programmers in the design database applications, using data normally bind to the control method. Pull a few mouse control, and then attribute several mouse settings, and even keyboards do not have to move, it completed a database application development! Of course, this is really a fast database application devel
    2022-03-01 10:31:13下载
    积分:1
  • 利用Visual Basic编写的小程序,将一款小巧的时钟放在桌面上显示时间。...
    利用Visual Basic编写的小程序,将一款小巧的时钟放在桌面上显示时间。-The use of Visual Basic procedures for the preparation of small, will be a small clock on the table to show time.
    2022-03-02 20:13:08下载
    积分:1
  • canny自适应边缘检测
    opencv2.4.9+vs2010  由于opencv里面自带的canny算子无法自适应选取阈值,必须人工给予合适的上下阈值,所以只能检测单张图像,无法检测视频流或者多张图像,本人采用大津法实现了自适应阈值的边缘检测。代码图片都齐全,只需安装好环境就可以了,效果还可以~
    2022-10-25 02:25:05下载
    积分:1
  • 网站模板20040821015610.rar
    网站模版20040821015610.rar-website template 20040821015610.rar
    2023-08-17 09:55:03下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载