- 1、本文档共36页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
算法导论Let10-Greedy Algorithms
Design and Analysis of AlgorithmsGreedy Algorithms (Ch16) Simple Review LCS Max Sum b[j]=max( b[j-1]+a[j], a[j] ), 1=j=n. Examples of Greedy Algorithms Scheduling Activity Selection (Chap 16.1) Minimizing time in system Deadline scheduling (Chap 16.5) Graph Algorithms Minimum Spanning Trees (Chap 23) Dijkstra’s (shortest path) Algorithm (Chap 24.3) Other Heuristics Huffman coding (Chap 16.3) Coloring a graph Traveling Salesman Problem(Chap 35.2) Set-covering (Chap 35.3) Subset-sum problem (Chap 35.5) Greedy Method For many optimization problem, Dynamic Programming is overkill. A greedy algorithm always make the choice that looks best at every step. That is, it makes local optimal solution in the hope that this choice will lead to a globally optimal one. I make the shortest path to the target at each step. Sometime I win, sometime I lose. Activity-Selection Problem Problem: Given a set A = {a1, a2, …, an} of n activities with start and finish times (si, fi), 1 ≤ i ≤ n, select maximal set S of “non-overlapping” activities. One can think of the problem as corresponding to scheduling the maximal number of classes (given their start and finish times) in one classroom. Solution: Sort activities by finish times (let a1, a2 , …, an denote sorted sequence) Pick first activity a1 Remove all activities with start time before finish time of a1 Recursively solve problem on remaining activities. Activity Selection Here is the problem from the book: Activity a1 starts at s1 = 1, finishes at f1 = 4. Activity a2 starts at s2 = 3, finishes at f2 = 5. Activity a3 starts at s3 = 0, finishes at f3 = 6 ... Got the idea? The set S is sorted in monotonically increasing order of finish time.The subsets of {a3, a9, a11} and {a1, a4, a8 , a11}are mutually compatible. Activity Selection Activity Selection Objective: to create a set of maximum activities ai that are compatible. Modeling the subproblems: Create a set of activities that can start after ai finishes, and finish before activ
您可能关注的文档
- How much are these socks 课件A.ppt
- 大学本科vfp,ppt课件6.ppt
- 第9课 修改零件模型.ppt
- 高中英语:Unit 10《Money》测试(北师大版必修4).doc
- 第二章:Silverlight编程模型.ppt
- 汉洛塔的实现-数据结构.doc
- iTELLIN巡检报告模板.doc
- 初二下期末三大版本Top 10考点---秦秀玲.doc
- TOP TEN讲解.ppt
- 中国大陆美国留学最强中学TOP50榜-2015.docx
- 《绘本阅读在小学英语写作教学中的关键作用研究》教学研究课题报告.docx
- 人工智能辅助下的初中数学教学区域协同创新实践研究教学研究课题报告.docx
- 人工智能助力高中化学实验报告的撰写:以《化学反应原理》为例教学研究课题报告.docx
- 初中物理探究:校园景观力学现象与实验探究教学研究教学研究课题报告.docx
- 高中政治议题中心教学法在历史学科知识迁移中的应用与效果评价教学研究课题报告.docx
- 2025裁判员高频难、易错点题完整附答案详解.docx
- 2025裁判员高频难、易错点题含答案详解(实用).docx
- 2025裁判员高频难、易错点题含答案详解【最新】.docx
- 长征主题班会课件小学.pptx
- 基于生成式AI的初中物理问题解决合作学习策略分析教学研究课题报告.docx
文档评论(0)