- 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?
您可能关注的文档
最近下载
- 新探索研究生英语(基础级)读写教程课件unit2-2.pptx VIP
- ZZ058 动漫制作赛题 第3套-2024年全国职业院校技能大赛双数年拟设赛项赛题.pdf VIP
- 财务管理(山东财经大学)智慧树知到期末考试答案2024年.docx VIP
- 中国社科院社会学硕士研究生入学考试真题带答案.docx VIP
- 2025年中国铁路北京局招聘(2124人)笔试参考题库附带答案详解.pdf
- 《已知一个数的几分之几是多少,求这个数》课件.pptx VIP
- 建军大业作文课件.pptx VIP
- 医疗护理员课件.pptx VIP
- 环境管理学课件.pptx VIP
- 【原创】 2021八省联考英语读后续写方法探究.docx VIP
文档评论(0)