- 1
- 0
- 约8.63千字
- 约 30页
- 2016-12-06 发布于江苏
- 举报
Graph TheoryChapter 4 Paths and Distance in Graphs 大葉大學 資訊工程系黃鈴玲 Outline 4.1 Distance in Graphs 4.2 Distance in Weighted Graphs 4.3 The Center and Median of a Graph 4.1 Distance in Graphs Definition: For a nontrivial graph G and a pair u, v of vertices of G, the distance dG(u, v) (or d(u, v) if the graph G is clear from context) between u and v is the length of a shortest u-v path in G if such a path exists. If G contains no u-v path, then we define d(u, v) = ∞. Definition: The distance function on a graph G is a metric, that is, it maps V(G)?V(G) to the set of nonnegative integers and satisfies the following fundamental properties: (接下頁) Definition: For a directed graph D, the (directed) distance dD(u, v) (or d(u, v)) from vertex u to vertex v of D is the length of a shortest directed u-v path if such a path exists, and is ∞ otherwise. Algorithm 4.1 (Moore’s Breadth-First Search Algorithm) For every vertex w ? u, let l(w) ← ∞. Further, let l(u) ← 0 and initialize the queue Q to contain u only. If Q ? ?, then delete a vertex x from Q; otherwise, stop, since there is no u-v path. For every vertex y adjacent with x such that l(y) = ∞, assign PARENT(y) ← x, let l(y) ← l(x) +1 and add y to Q. If l(v) =∞, then return Step 2; otherwise, go to Step 5. 5.1 Let k ← l(v) and uk ← v. 5.2 If k ? 0, then uk-1 ← PARENT(uk); otherwise go to Step 5.4. 5.3 Let k ← k -1 and go to Step 5.2. 5.4 Output u0, u1, …, uk, which is a shortest u–v path. Algorithm 4.2 For every vertex v ? u, let l(u) ← ?.Further, let l(u) ← 0 and add u to a queue Q. If Q ? ?, then delete a vertex x from Q and go to Step 4. If Q = ?, then output the pairs v, l(v) for all vertices v of G, and stop. For every vertex y adjacent to x such that l(y) = ?,let l(y) ← l(x) +1 and add y to Q. Return to Step 2. Homework Exercise 4.1: 2, 5 Outline 4.1 Distance in Graphs 4.2 Distance in Weighted Graphs 4.3 The Center and Median of a Grap
您可能关注的文档
- 第五部分林业资源配置学习课件.ppt
- 相似模拟方法简介学习课件.ppt
- 学习者分析学习课件.ppt
- VentureCapitalContractsKaplanStromberg(2001,2003)学习课件.ppt
- 工程力学英文版课件03NonconcurrentForces学习课件.ppt
- 广东工业大学蒸馏和吸收塔设备学习课件.ppt
- 算法的含义学习课件.ppt
- 第八讲带传动CAD系统开发实例学习课件.ppt
- 第一部分导言学习课件.ppt
- 三角函数的图象系统疏理杨亚学习课件.ppt
- 2025-2026学年天津市和平区高三(上)期末数学试卷(含解析).pdf
- 2025-2026学年云南省楚雄州高三(上)期末数学试卷(含答案).pdf
- 2025-2026学年甘肃省天水市张家川实验中学高三(上)期末数学试卷(含答案).docx
- 2025-2026学年福建省厦门市松柏中学高二(上)期末数学试卷(含答案).docx
- 2025-2026学年广西钦州市高一(上)期末物理试卷(含答案).docx
- 2025-2026学年河北省邯郸市临漳县九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省石家庄二十三中七年级(上)期末历史试卷(含答案).docx
- 2025-2026学年海南省五指山市九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省唐山市玉田县九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省邢台市市区九年级(上)期末化学试卷(含答案).docx
最近下载
- 传媒法规与伦理教学课件(共22章)新闻伦理研究综述.pdf VIP
- 汽车行驶记录仪产品使用说明书.PDF VIP
- 2026年成都市美容医疗诊所医美项目安全规范运营可行性研究报告.docx VIP
- ocean培训petrel re快速入门工作流程.pdf VIP
- (四年级奥数班讲义.doc VIP
- 单病种病案数据填报指导手册.doc
- 企业 IPO 筹备方案(最新版,附时间表 + 材料).docx VIP
- 深圳初三数学联考模拟试题.docx VIP
- 高考历史二轮总复习精品课件 第四板块 世界现代史 第十七讲 现代科技的发展与当今世界发展的趋势.ppt VIP
- 2024年菏泽职业学院单招数学考试模拟试题及答案解析.docx VIP
原创力文档

文档评论(0)