登录
首页 » 算法 » 贪心算法解决部分背包问题

贪心算法解决部分背包问题

于 2022-01-30 发布 文件大小:1.01 kB
0 266
下载积分: 2 下载次数: 1

代码说明:

本程序研究了贪心算法,并把此算法用于部分背包问题上,基于C语言实现,达到最优解。所谓贪心算法是指,在对问题求解时,总是做出在当前看来是最好的选择。也就是说,不从整体最优上加以考虑,所做出的仅是在某种意义上的局部最优解。贪心算法不是对所有问题都能得到整体最优解,但对范围相当广泛的许多问题他能产生整体最优解或者是整体最优解的近似解。部分背包问题:     给定一个最大载重量为M的卡车和N种食品,有食盐,白糖,大米等。已知第 i 种食品的最多拥有Wi 公斤,其商品价值为Vi元/公斤,编程确定一个装货方案,使得装入卡车中的所有物品总价值最大。

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

发表评论

0 个回复

  • 对称对称计的矩阵特征值与特征向量…
    矩阵特征值和特征向量的计算关于对称矩阵的对称对角矩阵的何氏黑米荣变换它的对称三对角矩阵的所有特征值,特征向量的计算
    2022-08-15 11:09:50下载
    积分:1
  • 用opencv实现的图像直方图均衡化处理
    用opencv实现的图像直方图均衡化处理,用HistogramStat函数统计图像中三个通道中的像素总数,用Histogram函数对其进行直方图均衡化处理
    2022-03-16 01:49:04下载
    积分:1
  • 模运MOD的相关运
    用于密码学最最基本的模运算中,或者是说信息安全数学基础中的相关运算。 不仅仅有代码,还有相关的PDF文档的说明,希望能对密码学的初学者有帮助。
    2022-04-14 22:59:32下载
    积分:1
  • 是自己在ECPLISE下做的一个简单的排序程序,有兴趣的可以看下....
    是自己在ECPLISE下做的一个简单的排序程序,有兴趣的可以看下.-in ECPLISE is done with the sort of a simple procedure that can be interested in a glance.
    2023-01-09 01:50:04下载
    积分:1
  • 一个简单的基于VC6.0的印刷体数字识别系统
    一个简单的基于VC6.0的印刷体数字识别系统,可以简单的识别宋体的印刷体数字,实现二值化,灰度化,锐角梯度化,字符分割,数字图片的归一化等功能
    2023-05-07 08:05:03下载
    积分:1
  • Molgedey和舒斯特去相关,具有方形混合矩阵A。
    The Molgedey and Schuster decorrelation algorithm, having square mixing matrix and no noise . Truncation is used for the time shifted matrix, and it is forced to be symmetric . The delay Tau is estimated . The number of independent components are calculated using Bayes Information Criterion (BIC), with PCA for dimension reduction.-The Molgedey and Schuster decorrelation algorithm, having square mixing matrix and no noise . Truncation is used for the time shifted matrix, and it is forced to be symmetric . The delay Tau is estimated . The number of independent components are calculated using Bayes Information Criterion (BIC), with PCA for dimension reduction.
    2022-03-17 02:59:15下载
    积分:1
  • rapid sequencing and Bubble Sort
    快速排序和冒泡排序-rapid sequencing and Bubble Sort
    2022-03-15 05:40:33下载
    积分:1
  • 飞思卡尔智能车电磁组例程
    飞思卡尔全国智能车竞赛电磁组例程,适应于四轮电磁车,开发环境是IAR,注意例程中电机驱动部分有两个,一个单极性H桥一个双极性H桥
    2022-07-18 14:34:00下载
    积分:1
  • 链表数组堆栈
    用于链表数组堆栈课程设计,作为一个模板以供使用。调试结果显示符合要求。
    2023-03-21 07:10:03下载
    积分:1
  • DTMF(Dual Tone Multi Frequency)Recognition Algorithm
           Dual Tone Multi Frequencies (DTMF tones) are two different tones at two ends of a spectrum that are used to send information in telephonic communication mediums. The tones represent numbers 0-9 and the symbols * and #. A series of these numbers may be assigned to individuals as points of contact, as in a phone number, or the numbers can be used to relay other sorts of information.       While it may seem confusing, it should be noted that all numbers on a telephone are assigned two DTMF tones, and in all, seven different frequencies are assigned. Some numbers will have the same lower frequency, but different higher frequency, while others will have the same higher frequency but a different lower frequency. The range is between 697 Hz and 941 Hz for the lower frequencies and 1209 Hz and 1633 Hz for
    2022-06-16 09:51:22下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载