- 1、本文档共19页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
详解0-1背包问题(Detailed 0-1 knapsack problem)
详解0-1背包问题(Detailed 0-1 knapsack problem)
0-1 knapsack problem can be regarded as looking for a sequence, the judgment of any variable is decided =1 or =0., after the judgment has been determined, and in the judgment, there will be two kinds of situations:
(1) backpack capacity is not enough to load items I, then =0, backpack value does not increase;
(2) the capacity of the backpack can hold items, I, =1, backpack value increases.
In these two cases, the maximum value of the overall value of the backpack should be the value of the judgment. Order the total value of an item that represents a backpack of capacity J in the first I items, then the following dynamic programming function can be obtained:
Type (1): I in front of a capacity of 0 items into a backpack and put 0 items into a capacity of J backpack, the value was 0. (2) first equation: if the first I items larger than the weight of the backpack capacity, the maximum value is loaded into the I items get the maximum value and the loaded I-1 items will be the same, or I cannot load the backpack; second equations: if the I goods weight is less than the capacity of backpack, then there will be two situations: (1) if the first I items into the backpack, backpack items are the value is equal to the first I-1 items into a capacity backpack and the value of the I value of the goods; (2) if the I items not loaded backpack, backpack is the value of the goods is equal to the first I-1 items into a capacity of J Backpack The value gained in. Obviously, the larger of the two is the optimal solution in the backpack that loads the first I items into a capacity J.
We can work out our solution step by step. The first step, only in the first article, determined in all cases backpack can get maximum value; the second step, only in the first two items, to determine the maximum value in each case the backpack can get; once on the n step we need to get the optimal solution. Finally, the maximum value gained when loading n items in a
您可能关注的文档
- 文学的精神价值(Spiritual value of literature).doc
- 文学诗词与流行歌曲的联姻(The marriage of literature, poetry and popular songs).doc
- 文学选读(Selected readings in literature).doc
- 文昌(God of Literature).doc
- 文山的历史资料(History of Wenshan).doc
- 文心神思观与神话思维的契合 ·中国民族文学网(The concept of spiritual and mythical thinking cultural integration and China Ethnic Literature Network).doc
- 文明4&5全攻略(Civilization 4&5 Raiders).doc
- 文化经营管理者在演艺界应如何作为(What should the cultural management do in the performing arts).doc
- 文明单位工作汇报材料(Reporting materials for civilized units).doc
- 文明好少年(A civilized young man).doc
- 详解Android系统SD卡各类文件夹名称(Detailed Android system SD card various folder name).doc
- 详解如何实现Oracle修改用户权限和角色(Explain how to implement Oracle to modify user permissions and roles).doc
- 详解电源基本工作原理(Explain the basic working principle of power supply).doc
- 语序+否定(Word order + negation).doc
- 详解Linux中Load average负载(详解Linux中平均负载负载).doc
- 语文四年级下册(S版)第四单元(The fourth grade language book (S version) fourth unit).doc
- 语义模型(semantic model).doc
- 语文-附录1(Language - Appendix 1).doc
- 语文填空题(Chinese cloze).doc
- 语义在次范畴确定中的自足价值(The self-sufficiency value of semantics in categorical determination).doc
文档评论(0)