Chapter 5 - Graphs
Chapter 5 - Graphs
Chapter 5 - Graphs
CHAPTER 4
GRAPHS AND DIRECTED GRAPHS
4.1 Graphs
Definition 1
A graph is a finite set V called the vertex set and a collection E of two
element subsets of V. The set E is called the edge set. An element of E is
called an edge. A graph is denoted by G(V, E). The elements a and b of V
are joined or connected by the edge {a, b} if {a, b} E.
Definition 2
i)
QM1063 CHAPTER 4
ii)
iii)
Example 1
The graph with V = {a, b, c} and E = {(a, b), (b, c)} may be shown as
Figure 1 or Figure 2.
c
e2
b
e1
a
Figure 1
c
Figure 2
QM1063 CHAPTER 4
Example 2
The graph with V = {a, b, c, d, e} and E ={{a, b}, {a, e}, {b, e}, {b, d},
{b, c}, {c, d}} has the diagram shown in Figure 3.
b
a
cb
v
d
e
Figure 3
Example 3
In a football league there have seven groups T1, T2, T3, T4, T5, T6 and
T7. Assume that after several games we have the situation below
T1 vs T2, T3, T5
T2 vs T1, T3, T5
T3 vs T1, T2, T4
T4 vs T3, T7
T5 vs T1, T2
T6 dont play any games yet
T7 vs T4
Model this situation with a graph.
QM1063 CHAPTER 4
Definition 3
The degree of a vertex v, denoted by deg(v), is the number of edges that
are incident on that vertex. A vertex with degree 0 is called isolated.
Example 4
In the graph shown in Figure 4,
a
e1
b
e3
e7
e6
edges.
c
e4
e
e2
e5
QM1063 CHAPTER 4
Definition 4
Example 5
Consider graph in Figure 5
e
Figure 5
Figure 6
QM1063 CHAPTER 4
Such edges are called parallel edges if two edges are both associated
with the pair vertex.
Example 6
v0
e1
Figure 7
v1
e2
v2
e1 and e2 are parallel edges.
A graph with neither loops nor parallel edges is called a simple graph.
Example 7
e1
v0
v1
e5
e7
e3
e2
e6
v3
v4
e4
v2
QM1063 CHAPTER 4
Definition 5
A graph is a complete graph if there is an edge between every two
distinct vertices. A complete graph with n vertices is denoted by Kn.
Example 8
The graphs K2, K3, K4, and K5 are shown respectively in Figure 9.
Figure 9
Definition 6
A graph G = (V, E) is called a bipartite graph if V can be expressed as
the disjoint union of nonempty sets, say V = A B, such that every edge
has the form {a, b} where a A and b B. Thus every edge connects a
vertex in A to a vertex in B and no vertices both in A or both in B are
connected. A bipartite graph is called a complete bipartite graph Km,n if
A contains m vertices, B contains n vertices and for every a A, b B,
there is an edge connecting them.
QM1063 CHAPTER 4
Example 9
The graphs K1,2, K2,3, K2,2 and K3,3 respectively, are shown in Figure 10.
v1
w1
w2
v1
v2
w1
w2
v1
w3
w1
v2
w2
v1
w1
v2
w2
v3
w3
Figure 10
4.2 Directed Graphs
Definition 7
A directed graph or digraph G, denoted by G (V, E), consists of a set V
of vertices, together with a set E of ordered pairs of V called the set of
directed edges or simply edges if it understood that the graph is
directed. An element of E is called a directed edge. If (a, b) E then a is
called initial vertex of (a, b) and b is called the terminal vertex.
QM1063 CHAPTER 4
Example 10
The digraph with V = {a, b, c, d} and E = {(a, b), (b, c), (c, c), (b, d), (d,
b), (c, d), (d, a)} is shown in Figure 11.
b
Figure 11
a
QM1063 CHAPTER 4
Use adjacency list to describe the simple graph given figure 12.Example
12
Represent the directed graph shown in figure 13 by listing all the vertices
that are terminal vertices of edges starting at each vertex of the graph.
Figure 12
10
QM1063 CHAPTER 4
11
QM1063 CHAPTER 4
Example 14
Draw a graph with adjacency matrix
0
1
1
0
0
1
1
0
0
1
0
1
12
QM1063 CHAPTER 4
M mij
respect to this ordering of V and E is the n m matrix
, where
1 when edge e j is incident with vi
mij
otherwise
Example 16
Represent the graph shown in Figure 16 with the incidence matrix
13
QM1063 CHAPTER 4
i = 1, . . ., 5.
Example 18
Show that the graphs displayed in Figure 18 are not isomorphic
H
14