- 1、本文档共67页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Prof. Amr Goneid, AUC * (d) Complexity Analysis Skeletal Algorithm: for j = 1 to n-1 do { // sub-tree has j+1 nodes for i = 1 to n-j do { // for each of the n-j sub-tree combinations for k = i to i+j do { find cost of each of the j+1 configurations and determine minimum cost } } } T(n) = ?1? j ? n-1 ( j + 1) (n – j) = O(n3) , S(n) = O(n2) Prof. Amr Goneid, AUC * Exercise Find the optimal binary search tree for the following words with the associated frequencies: a (18) , and (22) , I (19) , it (20) , or (21) Answer: Min cost = 20 + 2*43 + 3*37 = 217 it or and I a 20 22 21 18 19 Prof. Amr Goneid, AUC * 9. Dynamic Programming Algorithms for Graph Problems Various optimization graph problems have been solved using Dynamic Programming algorithms. Examples are: Dijkstras algorithm solves the single-source shortest path problem for a graph with nonnegative edge path costs Floyd–Warshall algorithm for finding all pairs shortest paths in a weighted graph (with positive or negative edge weights) and also for finding transitive closure The Bellman–Ford algorithm computes single-source shortest paths in a weighted digraph for graphs with negative edge weights. These will be discussed later under “Graph Algorithms”. Prof. Amr Goneid, AUC * 10. Comparison with Greedy and Divide Conquer Methods Greedy vs. DP : Both are optimization techniques, building solutions from a collection of choices of individual elements. The greedy method computes its solution by making its choices in a serial forward fashion, never looking back or revising previous choices. DP computes its solution bottom up by synthesizing them from smaller subsolutions, and by trying many possibilities and choices before it arrives at the optimal set of choices. There is no a priori test by which one can tell if the Greedy method will lead to an optimal solution. By contrast, ther
您可能关注的文档
- Dokumentation der individuellen 个人文件 Gymnasium .ppt
- Domain Name System Computer Science at RPI域名系统在RPI计算机科学.ppt
- Domains of Learning EdPsyc Interactive域的学习edpsyc互动.ppt
- DISP2003 Introduction to Digital Signal Processingdisp2003介绍数字信号处理.ppt
- Doing Business in China Texas Association of 在中国做生意德克萨斯协会.ppt
- DON'T WORRY, BE HAPPY musicbulletinboards别担心要快乐 musicbulletinboards.net.ppt
- DOMESTIC ANIMALS bglog国内动物bglog.net.ppt
- Donation Championship Teams The Physician Champion捐赠冠军队的医生冠军.ppt
- Dollar General Balloon Program Balloons美元通用气球计划气球 .ppt
- Don‘t worry be happy Amazon Web Services不要担心快乐亚马逊网络服务.ppt
- Dynamic Programming CSL Wiki动态规划 CSL维基.ppt
- Dynamic Sample Selection for Approximate Query Processing近似查询处理的动态样本选择.ppt
- Dynamic Random Graph modeling and applications in 动态随机图模型及其应用.ppt
- Dynamic Sensor Networks动态传感器网络.ppt
- Dynamic System Model for Ventricular Cardiac 心室心脏动态系统模型.ppt
- Dynamic Systems Development MethodDSDM动态系统开发方法DSDM.pptx
- Dynamic Taint Analysis for Automatic Detection, Analysis, and分析自动检测动态污点分析和.pptx
- Dynamic Vibration Absorber for Suppression of 动力减振器.ppt
- Dynamic Topic Analysis of Synchronous Chat vw同步聊天大众的动态话题分析.indiana.ppt
- Dynamic Systems Approach kin动态系统方法亲属.sjsu.ppt
文档评论(0)