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