复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 10 Graph algorithms

Data Structures and Algorithm Xiaoqing Zheng Zhengxq@fudan.edu.cn
Data Structures and Algorithm Data Structures and Algorithm Xiaoqing Zheng zhengxq@fudan.edu.cn

Representations of undirected graph 2 5 3 5)(4 Adjacency-list representation of graph G=(V, E)
Representations ofd d h un directe d grap h 1 2 1 2 5 / 3 2 1 3 4 / 3 2 4 4 2 5 3 / / 5 4 4 2 5 3 / 5 4 1 / Adjacency-list representation of graph G = ( V, E )

Representations of undirected graph 12345 101001 210110 301010 5)(4 510010 Adjacency-matrix representation of graph G=(V, E)
Representations ofd d h un directe d grap h 1 2 12345 1 01001 3 2 10110 3 0 1 0 1 0 5 4 3 0 1 0 1 0 4 01101 5 1 0 0 1 0 d f h 5 1 0 0 1 0 A djacency-matrix representation of grap h G = ( V, E )

Representations of directed graph 4 4(5 6 123456 Adjacency-list representation of graph G=(V, E)
Representations ofd d h irecte d grap h 1 2 3 1 2 4 / 2 5 / 3 6 5 4 2 / / 4 5 4 2 / 6 5 4 / 6 6 / Adjacency-list representation of graph G = ( V, E )

Representations of directed graph 123456 10100 2000010 3000011 4010000 4(5 6 5000100 6000001 Adjacency-matrix representation of graph G=(V, E)
Representations ofd d h irecte d grap h 1 2 3 123456 1 010100 2 000010 3 000011 4 5 6 4 010000 5 000100 d f h 6 000001 A jacency-matrix representation of grap h G = ( V, E )

raphs Definition. a directed graph(digraph G=(, E) is an ordered pair consisting of a set v of vertices(singular: vertex ● a set e∈ x y ofedges. In an undirected graphG=(v, E), the edge set e consists of unordered pairs of vertices In either case, we have E=O(2). Moreover, if G is connected, then E≥-1
G h rap s D fi i i Definition. A di d h rected graph (di h grap ) G = (V, E) is an ordered pair consisting of y a set V of vertices (i l s ngu ar: vertex), y a set E ∈ V × V of edges. In an undirected graph G = (V, E), the edge set E consists of unordered pairs of vertices. In either case, we have |E| = O(V2). Moreover, if G is connected then is connected, then |E| ≥ |V| – 1

Representations of grap Adjacency-list representation An adjacency list of a vertex v E v is the list Adilv of vertices adjacent to v For undirected graphs, Adilvl= degree(v) For directed graphs, lAdilvll=out-degree(v) Adiacency-matrix representation The adjacency matrix of a graph G=(v, E), where ={1,2,…,n}, is the matrix A[1….n21….n] given by A[;.n∫lif()∈E, 0 if(i,j e
Representations of h grap Adjacency-list representation list representation An adjacency list of a vertex v ∈ V is the list Adj[v] of ertices adjacent to of vertices adjacent to v. y For undirected graphs, |Adj[v]| = degree(v). y For directed graphs For directed graphs, |Adj[v]| = out-degree(v). Adjacency-matrix representation The adjacency matrix of a graph G = (V, E), where V = {1, 2, …, n}, is the matrix A[1 … n, 1 … n] given by 1 if (i, j) ∈ E, A[i j] = 0 if (i, j) ∉ E. A[i, j]

Breadth-first search Given a graph G=(, E)and a distinguished source vertex s, breadth -first search systematically explores the edges of g to discover every vertex that is reachable from S
Bread ht -f h irst search Gi en a graph Given a graph G = (V, E) and a disting ished and a distinguished source vertex s, breadth-first search systematically explores the edges of the edges of G to "discover" every vertex that is to "discover" every vertex that is reachable from s. ∞ 0 ∞ ∞ r stu ∞ ∞ ∞ ∞ v wxy

Breadth-first search example Gray vertices
Bread ht -f hl irst search example r s t u ∞ 0 ∞ ∞ r Q s ∞ ∞ ∞ ∞ 0 Gray vertices v w x y y

Breadth-first search example 11 Gray vertices
Bread ht -f hl irst search example r s t u Q w r 1 0 ∞ ∞ r 1 1 ∞ 1 ∞ ∞ Gray vertices v w x y y
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 09 Greedy algorithms.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 08 Dynamic programming.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 07 Amortized analysis.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 06 Binary search trees.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 05 Hash tables.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 04 Soring.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 03 Basic data structure - Elementary data structures.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 02 Divide-and-conquer design paradigm.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 01 Algorithm analysis and recurrences.pdf
- 复旦大学:《数据结构与算法设计》综合项目_Project3. All-pairs shortest path.pdf
- 复旦大学:《数据结构与算法设计》综合项目_Project2. English-Chinese dictionary based on binary search tree.pdf
- 复旦大学:《数据结构与算法设计》综合项目_Project1. Combining quicksort with insertion sort.pdf
- 复旦大学:《数据结构与算法设计》实验设计_Lab 8. String Matching.pdf
- 复旦大学:《数据结构与算法设计》实验设计_Lab 7. Single-Source Shortest Paths.pdf
- 复旦大学:《数据结构与算法设计》实验设计_Lab 6. Greedy Algorithms.pdf
- 复旦大学:《数据结构与算法设计》实验设计_Lab 5. Red-Black Tree.pdf
- 复旦大学:《数据结构与算法设计》实验设计_Lab 4. Binary Search Trees.pdf
- 复旦大学:《数据结构与算法设计》实验设计_Lab 3. Hash Tables.pdf
- 复旦大学:《数据结构与算法设计》实验设计_Lab 2. Divide and Conquer.pdf
- 复旦大学:《数据结构与算法设计》实验设计_Lab 1. Stack.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 11 String Matching.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 12 NP-complete problems.pdf
- 复旦大学:《计算机网络 Computer Networking》课程教学资源_考试样卷.doc
- 复旦大学:《计算机网络 Computer Networking》课程教学资源_各章节练习题.docx
- 复旦大学:《计算机网络 Computer Networking》课程教学资源_考试样卷.doc
- 《计算机网络》课程教学资源(参考文献)END-TO-END ARGUMENTS IN SYSTEM DESIGN.pdf
- 《计算机网络》课程教学资源(参考文献)The Design Philosophy of the DARPA Internet Protocols.pdf
- 《计算机网络》课程教学资源(参考文献)Interdomain Internet Routing.pdf
- 《计算机网络》课程教学资源(参考文献)Stable Internet Routing Without Global Coordination.pdf
- 《计算机网络》课程教学资源(参考文献)9e5f3e30-0aac-407f-b55f-4b04f28fcc05.pdf
- 《计算机网络》课程教学资源(参考文献)Congestion Avoidance and Control.pdf
- 《计算机网络》课程教学资源(参考文献)Random Early Detection Gateways for Congestion Avoidance.pdf
- 《计算机网络》课程教学资源(参考文献)Congestion Control for High Bandwidth-Delay Product Networks.pdf
- 《计算机网络》课程教学资源(参考文献)Analysis and Simulation of a Fair Queueing Algorithm.pdf
- 《计算机网络》课程教学资源(参考文献)Core-St at eless Fair Queueing:Achieving Approximately Fair Bandwidth Allocations in High Speed Networks.pdf
- 《计算机网络》课程教学资源(参考文献)Fundamental Design Issues for the Future Internet.pdf
- 《计算机网络》课程教学资源(参考文献)Supporting Real-Time Applications in an Integrated Services Packet Network:Architecture and Mechanism.pdf
- 《计算机网络》课程教学资源(参考文献)A Fifty Gigabit Per Second IP Router.pdf
- 《计算机网络》课程教学资源(参考文献)The iSLIP Scheduling Algorithm for Input-Queued Switches.pdf
- 《计算机网络》课程教学资源(参考文献)MACAW_A Media Access Protocol for Wireless LAN’s.pdf