算法导论Let9-Dynamic Programming 1.ppt

  1. 1、本文档共25页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
算法导论Let9-Dynamic Programming 1

1 Simple Review Order Statistics Expected linear time selection Main idea: PARTITION Worst-case Θ(n2) Worst-case linear time selection Generate a good pivot recursively. Design and Analysis of Algorithms Dynamic Programming(Ch15) Part 1 Manufacturing Problem Assembly-Line Scheduling Two parallel assembly lines in a factory, lines 1 and 2 Each line has n stations Si,1…Si,n , i =1, 2 For each j, S1, j does the same thing as S2, j , but it may take a different amount of assembly time ai, j Transferring away from line i after stage j costs ti, j , i=1, 2 and j =1, 2, … , n-1 Also entry time ei and exit time xi at beginning and end Assembly Lines n stations on each line: S1,1…S1,n and S2,1…S2,n . ai, j : time required on line i at station j. Transferring times: ti, j . Entry and exit time: e1 , e2 , x1 , x2. Goal: Find the fastest path through the factory. (Trying all possibilities is not tractable.) Assembly Lines Properties of the optimal solution: consider the fastest way of exiting station S1,j. if j = 1, then there’s only one way, if j ≥ 2, then in order to exit station j, we must have 1. either gone through station S1,j-1, or 2. gone through station S2,j-1 and transferred to S1,j. In the first case, we must have used the fastest way of exiting S1,j-1. In the second case, we must have used the fastest way of exiting S2,j-1. Assembly Lines Key observation. An optimal solution to the problem (fastest way through S1,j) contains within it an optimal solution to subproblems (fastest way through S1,j-1 or S2,j-1). [Optimal substructure] It’s easy to write a recursive solution to the problem now. Homework 15.1-1, 15.2-1 *Software School of XiDian University *Software School of XiDian University ALS Design and Analysis of Algorithms Dynamic Programming Topics: Dynamic Programming (DP) paradigm Assembly-Line Scheduling Matrix-Chain Multiplication Optimization Problems A design technique, like divide-and-conquer. Works bottom-up rather than top-down. Useful for

文档评论(0)

xcs88858 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8130065136000003

1亿VIP精品文档

相关文档