- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
详解0-1背包问题(Detail 0-1 knapsack problem)
详解0-1背包问题(Detail 0-1 knapsack problem)
The 0-1 knapsack problem can be seen as looking for a sequence. The judgment of any variable is decided whether to be equal to 1 or = 0. After the judgment is completed, there are two situations in the judgment:
(1) the backpack capacity is not sufficient to load the item I, then = 0, the value of the pack does not increase;
(2) the capacity of a backpack can be loaded with an item I, which is equal to 1, and the value of the backpack increases.
The largest of the total value of the backpack in both cases should be the value of the judgment. The total value of the items that can be loaded into j in the previous I item can be obtained as follows:
Type (1) description: put in front of a goods loading capacity of 0 backpacks and loading capacity of j to zero items backpack, the value is 0. Type (2) the first formula: if the ith a item is greater than the weight of the backpack capacity and, in the case of a item I get maximum value and the load of the first I - 1 item to get the maximum value is the same, namely items I cannot load in the backpack; Second formula: if the ith a item weight less than the capacity of a backpack, then there will be two things: (1) if the items into the backpack, I will pack the items value is equal to the former I - 1 item in the load capacity of the knapsack value plus the value of the ith a items; (2) if the ith item does not load into a backpack, the value of the item in the backpack is equal to the value of the previous i-1 item loaded into the bag of j. Obviously, the best solution in the bag of the former I was to be loaded into j.
We can solve it step by step. The first step is to load the first item only and determine the maximum value of the backpack in all circumstances. Step 2: only load the first two items and determine the maximum value of a backpack in various situations. So once we go to the NTH step, we get the optimal solution that we need. Finally, the maximum value of loading n obje
您可能关注的文档
- 耐磨地坪(Wear-resisting flooring).doc
- 耳机的保养(Headphone maintenance).doc
- 耳机维修技巧和方法(Headset maintenance tips and methods).doc
- 聊城电厂600MW机组凝结水泵变频改造后的控制(The control of the conversion of the condensate pump of 600MW condensate pump in liaocheng power plant).doc
- 联想猜词题目大全(Associative guess word title).doc
- 联通卡上网设置(Connect the Internet setting of unicom card).doc
- 聚丙烯PP改性料的收缩率(Shrinkage rate of polypropylene PP modified material).doc
- 聚丙烯酰胺絮凝剂用途(Application of polyacrylamide flocculant).doc
- 聚合氯化铝铁的创新与技术(The innovation and technology of aluminum chloride iron).doc
- 聚丙烯酰胺pam絮凝剂用途(Application of polyacrylamide PAM flocculant).doc
- 语文古诗(Chinese classical poetry).doc
- 说唱发展史(History of rap).doc
- 说明书文字(Instruction word).doc
- 说明书范文(specifications).doc
- 读成语 猜字谜(Reading idioms and guessing puzzles).doc
- 课 题平面向量的数量积及运算律(Topic the volume and operation of the plane vector).doc
- 课后思考题(Think after class).doc
- 课程名称 复变函数论 课程代码02011(理论)(Class name complex function theory course code 02011 (theory)).doc
- 调产项目(The production project).doc
- 调和调式(Harmonic mode.).doc
文档评论(0)