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

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

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

  • 分数阶统一混沌系统的离散
    分数阶统一混沌系统的离散算法-This the program for fractional order Unified system, a simple but fast method in time domain.-Fractional order unified chaotic system discrete algorithm-This the program for fractional order Unified system, a simple but fastmethod in time domain.
    2022-01-24 10:22:58下载
    积分:1
  • 基于小波变换的圆形 Hough 变换的蓄能器图像计
    此代码计算的蓄能器图像基于小波变换的圆形 Hough 变换,给定一个的半径。
    2022-01-25 18:20:14下载
    积分:1
  • 难题十五解决了使用明星C # Windows应用程序
    著名的十五难题是用A*(A星)算法解决的。这是一个用C#(C Sharp)编程语言编写的windows应用程序。
    2023-03-25 06:25:02下载
    积分:1
  • 用随机数矩阵
    应用背景#包括
    2023-06-29 19:35:04下载
    积分:1
  • 验证码识别
    #include #define W 80 //定义验证码图片的宽度 #define H 20 //定义验证码图片的宽度 #define N 2 //定义字符位数,一般是4位 #define BMP_filename "c: est.bmp" int x,y,i,s,temp; int YZM[W][H]={0}; int YZM_red[W][H]={0}; int YZM_green[W][H]={0}; int YZM_blue[W][H]={0}; int rec[W]={0}; int lf[N],rt[N],up[N],dw[N]; char result[N]; void shibie()
    2022-04-20 09:09:12下载
    积分:1
  • 51单片机蜂鸣器音乐实验(致爱丽丝)
    应用背景通过蜂鸣器演奏简单的歌曲,同时学习51单片机,从中体会编程的乐趣。关键技术用无源蜂鸣器来发生,通过不同频率的导通发出不同音色
    2022-06-20 21:53:39下载
    积分:1
  • 中的根据给出的一组数值(x,y)构造出相应的方程
    计算方法中的根据给出的一组数值(x,y)构造出相应的方程-Calculation method is based on a set of values given by (x, y) constructed the corresponding equation
    2022-08-06 18:34:51下载
    积分:1
  • 求解三波耦合方程
    向后差分,一阶,200个点,Z的范围[0 , 20],运行了50s。。。 各常数参数取值如下: VS = 2  ;VI = 2 ; VP = 2 ; K = 2(这个代表的是j*delt*k) ; J = 2 ; L = 20 ; 请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报
    2022-09-10 00:50:02下载
    积分:1
  • 猜数字游戏
    简单的控制台下的猜数字游戏,适合初学编程的人学习一下基本编程和基本算法,游戏规则为随机生成一个数待猜,0~9可重复,共最多五次机会,每次猜后会给出每一位的对错信息,如果该位数字猜对则显示o,数字对但位置不对则为^,没有这个数字则为x,程序循环执行,直至关闭退出,VC6.0,WIN7下编译通过
    2023-05-05 13:30:02下载
    积分:1
  • 最短路径语言源代码实现的若干计划
    多段图的最短路径 c语言实现源代码 可以运行-A number of plans the shortest path c language source code implementation
    2022-05-08 18:49:56下载
    积分:1
  • 696518资源总数
  • 106235会员总数
  • 12今日下载