Chapter10 (2 3)
Chapter10 (2 3)
2
Graph Terminology and
Special Types of Graphs
Section Summary
Basic Terminology
Some Special Types of Graphs
Bipartite Graphs
Bipartite Graphs and Matchings (not
currently included in overheads)
Some Applications of Special Types of
Graphs (not currently included in
overheads)
New Graphs from Old
Basic Terminology
Definition 1. Two vertices u, v in an
undirected graph G are called adjacent (or
neighbors) in G if there is an edge e
between u and v. Such an edge e is called
incident with the vertices u and v and e is
said to connect u and v.
adjacent 邻接的,相邻
[ə'dʒeɪs(ə)nt] adj.
Basic Terminology
Definition 2. The set of all neighbors
of a vertex v of G = (V, E), denoted by
N(v), is called the neighborhood of v. If
A is a subset of V, we denote by N(A)
the set of all vertices in G that are
adjacent to at least one vertex in A. So,
incident 关联的
Basic Terminology ['ɪnsɪdənt] adj.
Solution:
G: deg(a) = 2, deg(b) = deg(c) = deg(f ) = 4, deg(d ) =
1,
deg(e) = 3, deg(g) = 0.
N(a) = {b, f }, N(b) = {a, c, e, f }, N(c) = {b, d, e, f },
N(d) = {c}, N(e) = {b, c , f }, N(f) = {a, b, c, e}, N(g)
=.
H: deg(a) = 4, deg(b) = deg(e) = 6, deg(c) = 1, deg(d)
= 5.
Degrees of Vertices
Theorem 1 :
Handshaking Theorem
We now give two examples illustrating the
usefulness
of the handshaking theorem.
Example: How many edges are there in a graph
with 10 vertices of degree six?
Solution: Because the sum of the degrees of the
vertices is 6 10 = 60, the handshaking
theorem tells us that 2m = 60. So the number
of edges m = 30.
Handshaking Theorem
Example: If a graph has 5 vertices, can each
vertex have degree 3?
Solution: This is not possible by the
handshaking thorem, because the sum of the
degrees of the vertices 3 5 = 15 is odd.
Degree of Vertices
(continued)
Theorem 2: An undirected graph has an even number of
vertices of odd degree.
Proof: Let V1 be the vertices of even degree and V2 be the
vertices of odd degree in an undirected graph
G = (V, E) with m edges. Then
even
each v ∈ V1
even for of all vertices of odd degree in
the graph, there must be an
even number of such vertices.
Directed Graphs
Recall the definition of a directed graph.
topology 拓扑(结构)
[tə'pɒlədʒɪ] n.
Special Types of Graphs and
Computer Network
Architecture
Special Types of Graphs and
Computer Network
Architecture
bipartite 二分的
Bipartite Graphs [baɪ'pɑː(r)taɪt] adj.
b e
c d
Example:
Representing Graphs:
Adjacency Lists
Example:
Representation of Graphs:
Adjacency Matrices
Definition: Suppose that G = (V, E) is a simple
graph where |V | = n. Arbitrarily list the vertices
of G as v1, v2, … , vn. The adjacency matrix AG
of G, with respect to the listing of vertices, is
the n × n zero-one matrix with 1 as its (i, j )th
entry when vi and vj are adjacent, and 0 as its
(i, j )th entry when they are not adjacent.
In other words, if the graphs adjacency matrix
is AG = [aij], then
Adjacency Matrices
(continued)
Example:
The ordering of
vertices is a, b, c,
d.
The ordering of
vertices is a, b, c,
d.
aij for i = 1, 2, 3, …, n, is 0.
i.e., aij = aji . Also, since there are no loops, each diagonal entry
TRADE-OFFS BETWEEN
ADJACENCY LISTS AND
ADJACENCY MATRICES