《算法设计》课程教学资源(PPT课件讲稿)Lecture 6 Graph Traversal

Lecture 6 Graph Traversal Graph Undirected graph Directed graph 2/32021 Xiaojuan Cai
• Graph • Undirected graph • Directed graph Lecture 6 Graph Traversal 2/3/2021 Xiaojuan Cai 1

Overview Graph Undirected graph a DFS BFS, application Directed graph n DFS, BFS, Application 2/32021 Xiaojuan Cai
Overview • Graph • Undirected graph ‣ DFS, BFS, Application • Directed graph ‣ DFS, BFS, Application 2/3/2021 Xiaojuan Cai 2

Graph theory KONINGNTHERCA R CELT 慰 7器, The Konigsberg bridge problem Source from Wikipedia) 2/32021 Xiaojuan Cai
Graph theory The Königsberg Bridge problem (Source from Wikipedia) 2/3/2021 Xiaojuan Cai 3

Graph terminology vertex length vertex degree 4 path of and indegree 2 length 4 vertex directed path rected from O to 2 le components 00 Undirected graph Directed graph 2/32021 Xiaojuan Cai
Graph terminology Undirected graph Directed graph 2/3/2021 Xiaojuan Cai 5

Adjacency matrix v.S. Adjacency list = 21 30 45 2++s+34Z 30 010 Directed: n +m Directed: n2 Undirected: n+ 2m Undirected: n2 For every edge connected with v s u and v connected with an edge 2/32021 Xiaojuan Cai
Adjacency Matrix v.s. Adjacency List G= Directed: n + m Undirected: n + 2m Directed: n 2 Undirected: n 2 For every edge connected with v ... Is u and v connected with an edge? 2/3/2021 Xiaojuan Cai 6

mportant graph problems Path. Is there a directed path from s to t Shortest path. What is the shortest directed path from stot? Topological sort. Can you draw the digraph so that all edges point upwards Strong connectivity. Is there a directed path between all pairs of vertices Transitive closure For each vertices v and w is there a path from v to W 2/32021 Xiaojuan Cai
Important graph problems Path. Is there a directed path from s to t ? Shortest path. What is the shortest directed path from s to t ? Topological sort. Can you draw the digraph so that all edges point upwards? Strong connectivity. Is there a directed path between all pairs of vertices? Transitive closure. For each vertices v and w, is there a path from v to w ? 2/3/2021 Xiaojuan Cai 7

Where are we vertex Graph cle of length 5 path of Undirected graph length 4 degree 3 a DFS BFS, application Directed graph connected npo nents a DFS, BFS, Application 2/32021 Xiaojuan Cai
Where are we? • Graph • Undirected graph ‣ DFS, BFS, Application • Directed graph ‣ DFS, BFS, Application 2/3/2021 Xiaojuan Cai 8

DES Depth-first-search Unroll a ball of string behind you Mark each visited intersection and each visited passage e Retrace steps when no unvisited options 2/32021
DFS Depth-first-search. •Unroll a ball of string behind you. •Mark each visited intersection and each visited passage. •Retrace steps when no unvisited options. 2/3/2021 Xiaojuan Cai 9

Maze exploration 2/32021 Xiaojuan Cai 10
Maze exploration 2/3/2021 Xiaojuan Cai 10

Depth-first search pre/post =0/0 W 2/5 Z W V DES tree 2/32021 Xiaojuan Cai
Depth-first search u w x y z u u u v v x y w z y x DFS tree w z pre/post = 0/0 1/ 2/ 3/ 4/1 4 5 6 5/ 6/2 3 2/3/2021 Xiaojuan Cai 11
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 香港浸会大学:《Data Communications and Networking》课程教学资源(PPT讲稿)Chapter 3 Data Transmission.ppt
- 南京大学:Decidability、Complexity(P、NP、NPC)、Reduce(P NP NPC).pptx
- 《计算机文化基础》课程教学资源(PPT课件讲稿)第四章 电子表格系统Excel 2003.ppt
- 西安电子科技大学:《信息系统安全》课程教学资源(PPT课件讲稿)第三章 信息安全保障体系、第四章 物理安全.ppt
- 《计算机网络》课程电子教案(PPT课件讲稿)第2章 数据通信与广域网技术.ppt
- 《计算机网络与互联网 Computer Networks and Internets》课程电子教案(PPT课件讲稿)Part IV 局域网 Local Area Networks(LANs).ppt
- 《人工智能导论》课程教学资源(PPT课件讲稿)群智能(Swarm Intelligence).ppt
- 山东大学:《微机原理及单片机接口技术》课程教学资源(PPT课件讲稿)第六章 中断 §6.1 中断的概念 §6.2 单片机的中断系统及其管理.ppt
- 3D computer vision techniques v.4b2 1.ppt
- 上海交通大学:《计算机控制技术》课程教学资源(PPT课件)第一章 计算机控制系统概述 Computer Control Technology.ppt
- 电子工业出版社:《计算机网络》课程教学资源(第五版,PPT课件讲稿)第一章 概述.ppt
- 《ARM原理与设计》课程教学资源(PPT课件讲稿)Lecture 04 Cortex M3指令集.pptx
- 西安电子科技大学:《微机原理与接口技术》课程教学资源(PPT课件讲稿)第八章 中断系统与可编程中断控制器8259A.pptx
- 《软件工程》课程教学资源(PPT课件讲稿)需求分析.ppt
- 《Data Warehousing & Data Mining》课程教学资源(PPT讲稿)Ch 2 Discovering Association Rules.ppt
- Microsoft .NET(PPT课件讲稿)Being Objects and A Glimpse into Coding.pptx
- 《PHP程序设计》教学资源(PPT课件讲稿)项目二 网站用户中心.ppt
- 《信息技术基础》课程教学资源(PPT课件)信息技术基础知识的内容.ppt
- 广西外国语学院:《计算机网络》课程教学资源(PPT课件讲稿)第9章 DHCP协议(任课教师:卢豫开).ppt
- 《机器学习》课程教学资源(PPT课件讲稿)第十二章 计算学习理论 Machine Learning.pptx
- 《计算机原理及应用》课程教学资源(PPT课件讲稿)第8章 单片机的存储器的扩展.ppt
- 《计算机网络》课程教学资源(PPT课件讲稿)第6章 IP路由.ppt
- 《计算机仿真技术》课程电子教案(PPT教学课件)第一章 绪论.ppt
- 上海交通大学:《挖掘海量数据集 Mining Massive Datasets》课程教学资源(PPT讲稿)Lecture 07 链接分析 Link Analysis.ppt
- 香港中文大学:《Probability and Statistics for Engineers》课程教学资源(PPT课件讲稿)Chapter 09 Classical Staistical Inference.pptx
- 西安交通大学:《微机原理与接口技术》课程教学资源(PPT课件讲稿)第6章 数字量输入输出接口(主讲:桂小林).ppt
- 《软件工程》课程教学资源(PPT课件)Lecture 6 设计概念和原则 Design Concepts and Principles.ppt
- 《网络编程实用教程》课程教学资源(PPT课件讲稿)第2章 套接字网络编程基础.ppt
- 《现代操作系统 Modern Operating Systems》课程教学资源(PPT课件讲稿,Third Edition)Chapter 3 内存管理 Memory Management.ppt
- 《数据结构》课程教学资源(PPT课件讲稿)第四章 串.ppt
- 东北大学:《计算机图形学》课程教学资源(PPT课件讲稿,主讲:闻时光).ppt
- 上海交通大学:超立方体 Hypercube(PPT讲稿)Low-Diameter Architectures.ppt
- 《数据结构》课程教学资源(PPT课件讲稿)第五章 多维数组与广义表.ppt
- 西南交通大学:《网络性能评估与测试 Network Performance Evaluation and Testing》(PPT课件讲稿)第2讲 网络测试技术基础(主讲:张新有).ppt
- 《Photoshop CS教程》教学资源(PPT课件)第7章 编辑文字.ppt
- 《编译原理》课程教学资源(PPT课件讲稿)语法制导的翻译(Syntax-Directed Translation).pptx
- 电子科技大学:《密码理论》课程教学资源(PPT课件讲稿)第2章 流密码.ppt
- 搜索引擎技术(PPT讲稿)Web Spam.ppt
- 四川大学:《计算机操作系统 Operating System Principles》课程教学资源(PPT课件讲稿)第1章 导论(主讲:段磊).ppt
- 赣南师范大学:《计算机网络原理》课程教学资源(PPT课件讲稿)第七章 网络层.ppt