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

1背包问题是NP难题。0

于 2022-03-25 发布 文件大小:17.38 kB
0 165
下载积分: 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 个回复

  • 树形控件项目
    treelist control project
    2022-11-11 04:10:03下载
    积分:1
  • VC select number
    vc实现的只能选数问题,优于贪婪选择算法-VC select number
    2023-04-06 04:05:04下载
    积分:1
  • 消息循环重载实例:doevents,基于c++语言编写而成的,欢迎去下载下载...
    消息循环重载实例:doevents,基于c++语言编写而成的,欢迎去下载下载-Examples of heavy news cycle: doevents, based on c++ language has been prepared by, and welcome to download to download! !
    2022-04-08 18:02:17下载
    积分:1
  • Application_BeforeBuildStart()一个Visual Studio预定义的事件处理器,代码位于一个宏文件中,当你选择“Tools Mac...
    Application_BeforeBuildStart()一个Visual Studio预定义的事件处理器,代码位于一个宏文件中,当你选择“Tools Macro”菜单项时,你看不到它,所以你需要在文件中至少包含一个dummy宏来访问源代码。-Application_BeforeBuildStart () Visual Studio a predefined event processor, code-hong in a document, when you choose "Tools Macro" menu item, you can not see it, so you need to in the document include at least one dummy Acer to visit the source code.
    2022-02-04 13:39:17下载
    积分:1
  • 使用C++语言编写的家谱管理程序,实现了家谱建立,成员查询,成员添加等功能。...
    使用C++语言编写的家谱管理程序,实现了家谱建立,成员查询,成员添加等功能。-family tree
    2023-08-04 22:30:03下载
    积分:1
  • 在 C# 中读取 GPS 装置
    这篇文章将描述一个非常简单的方法,致力于与在 C# 应用程序的上下文内的 GPS 设备。这篇文章不能解决 GPS 设备的工作原理,或可以从大多数 GPS 设备 ; 输出的 NEMA 0183 字符串从搜集到的一切相反,这篇文章是为那些从 GPS 获得现在的位置和使用那点做某事有趣像秀你你在哪里,在地图上只是兴趣。任何外来的或昂贵用于这一项目 ;GPS 源是提供由我 Garmin 过程传说手持 GPS 为 100.00 元 (一个漂亮的小 GPS 但不是高的结束,以确保) 购买。因为我的笔记本电脑提供没有男性的串行端口,以便将该设备连接我需要适配器 ;为此,我选择购买贝尔金串行端口到 USB 适配器 (F5U109) 效果很好 ;用来将设备连接到计算机的电缆是随设备提供的。图 1: 从 GPS 获得目前的工作岗位。让事情比只输出现在的位置更有趣的是,我提供了手段来映射点直接到谷歌地图使用接受在填充当前的经度和纬度的设备该网站上的查询字符串。我已经发布了些类似 C# 角上的一段时间了,但没有 GPS 界面提供。够有趣的是 (但并不惊讶),如果你比较目前的设备状况,与物理地址时在谷歌地图上绘制在地图上所示,您将可能注意到,全球定位系统定位也更加准确的地理编码的物理地址。注意: 要从 GPS 设备检索目前的工作岗位,就必须要配置的设备输出的 NEMA 0183 投诉字符串。请参阅您的所有者手册,以确定如何设置与您可能使
    2022-03-26 15:31:14下载
    积分:1
  • 331 classic games, including the original code and the implementation document g...
    经典的五子棋游戏,包含原代码和生成的执行文件,如有需要可以自己修改!-331 classic games, including the original code and the implementation document generation, can, if necessary, revise their own!
    2023-03-13 03:50:03下载
    积分:1
  • Componete util para la edicion de todo tipo de texto, es un poderoso strings
    Componete util para la edicion de todo tipo de texto, es un poderoso strings
    2023-03-27 23:15:03下载
    积分:1
  • Design using LabVIEW virtual mouse, has a certain reference value
    采用labview设计的虚拟鼠标,有一定参考价值-Design using LabVIEW virtual mouse, has a certain reference value
    2022-03-31 05:07:25下载
    积分:1
  • ORACLE data migration and data management tool, PowerBuilder, Oracle can all the...
    ORACLE数据的移植和数据管理工具,PowerBuild环境,可以把Oracle的数据全部导出为可运行的标准SQL文本-ORACLE data migration and data management tool, PowerBuilder, Oracle can all the data can be exported to standard SQL running text
    2022-06-26 15:19:58下载
    积分:1
  • 696516资源总数
  • 106658会员总数
  • 16今日下载