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

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

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

  • 医学图像处理源代码
    一个完整的可运行的医学图像处理软件源代码, 很全面的VC++程序,都是关于医学图像方面的. 包括配准和分割等功能-Can run a complete medical image processing software source code, including features such as registration and segmentation
    2022-03-19 23:47:44下载
    积分:1
  • Term calculation of photonic crystal transmittance and reflectance as well as th...
    用语计算光子晶体的透射率和反射率以及能带结构-Term calculation of photonic crystal transmittance and reflectance as well as the energy band structure
    2023-08-20 15:45:02下载
    积分:1
  • 均匀分布序列的产生
    根据均匀分布的产生原理和公式,求出均分分布的序列,该序列为0-1内的随机数
    2023-05-30 13:30:03下载
    积分:1
  • Numerical calculation, using newton iteration method chord intercept method to c...
    数值计算,利用newton迭代法和弦截法计算插值多项式-Numerical calculation, using newton iteration method chord intercept method to calculate the interpolation polynomial
    2022-02-04 23:52:26下载
    积分:1
  • 竞选
    原创优化算法,类似于粒子群算法,收敛速度快,适用于前段近似解的求解,可以与牛顿法结合两段求解优化问题。 只完成算法本身程序,与其他算法的对比未完成。
    2022-03-10 10:29:01下载
    积分:1
  • JAVA数据结构之HASH编码的小应用程序
    JAVA数据结构之HASH编码的小应用程序-Java data structures hash coding of small applications
    2022-06-01 18:16:24下载
    积分:1
  • fortran程序,迭代常微分方程求解器,包括源代码、使用说明。...
    fortran程序,迭代常微分方程求解器,包括源代码、使用说明。-fortran program, iterative solver of ordinary differential equations, including source code, use the instructions.
    2022-01-25 14:54:41下载
    积分:1
  • 灰度
    Gray Scale Image 或是Grey Scale Image,又称灰阶图。把白色与黑色之间按对数关系分为若干等级,称为灰度。灰度分为256阶。用灰度表示的图像称作灰度图。除了常见的卫星图像、航空照片外,许多地球物理观测数据也以灰度表示。以位场图像为例,把位场表示为灰度图,需要将位场观测值灰度量化,即将场的变化范围转换成256阶的灰度范围。由于位场的动态变化范围非常大,磁场可达数万个纳特,重力场也可能在数百个重力单位内变化,所以在显示为图像前通常需要对位场观测值进行拉伸或压缩。[1]什么叫灰度图?任何颜色都有红、绿、蓝三原色组成,假如原来某点的颜色为RGB(R,G,B),那么,我们可以通过下面几种方法,将其转换为灰度:1.浮点算法:Gray=R*0.3+G*0.59+B*0.112.整数方法:Gray=(R*30+G*59+B*11)/1003.移位方法:Gray =(R*76+G*151+B*28)>>8;4.平均值法:Gray=(R+G+B)/3;5.仅取绿色:Gray=G;通过上述任一种方法求得Gray后,将原来的RGB(R,G,B)中的R,G,B统一用Gray替换,形成新的颜色RGB(Gray,Gray,Gray),用它替换原来的RGB(R,G,B)就是灰度图了。
    2022-01-27 13:44:07下载
    积分:1
  • 一个排序过程的演示
    一个排序过程的演示- A arrangement process demonstration
    2022-07-01 05:53:26下载
    积分:1
  • 基于SVD的人脸识别,可以直接计出识别正确率
    基于SVD的人脸识别,可以直接计算出识别正确率-SVD-based face recognition, and can directly calculate the correct rate of recognition
    2022-04-25 07:11:14下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载