西安建筑科技大学:《数据结构与算法》课程教学资源(PPT电子教案)第六部分 图结构_图 Chapter 12 GRAPHS(英文)

Chapter 12 GRAPHS 1. Mathematical Background L 2 Computer Representation L3. Graph Traversal 4.Topological Sorting 5. A Greedy algorithm: Shortest Paths 6. Minimal Spanning trees 7. Graphs as Data Structures
Chapter 12 GRAPHS 1. Mathematical Background 2. Computer Representation 3. Graph Traversal 4. Topological Sorting 5. A Greedy Algorithm: Shortest Paths 6. Minimal Spanning Trees 7. Graphs as Data Structures

12.1 Mathematical Background Definitions and Examples 关联 1. A graph G consists of a set V, wh se mem ers are called the vertices of G, together with a set A f pairs of distinct vertices from V 2. The pairs in E are called the edges of G 3. If e=(v,w)is an edge with vertices v and w,then v and w are said to lie on e, and e is said to be incident with v and w 4. If the pairs are unordered, G is called an undirected graph 5. If the pairs are ordered, G is called a directed graph. The term directed graph is often shortened to digraph, and the unqualified term graph usually means undirected graph
12.1 Mathematical Background Definitions and Examples 1. A graph G consists of a set V , whose members are called the vertices of G, together with a set E of pairs of distinct vertices from V . 2. The pairs in E are called the edges of G. 3. If e = (v,w) is an edge with vertices v and w, then v and w are said to lie on e, and e is said to be incident with v and w. 4. If the pairs are unordered, G is called an undirected graph. 5. If the pairs are ordered, G is called a directed graph. The term directed graph is often shortened to digraph, and the unqualified term graph usually means undirected graph. 依附于 关联

6. Two vertices in an undirected graph are called adjacent if there is an edge from the first to the second 7. A path is a sequence of distinct vertices, each adjacent to the next 8. a cycle is a path containing at least three vertices such that the last vertex on the path is adjacent to the first 9. a graph is called connected if there is a path from any vertex to any other vertex 10. A free tree is defined as a connected undirected graph with no cycles 11. In a directed graph a path or a cycle means always moving in the direction indicated by the arrows Such a path(cycle)is called a directed path(cycle)
6. Two vertices in an undirected graph are called adjacent if there is an edge from the first to the second. 7. A path is a sequence of distinct vertices, each adjacent to the next. 8. A cycle is a path containing at least three vertices such that the last vertex on the path is adjacent to the first. 9. A graph is called connected if there is a path from any vertex to any other vertex. 10. A free tree is defined as a connected undirected graph with no cycles. 11. In a directed graph a path or a cycle means always moving in the direction indicated by the arrows. Such a path (cycle) is called a directed path (cycle)

12.a directed graph is called strongly connected if there is a directed path from any vertex to any other vertex. If we suppress the direction of the edges and the resulting undirected graph is connected, we call the directed graph weakly connected. 13.The valence of a vertex is the number of edges on which it lies, hence also the number of vertices adjacent to it
12.A directed graph is called strongly connected if there is a directed path from any vertex to any other vertex. If we suppress the direction of the edges and the resulting undirected graph is connected, we call the directed graph weakly connected. 13.The valence of a vertex is the number of edges on which it lies, hence also the number of vertices adjacent to it

Examples of Graphs Honolulu H C Samoa Fiji C C Noumea Tahiti H Sydney Auckland Benzene molecule Selected south pacific air routes
Examples of Graphs

B A F C E essage transmission In a netwo rk 21○○21Q 21 3 Connected Path Cycle Disconnected Tree Various kinds of undirected graphs
Various kinds of undirected graphs

Directed cycle Strongly connected Weakly connected Examples of directed graphs
Examples of directed graphs

12.2 Computer Representation Set Implementations of Digraphs pg 573 Definition a digraph G consists of a set V, called the vertices of G, and, for all VE V, a subset Av of V, called the set of vertices adjacent to v directed graph
12.2 Computer Representation Set Implementations of Digraphs pg.573 Definition A digraph G consists of a set V , called the vertices of G, and, for all vV, a subset Av of V, called the set of vertices adjacent to v. directed graph

number of vertices Set as a bit string: pg 573 at most max size template struct Set I bool is_element[max_set]s Digraph as a bit-strip set template class Digraph I int count Set neighbors[max size];
Digraph as a bit-string set: template class Digraph { int count; Set neighbors[max_size]; }; number of vertices at most max_size Set as a bit string: pg.573 template struct Set { bool is_element[max_set]; };

Adjacency matrix Digraph as an adjacency table: pg 57 template class digraph int count. bool adjacency[max size[max size]
Digraph as an adjacency table: pg.574 template class Digraph { int count; bool adjacency[max_size][max_size]; }; Adjacency matrix
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 西安建筑科技大学:《数据结构基础(选修)》课程PPT电子教案_第五部分 图(中文).ppt
- 西安建筑科技大学:《数据结构基础(选修)》课程PPT电子教案_第四部分 树与二叉树(中文).ppt
- 西安建筑科技大学:《数据结构基础(选修)》课程PPT电子教案_第三部分 栈、队列、递归方法(中文).ppt
- 西安建筑科技大学:《数据结构基础(选修)》课程PPT电子教案_第二部分 线性表(中文).ppt
- 西安建筑科技大学:《数据结构基础(选修)》课程PPT电子教案_第一部分 绪论(中文).ppt
- 西安建筑科技大学:《数据结构与算法》课程教学资源(PPT电子教案)第五部分 树结构_多叉树 Chapter 11 MULTIWAY TREES(英文).ppt
- 西安建筑科技大学:《数据结构与算法》课程教学资源(PPT电子教案)第五部分 树结构_二叉树 Chapter 10 BINARY TREES(英文).ppt
- 西安建筑科技大学:《数据结构与算法》课程教学资源(PPT电子教案)第四部分 查找、排列_检索 Chapter 9 Tables And Information Retrieval(英文).ppt
- 西安建筑科技大学:《数据结构与算法》课程教学资源(PPT电子教案)第四部分 查找、排列_排列 Chapter 8 SORTING(英文).ppt
- 西安建筑科技大学:《数据结构与算法》课程教学资源(PPT电子教案)第四部分 查找、排列_查找 Chapter 7 SEARCHING(英文).ppt
- 西安建筑科技大学:《数据结构与算法》课程教学资源(PPT电子教案)第三部分 线性表_线性表 Chapter 6 LISTS AND STRINGS(英文).ppt
- 西安建筑科技大学:《数据结构与算法》课程教学资源(PPT电子教案)第二部分 栈、队列、递归方法_递归 Chapter 5 RECURSION(英文).ppt
- 西安建筑科技大学:《数据结构与算法》课程教学资源(PPT电子教案)第二部分 栈、队列、递归方法_链式栈与队列 Chapter 4 Linked Stacks and Queues(英文).ppt
- 西安建筑科技大学:《数据结构与算法》课程教学资源(PPT电子教案)第二部分 栈、队列、递归方法_队列 Chapter 3 QUEUES(英文).ppt
- 西安建筑科技大学:《数据结构与算法》课程教学资源(PPT电子教案)第二部分 栈、队列、递归方法_栈 Chapter 2 INTRODUCTION TO STACKS(英文).ppt
- 西安建筑科技大学:《数据结构与算法》课程教学资源(PPT电子教案)第一部分 绪论_大规模程序开发 Chapter 1 PROGRAMMING PRINCIPLES(英文).ppt
- 西安建筑科技大学:《数据结构与算法》课程教学资源(PPT电子教案)第一部分 绪论_数据结构导言(中文).ppt
- 西安建筑科技大学:《数据结构与算法》课程教学资源(PPT电子教案)第一部分 绪论_C++回顾(C++编程简介,中文).ppt
- 西安建筑科技大学:《数据结构与算法》教学资源(课程设计题目任务书)用Dijkstra方法求最短路径.doc
- 西安建筑科技大学:《数据结构与算法》教学资源(课程设计题目任务书)中缀表达式转后缀表达式.doc
- 西安建筑科技大学:《数据结构基础(选修)》课程PPT电子教案_第六部分 排序(中文).ppt
- 西安建筑科技大学:《数据结构基础(选修)》课程PPT电子教案_第七部分 查找(中文).ppt
- 西安建筑科技大学:《数据结构基础》课程课堂笔记_第一部分 绪论_大规模程序开发 PROGRAMMING PRINCIPLES(英文).doc
- 西安建筑科技大学:《数据结构基础》课程课堂笔记_第二部分 栈、队列、递归方法_栈 INTRODUCTION TO STACKS(英文).doc
- 西安建筑科技大学:《数据结构基础》课程课堂笔记_第二部分 栈、队列、递归方法_队列 Queues(英文).doc
- 西安建筑科技大学:《数据结构基础》课程课堂笔记_第二部分 栈、队列、递归方法_递归 RECURSION(英文).doc
- 西安建筑科技大学:《数据结构基础》课程课堂笔记_第二部分 栈、队列、递归方法_链式栈与队列 LINKED STACKS AND QUEUES(英文).doc
- 西安建筑科技大学:《数据结构基础》课程课堂笔记_第三部分 线性表_线性表 LISTS(英文).doc
- 西安建筑科技大学:《数据结构基础》课程课堂笔记_第四部分 查找、排列_查找 Searching(英文).doc
- 西安建筑科技大学:《数据结构基础》课程课堂笔记_第四部分 查找、排列_排列 Sorting(英文).doc
- 西安建筑科技大学:《数据结构基础》课程课堂笔记_第四部分 查找、排列_检索 TABLES AND INFORM ATION RETRIEVAL(英文).doc
- 西安建筑科技大学:《数据结构基础》课程课堂笔记_第五部分 树结构_二叉树 BINAR Y TREES(英文).doc
- 西安建筑科技大学:《数据结构基础》课程课堂笔记_第五部分 树结构_多叉树 MULTIWAY TREES(英文).doc
- 西安建筑科技大学:《数据结构基础》课程课堂笔记_第六部分 图结构_图 Graph(英文).doc
- 西安建筑科技大学:《数据结构基础》课程课外习题_第一部分 绪论.doc
- 西安建筑科技大学:《数据结构基础》课程课外习题_第二部分 线性表_数组.doc
- 西安建筑科技大学:《数据结构基础》课程课外习题_第二部分 线性表_链表.doc
- 西安建筑科技大学:《数据结构基础》课程课外习题_第三部分 栈、队列、递归方法_栈与队列.doc
- 西安建筑科技大学:《数据结构基础》课程课外习题_第三部分 栈、队列、递归方法_递归与广义表.doc
- 西安建筑科技大学:《数据结构基础》课程课外习题_第四部分 树结构.doc