- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
山东大学算法分析与设计重点
p o s r u t y v w z n q n q p o s r u t y v w z 4 3 1 1 1 1 0 0 There are 4 distinct paths from p to v. Another example a b c d e f g h i j k l m a b c d e f g h i j k l m 16 8 8 4+4 4 4 2+2 2 1+1 2 1 1 1 There are 16 distinct paths from a to m. Another example a b c d e f g h i j k l m a b c d e f g h i j k l m 16 8 8 4+4 4 4 2+2 2 1+1 2 1 1 1 There are 16 distinct paths from a to m. 22.4-3 Given an algorithm that determines whether or not a given undirected graph G=(V,E) contains a cycle. O(V), independent of |E|. DFS, stops whenever encounters an back edge. 22.4-5 Note: 首先要计算每个点的入度。O(V+E) 当删一个点时,其邻接点的入度要减1。 O(V+E) 记录入度为0的点. 22.4-5 Proof of Correctness Induction on |V|. |V|=2, only one edge, trivial. Suppose it is true for |V|n. When |V|=n. Select a vertex s of in-degree zero.(must exist. Otherwise, all vertices have non-zero in-degrees. Start from a vertex and backtrack along in-edges. Since V is limited, the procedure must end at an in-edge which leaves a vertex already encountered, thus implies a cycle ). According to our algorithm, s will be at the most left of the list L. And the other part L’ of the list is exactly the list of the graph G’ obtained by deleting s and the edges leaving it. By induction hypothesis, all edges in G’ pointing from left to right in the list L’(thus also in L). Considering that all edges in G are either those in G’ or those leaving s, we completes the proof. for any (u,v)?E, the in-degree of v can not be zero before deleting u, which implies u appears in front of v. Dijkstra’s Algorithm Problem solved Correctness Time complexity Similarities to BFS and PRIM Problem Solved by Dijkstra’s Single-source shortest-paths problem Edge weight =0 Input: A graph G=(V, E) and a source s, and a nonnegative function w: E?R+ Output: For each vertex v, shortest path weight d(s,v), and a shortest path if exists. The Dijkstra Algorithm DIJKSTRA(G,w,s) Initialize-Single-Source(G,s) S?? Q?V[G] while Q?? do u?EXTRACT-MIN(Q) S?S?
您可能关注的文档
最近下载
- 内部调动审批表(模板) .pdf VIP
- 《职工非因工伤残或因病丧失劳动能力程度鉴定标准(试行)》.doc VIP
- 民宿项目建设可行性研究报告.docx VIP
- IEC 61133-2006 车辆组装和运行前的整车试验规范(中文).docx VIP
- 部编人教版七年级历史上册第19课《北魏政治和北方民族大交融》说课课件(共24张).ppt VIP
- 2025年儿童青少年近视防控白皮书.pdf VIP
- 2024年执业助理医师(临床)考试备考重点题库(600题版).doc VIP
- 2023年口腔助理医师考试备考重点题库(600题版).docx VIP
- 临床研究答辩.pptx VIP
- 西门子S7-200 SMART PLC应用技术图解项目教程全册教案.docx VIP
文档评论(0)