登录
首页 » 算法 » 0 / 1背包问题是一个N P

0 / 1背包问题是一个N P

于 2022-02-26 发布 文件大小:8.71 kB
0 219
下载积分: 2 下载次数: 1

代码说明:

0 / 1背包问题是一个N P-复杂问题,为了解决该问题,,将用回溯算法解决该问题。既然想选择一个对象的子集,将它们装入背包,以便获得的收益最大,则解空间应组织成子集树的形状(如图1 6 - 2所示)。该回溯算法与4 . 2节的装载问题很类似。首先形成一个递归算法,去找到可获得的最大收益。然后,对该算法加以改进,形成代码。改进后的代码可找到获得最大收益时包含在背包中的对象的集合。-0/1 knapsack problem is a P-complex issues, in order to solve the problem, and will be used backtracking algorithm to solve the problem. As to the choice of a subset of object, they will load a backpack, in order to obtain the greatest profits, the solution should be organized into space subset of the shape of the tree (Figure 1 6-2 below). The backtracking algorithms and 4. Two loading problem is very similar. Forming a recursive algorithm to get the maximum benefit available. Then, this algorithm is modified to form code. Improved code can be found at the maximum benefits included in the backpack of a collection of objects.

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

发表评论

0 个回复

  • 基于后序遍历的实现
    基于后序遍历的实现-based on the realization preorder
    2023-07-13 17:20:03下载
    积分:1
  • 没有界面,用C写的小程序 问题如下:一家软件公司招聘了数十位程序员,分成若干部门。 进行一次考试,对各个部门的所有程序员进行考核。考试结束后评出了每个人的分数。...
    没有界面,用C写的小程序 问题如下:一家软件公司招聘了数十位程序员,分成若干部门。 进行一次考试,对各个部门的所有程序员进行考核。考试结束后评出了每个人的分数。现在需要知道,在每个部门内,成绩最好的程序员和成绩最差的程序员分别是谁。输入有N+1行,每一个有若干正整数。第一行只有一个正整数,代表公司的部门数目。剩余的N行,每一行代表了该部门所有程序员的得分。其中每行第一个数字k代表了该部门的程序员个数,该行剩下的有k对数据,每对数据包括一个程序员的姓名(一个字符串)和其得分(一个正整数)。【输出形式】输出有N行,每行有两个串。第一个串该部门得分最高的程序员的姓名,第二个数字是得分最低的程序员的姓名。-no interface, written in C minor procedural issues are as follows : a software company recruited dozens of programmers, divided into several departments. An examination of the various departments for testing all programmers. Examinations in 1886 after the end of each grade. Now need to know, in every sector, but the best programmers and the worst programmers who were. N input is a line, each one a number of positive integers. There is only a first positive integer representing the number of departments. The remaining N firms, each firm on behalf of all the sector"s programmers to the basket. Each Bank figures k a representative of the number of programmers, the bank left the k right d
    2022-03-10 11:37:16下载
    积分:1
  • 该程序用于产生任意均值和方差的随机数,程序中有注释
    该程序用于产生任意均值和方差的随机数,程序中有注释-The program used to generate arbitrary mean and variance of random numbers, program has Notes
    2023-03-03 22:40:04下载
    积分:1
  • 1602液晶电子钟
    应用背景可以做一个时钟,同时可以学习时钟芯片的通信和LCD1602的显示,从实用上体会单片机编程的乐趣关键技术通过使用DS1302时钟芯片保存时间,再由LCD1602显示时间
    2022-03-01 03:42:45下载
    积分:1
  • php文件上传
    php上传图片文件,多种格式,可显示是否上传成功,可以预览图片效果,直接在浏览器里输入Url,即可操作。up.phpup2.php,提供文件上传到哪个路径,可查看。
    2022-12-18 23:45:04下载
    积分:1
  • C#滤波
    C#,滤波算法,实现方法,KalmanFa, 推荐下载,共同学习,共同进步!-electronic sphygmomanometer principle, download the source, learn together and progress together!
    2022-11-11 21:45:03下载
    积分:1
  • viterbi译码,可以对卷积码进行解码。通信类的朋友知道的...
    viterbi译码算法,可以对卷积码进行解码。通信类的朋友知道的-viterbi
    2022-04-29 22:44:33下载
    积分:1
  • 伪随机发生器
    伪随机发生器用于测试图案发生器为内置自检 DIFFERENET 传输线下测试像加法器乘数或任何这些随机测试生成器将生成的测试序列,将用于电路的功能测试
    2022-06-27 00:50:25下载
    积分:1
  • adaptive dimension reduction for clustering high dimensional data
    adaptive dimension reduction for clustering high dimensional data
    2023-05-17 00:20:03下载
    积分:1
  • MIMEQP编-解码
    资源描述MIMEQP编-解码,最可惜的是已经被编译过了,但是界面全部被独立出来了的,可以自行更改,只是不能研究程序的内部结构……
    2022-06-11 23:16:02下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载