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

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

于 2022-02-26 发布 文件大小:8.71 kB
0 221
下载积分: 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 个回复

  • 一个方便的求积分的类
    一个方便的求积分的类-a convenient points for the category
    2022-04-08 11:00:35下载
    积分:1
  • 根据TI血氧所改进的血氧代码
    1使用stm32f051最为主控,次代码在模拟期中测试过,缺点为数据不是很稳定,不过有待改进                                                                                                                                                                                                                                 
    2022-05-13 15:55:12下载
    积分:1
  • OpenCV Skin Detector with C#
    2023-04-07 02:15:03下载
    积分:1
  • 正整数x 的约数是能整除x 的正整数。正整数x 的约数个数记为div(x)。例如,1,2,5,10 都是正整数10 的约数,且div(10)=4。设a 和b 是...
    正整数x 的约数是能整除x 的正整数。正整数x 的约数个数记为div(x)。例如,1,2,5,10 都是正整数10 的约数,且div(10)=4。设a 和b 是2 个正整数,a≤b,找出a 和b之间约数个数最多的数x。 对于给定的2 个正整数a≤b,编程计算a 和b 之间约数个数最多的数。 数据输入 输入数据由文件名为input.txt的文本文件提供。文件的第1 行有2 个正整数a和b。 结果输出 程序运行结束时,若找到的a 和b 之间约数个数最多的数是x,将div(x)输出到文件output.txt中。 输入文件示例 输出文件示例 input.txt output.txt 1 36 9 -Positive integer x can be about a few of the positive integer x divisible. Positive integer x the approximate number recorded as the number of div (x). For example, 1,2,5,10 are about 10 positive integer number, and div (10) = 4. Set a and b are two positive integers, a ≤ b, to find a and b between about a few number of the largest number of x. For a given two positive integers a ≤ b, Programming calculated a and b between about a few number of the largest number. Data entry input data from the document text file named input.txt provide. File line 1 has two positive integers a and b. The results run the end of the output, if found between a and b of about a few number o
    2023-04-13 05:20:03下载
    积分:1
  • HUI EGO ZNAET 40
    HUI EGO ZNAET 40-HUI EGO ZNAET 40!!!!!!!!!!!!
    2022-01-24 16:01:21下载
    积分:1
  • 牛顿向前插值,完全自己编的,可以在X表的范围内任意输入一个值,代码挺好的...
    牛顿向前插值法,完全自己编的,可以在X表的范围内任意输入一个值,代码挺好的-Newton forward interpolation method, fully developed, the X within the context of an arbitrary input value, the code is very good
    2022-04-28 22:20:33下载
    积分:1
  • LU分解,数值分析最基本的!
    LU分解法,数值分析最基本的!-LU decomposition, the most basic numerical analysis!
    2022-01-26 02:32:30下载
    积分:1
  • 离散正弦变换程序
    离散正弦变换程序-discrete sine transform procedures
    2023-09-03 14:40:03下载
    积分:1
  • 各种排序小结
    各种排序算法小结-various sorting algorithm Summary
    2022-02-20 17:17:33下载
    积分:1
  • Vba make .exe file
    2022-05-22 01:32:15下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载