登录
首页 » 算法 » 01背包问题

01背包问题

于 2022-03-15 发布 文件大小:255.10 kB
0 191
下载积分: 2 下载次数: 1

代码说明:

01背包是在M件物品取出若干件放在空间为W的背包里,每件物品的体积为W1,W2……Wn,与之相对应的价值为P1,P2……Pn。考虑用动态规划的方法来解决,这里的:阶段是:在前N件物品中,选取若干件物品放入背包中; 状态是:在前N件物品中,选取若干件物品放入所剩空间为W的背包中的所能获得的最大价值;决策是:第N件物品放或者不放; 由此可以写出动态转移方程:我们用f[i,j]表示在前 i 件物品中选择若干件放在所剩空间为 j 的背包里所能获得的最大价值f[i, j] = max( f[i-1, j-Wi] + Pi (j >= Wi), f[i-1, j] )

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

发表评论

0 个回复

  • 通过奇异值分解的最小二乘拟合
    通过奇异值分解实现的最小二乘拟合算法 inear least-squares fit by singular value decomposition-through the singular value decomposition of the least squares fitting algorithm inear least-squares fit by singular value decomposition
    2022-04-20 14:07:19下载
    积分:1
  • 机械优化设计的C程序,黄金分割,解决一维优化问题
    机械优化设计的C程序,黄金分割法,解决一维优化问题-Optimal Design of C mechanical procedures, golden section method to solve one-dimensional optimization problem
    2022-02-12 19:32:17下载
    积分:1
  • ansoft电机分析的入门例子
    应用背景ansoft电机分析的入门例子 ,适用于电机仿真电磁磁路设计,,,,,关键技术有限元磁路仿真很设计,很有参考价值
    2022-01-31 02:16:52下载
    积分:1
  • Data Mining the classical k
    数据挖掘经典k-means算法C源码实现-Data Mining the classical k-means algorithm C source code to achieve
    2022-04-20 17:28:52下载
    积分:1
  • 在 java 中使用 GMM 的语音情感识别
    这项工作已开发一个应用程序估计使用的传感器的人类行为的主要目的。基于监测的它做为智能手机用户提供适当的反馈。
    2022-05-12 19:36:01下载
    积分:1
  • Labview编写的中值滤波程序,可用数据数字处理。
    Labview编写的中值滤波程序,可用数据数字处理。-Written in Labview median filter process, available data digital processing.
    2022-05-23 03:51:04下载
    积分:1
  • 龙贝格数值积分
    龙贝格数值积分法- Dragon Begg numerical integration
    2022-04-19 18:04:33下载
    积分:1
  • Delaunay三角剖分
    根据离散点,生成三角网,实现了三角剖分,可用于泰森多边形的构建及面状图形骨架线的提取
    2022-01-25 23:01:14下载
    积分:1
  • 太阳辐射计
    计算太阳辐射的程序:(1)计算太阳在水平面上的瞬时辐照度和平均辐照度;(2)计算太阳在倾斜面上的瞬时辐照度和平均辐照度;(3)计算太阳的赤纬角、高度角、时角等。很有帮助作用。
    2022-06-20 17:42:11下载
    积分:1
  • 3D螺旋上升效果
    /**************************************************************************** This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2022-05-13 07:02:29下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载