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

1背包问题是NP难题。0

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

  • 在分析程序超市购物车,购物…
    是一个关于超市的购物篮分析的程序,里面有购物篮模型-Is a supermarket shopping cart on the analysis of the procedure, which has shopping basket model
    2022-01-24 17:29:32下载
    积分:1
  • 我真的喜欢Windows编程直到Windows95来。我曾经憎恨…
    当Windows95推出后,我才真正开始喜欢Windows编程。我一直痛恨使用Windows1.0、2.0、3.0和3.1来编程,尽管随着每一种版本的推出,这种憎恨都越来越少。当Windows95出现时,它彻底改变了我的思想,如同其他被征服的人的感觉一样――它看上去非常酷!那正是我所需要的。-I was truly loving windows programming until Windows95 come. I had being hating using Windows1.0,Windows2.0,Windows3.0 , Windows3.1 and etc. although the strength of hating was becoming little and little.It changed my idea from the bottom when windows come on,Just as the others feelings that it looks so cool and also i needed.
    2023-01-09 19:50:04下载
    积分:1
  • 这是一款网吧检控系统,用VB软件编写,用于监控对方计算机,是一个非常好用的软件。...
    这是一款网吧检控系统,用VB软件编写,用于监控对方计算机,是一个非常好用的软件。-This is a prosecution of Internet systems, software development, using VB to monitor each other" s computers, is a very useful software.
    2022-01-25 22:04:47下载
    积分:1
  • 这是一个打字计时练习的程序,在缓冲区中预放了一些字母,运行时,可按照屏幕上 显示的字母输入练习,每输入完一行按回车键后,可显示出练习输入的时间....
    这是一个打字计时练习的程序,在缓冲区中预放了一些字母,运行时,可按照屏幕上 显示的字母输入练习,每输入完一行按回车键后,可显示出练习输入的时间.-This a time to practice typing procedures, the pre-release buffer some letters, operation, in accordance with the screen displayed on the alphanumeric input practice every imported End his press the Enter key, will show that the importation of practice time.
    2022-03-04 14:30:40下载
    积分:1
  • 一个简单的不用Ajax控件实现ajax调用的小程序
    一个简单的不用Ajax控件实现ajax调用的小程序-A sample demo can execute ajax function without ajax component
    2023-06-16 23:45:04下载
    积分:1
  • 模仿WINDOWS自带的计算写的,科学型有部分功能还没实现
    模仿WINDOWS自带的计算写的,科学型有部分功能还没实现-WINDOWS imitate the calculation of own writing, science-type has some features not yet realize
    2022-02-16 05:23:48下载
    积分:1
  • 利用ODBC创建EXCEL文件,可以很方便的实现ODBC创建Excel文件。
    利用ODBC创建EXCEL文件,可以很方便的实现ODBC创建Excel文件。-Using ODBC to create EXCEL files, you can easily achieve the ODBC to create Excel file.
    2023-06-20 22:05:03下载
    积分:1
  • 学习MFC字体的代码。
    学习MFC字体的代码。-learning MFC font code.
    2022-01-25 16:27:41下载
    积分:1
  • um=5.elmo
    /*The program sets an arrays  of positions and speeds.On the digital input #6 trigger, the program moves forward, waits one second and returns.The destination and speed of the motion are defined according to the values in the speed and position arrays, with an index set by digital inputs #1 through #5.When an error occurs, the program stops and digital output #1 is raised.The motions are executed by functions called by the main program.Errors are detected in the motion functions and returned to the main program.*///Global Variable declarationint Destination[32];int MotionSpeed[32];int MaxDest;int MaxSpeed;//Functions declarationfunction int Err = MoveForward(int MoveIndex); function int Err = MoveBack(int MoveIndex);//Program##PROGRAM1//Local variables declarationint i;float Coeff;//Program bod
    2022-06-16 23:30:26下载
    积分:1
  • Read and Write Registry Keys and Values
    Read and Write Registry Keys and Values-windows ce
    2022-08-17 02:14:59下载
    积分:1
  • 696516资源总数
  • 106425会员总数
  • 12今日下载