Section 8.2
-
Upload
merrill-evans -
Category
Documents
-
view
21 -
download
0
description
Transcript of Section 8.2
![Page 1: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/1.jpg)
1
Section 8.2
Graph Terminology
![Page 2: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/2.jpg)
2
Terms related to undirected graphs
• Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in G if there is an edge {u,v}
• Incident, connect: if edge e = {u,v}, e is incident with vertices u & v, and e connects u and v
• Endpoints: vertices u & v are endpoints of edge e
![Page 3: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/3.jpg)
3
Terms related to undirected graphs
• Degree of vertex in an undirected graph is the number of edges incident with it– loops count twice– degree of vertex v is denoted deg(v)
• Example: what are the degrees of the vertices in this graph?
![Page 4: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/4.jpg)
4
Terms related to undirected graphs
• Isolated vertex (like e in previous example) has degree 0, not adjacent to any other vertex
• Pendant vertex (like d in previous example) - adjacent to exactly one vertex
• The sum of the degrees of all vertices in a graph is exactly twice the number of edges in the graph
![Page 5: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/5.jpg)
5
Handshaking Theorem
• Let G=(V,E) be an undirected graph with e edges; then 2e =
Vv
v)deg(
• Note that sum of degrees of vertices is always even; this leads to the theorem:
An undirected graph has an even number of vertices of odd degree
![Page 6: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/6.jpg)
6
Terminology related to directed graphs
• Let G be a directed graph, with an edge e=(u,v):– u is initial vertex– v is terminal, or end vertex– u is adjacent TO v– v is adjacent FROM u– initial & terminal vertex of a loop are the same
![Page 7: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/7.jpg)
7
Terminology related to digraphs
• In-degree of vertex v, denoted deg-(v), is the number of edges with v as the terminal vertex
• Out-degree of vertex v, denoted deg+(v), is the number of edges with v as the initial vertex
• A loop has one of each
![Page 8: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/8.jpg)
8
Terminology related to digraphs
• The sum of in-degrees is equal to the sum of out-degrees
• Both are equal to the number of edges in the graph:– Let G=(V,E) be a directed graph; then
VvVv
vv |E|)(deg)(deg
• The undirected graph that results from ignoring arrows in a directed graph is called the underlying undirected graph
![Page 9: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/9.jpg)
9
Classes of simple graphs
• Complete graphs: complete graph on n vertices, denoted Kn, is the simple graph that contains exactly one edge between each pair of distinct vertices; Examples:
![Page 10: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/10.jpg)
10
Classes of Simple Graphs
• Cycle: Cn, where n 3, consists of n vertices v1, v2, … , vn and edges {v1, v2}, {v2, v3}, … , {vn-1, vn} Examples:
![Page 11: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/11.jpg)
11
Classes of Simple Graphs
• Wheel: a cycle with an additional vertex, which is adjacent to all other vertices; example:
![Page 12: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/12.jpg)
12
Classes of Simple Graphs
• n-Cube: denoted Qn, is a graph representing the 2n bit strings of length n:
• 2 vertices are adjacent if and only if the bit strings they represent differ in exactly one position. Examples:
![Page 13: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/13.jpg)
13
Bipartite Graphs
• A simple graph G is called bipartite if its vertex set V can be partitioned into 2 disjoint non-empty sets V1 and V2 such that:– every edge connects a vertex in V1 with a
vertex in V2
– no edge connects 2 vertices in V1 or in V2
![Page 14: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/14.jpg)
14
Example: lining up 1st graders
Cate JohnMary MarkMary Ann TerryMary Pat TimMarie Jimmy
![Page 15: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/15.jpg)
15
Example - cycle
• C6 is bipartite; can partition its vertex set into 2 distinct sets:– V1 = {v1, v3, v5)
– V2 = {v2, v4, v6}– with every edge connecting a
vertex in V1 with one in V2
![Page 16: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/16.jpg)
16
ExamplesGraph at left is not bipartite; to divide into2 sets, one set must include 2 vertices and tobe bipartite, those vertices must not be connectedBut every vertex in this graph is connected to2 othersThis graph, on the other hand, is bipartite; thetwo sets are V1 = {v1, v3, v5} and V2 = {v2, v4, v6}Note that the definition doesn’t say a vertex inone set can’t connect to more than one vertex inthe other - only that each in one must connect to one in the other, and no vertex in a set can connectto a vertex in the same set
![Page 17: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/17.jpg)
17
Examples: are they bipartite?
![Page 18: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/18.jpg)
18
Complete Bipartite Graphs
• Denoted Km,n is the graph that has its vertex set partitioned into 2 subsets of m vertices and n vertices
• There is an edge between 2 vertices if and only if one vertex is in the first subset and the other is in the second subset
![Page 19: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/19.jpg)
19
Examples
![Page 20: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/20.jpg)
20
Applications of Special Types of Graphs: LAN topology
• A star is a complete bipartite K1,n graph:
• A ring is an n-cycle:
• A redundant network may have both a central hub and a ring, forming a wheel:
![Page 21: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/21.jpg)
21
Subgraph
• Graph obtained by removing vertices and their associated edges from a larger graph; more formally:
• Subgraph of G=(V,E) is H=(W,F) where WV and FE
![Page 22: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/22.jpg)
22
Subgraph Example
![Page 23: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/23.jpg)
23
Can combine graphs, forming a union
• Let G1 = (V1, E1) and G2 = (V2, E2)
• The union, G1 G2 = (V1 V2, E1 E2)
![Page 24: Section 8.2](https://reader034.fdocuments.us/reader034/viewer/2022042900/568131cf550346895d983826/html5/thumbnails/24.jpg)
24
Section 8.2
Graph Terminology