0% found this document useful (0 votes)
4 views71 pages

Chap8 Complete

Chapter 8 discusses various aspects of graphs, including definitions, types, and terminology related to vertices and edges. It covers simple graphs, multigraphs, directed graphs, and special graph types like bipartite and complete graphs. Additionally, the chapter explains graph representation methods such as adjacency lists and matrices.

Uploaded by

Nazetta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views71 pages

Chap8 Complete

Chapter 8 discusses various aspects of graphs, including definitions, types, and terminology related to vertices and edges. It covers simple graphs, multigraphs, directed graphs, and special graph types like bipartite and complete graphs. Additionally, the chapter explains graph representation methods such as adjacency lists and matrices.

Uploaded by

Nazetta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 71

Chapter 8: Graphs

2022

1/71
Outline
Graphs Connectivity
Graphs Paths
Types of Graphs Connectedness In
Graphs Terminology Undirected Graphs
Graphs Terminology How Connected is a
Some Special Simple Graph?
Graphs Connectedness in Directed
Bipartite Graphs Graphs
New Graphs from Old Paths and Isomorphism
Representing Graphs Counting Paths Between
Representing Graphs Vertices
Adjacency Matrices Euler and Hamilton Paths
Incidence Matrices Euler Paths & Circuits
Isomorphism of Graphs Hamilton Paths & Circuits

2/71
Va 24 overtex vI

Graphs
& ,
&

G -
edge
, e ,
23
⑧ · -
v
vs' er

Definition
A graph G = (V , E ) consists of V , a nonempty set of
vertices (or nodes) and E , a set of edges. Each edge has
either one or two vertices associated with it, called its
endpoints. An edge is said to connect its endpoints.

Remark
The set of vertices V of a graph G may be infinite. A graph
with an infinite vertex set or an infinite number of edges is
called an infinite graph, and in comparison, a graph with a
finite vertex set and a finite edge set is called a finite graph.

3/71
Types of Graphs
Suppose that a network is made up of data centers and
communication links between computers. This computer
network can be modeled using a graph in which the vertices of
the graph represent the data centers and the edges represent
communication links.
A graph in which each edge connects two di↵erent vertices
and where no two edges connect the same pair of vertices is
called a simple graph. (no direction)

7
S
S
7
[

simple directed graph

4/71
Types of Graphs - undirected
-
multiple edges

Graphs that may have multiple edges connecting the same


vertices are called multigraphs. When there are m di↵erent
edges associated to the same unordered pair of vertices {u, v },
we also say that {u, v } is an edge of multiplicity m.

5/71
Types of Graphs =
undirected
multiple edges
loops
-

Graphs that may include loops, and possibly multiple edges


connecting the same pair of vertices or a vertex to itself, are
sometimes called pseudographs.

So far the graphs we have introduced are undirected graphs.


Their edges are also said to be undirected.

6/71
Types of Graphs
To construct a graph model, we may find it necessary to assign
directions to the edges of a graph.
Definition
A directed graph (or digraph) (V , E ) consists of a nonempty set
of vertices V and a set of directed edges (or arcs) E . Each
directed edge is associated with an ordered pair of vertices. The
directed edge associated with the ordered pair (u, v ) is said to start
at u and end at v .
When a directed graph has no loops and has no multiple directed
edges, it is called a simple directed graph.

7/71
Types of Graphs

Directed graphs that have multiple directed edges from a


vertex to a second (possibly the same) vertex are called
directed multigraphs. When there are m directed edges,
each associated to an ordered pair of vertices (u, v ), we say
that (u, v ) is an edge of multiplicity m.

8/71
Types of Graphs

Type Edges Multiple Edges? Loops?


Simple graph Undirected No No
Multigraph Undirected Yes No
Pseudograph Undirected Yes Yes
Simple directed graph Directed No No
Directed Multigraph Directed Yes Yes
Directed &
Mixed graph Yes Yes
undirected

9/71
u :
V

Graphs Terminology U a
adjacent

· v
not
adjacent
no edges connect the
> because there is
-

two vertices
.

Definition
Two vertices u and v in an undirected graph G are called
adjacent (or neighbours) in G if u and v are endpoints of an
sebelah-nyebelah
edge e of G . Such an edge e is called incident with the
vertices u and v and e is said to connect u and v .

Definition
The set of all neighbours of a vertex v of G = (V , E ), denoted
by N(v ), is called the neighbourhood of v . If A is a subset
of V , we denote by N(A) the set of all vertices in S
G that are
adjacent to at least one vertex in A. So, N(A) = v 2A N(v ).

10/71
Graphs Terminology
Definition
The degree of a vertex in an undirected graph is the
number of edges incident with it, except that a loop at a
vertex contributes twice to the degree of that vertex. The
degree of the vertex v is denoted by deg(v ).
D
(a) = 2
&
deg
I 2

(b) = 2
a
L
· deg
2

11/71
Graphs Terminology
Example Solution:

What are the degrees and


what are the neighborhoods deg(a) = 2 N(a) = {b, f }
of the vertices in the graph
deg(b) = 4 N(b) = {a, c, e, f }
deg(c) = 4 N(c) = {b, d, e, f }
deg(d) = 1 N(d) = {c}
deg(e) = 3 N(e) = {b, c, f }
deg(f ) = 4 N(f ) = {a, b, c, e}
deg(g ) = 0 N(g ) = {}

Remark
A vertex of degree zero is called isolated.
A vertex is pendant if and only if it has degree one.
12/71
Graphs Terminology
pseudograph

Example
What are the degrees and
what are the neighborhoods Solution:
of the vertices in the graph
loop brings
a

2 degree deg(a) = 4 N(a) = {b, d, e}


deg(b) = 6 N(b) = {a, b, c, d, e}
deg(c) = 1 N(c) = {b}
deg(d) = 5 N(d) = {a, b, e}
deg(e) = 6 N(e) = {a, b, d}

13/71
Graphs Terminology
THE HANDSHAKING THEOREM
Let G = (V , E ) be an undirected graph with m edges. Then
X
2m = deg(v ).
v 2V

(Note that this applies even if multiple edges and loops are
present.)

Example
How many edges are there in a graph with 10 vertices each of
-

degree
-
six?
Solution:
The sum of the degrees of the vertices is 6 · 10 = 60. Thus,
2m = 60 ) m = 30 edges
14/71
a b

Graphs Terminology
ac

Theorem
An undirected graph has an even number of vertices of odd
degree.

Definition
When (u, v ) is an edge of the graph G with directed edges, u
is said to be adjacent to v and v is said to be adjacent
from u. The vertex u is called the initial vertex of (u, v ),
and v is called the terminal or end vertex of (u, v ). The
initial vertex and terminal vertex of a loop are the same.

15/71
Graphs Terminology
Definition
in
one
going
In a graph with directed edges the in-degree of a vertex v ,
denoted by deg (v ), is the number of edges with v as their
that going
the one out

terminal vertex. The out-degree of v , denoted by deg + (v ),


is the number of edges with v as their initial vertex. (Note
that a loop at a vertex contributes 1 to both the in-degree and
the out-degree of this vertex.)

U a sou

dey(u)
=0 Gegt(u) =

+
(v) =
1 deg
deg-(v) =

16/71
Graphs Terminology directed
graph must
two
declare
degrees.
Example
Find the in-degree and out-degree of each vertex in the graph.

Solution:
in
deg (a) = 2, deg (b) = 2, deg (c) = 3,
deg (d) = 2, deg (e) = 3, deg (f ) = 0,
+
deg (a) = 4, +
deg (b) = 1, deg+ (c) = 2, out
deg+ (d) = 2, deg+ (e) = 3, deg+ (f ) = 0.
17/71
Graphs Terminology

Theorem
Let G = (V , E) be a graph with directed edges. Then
X X
deg (v ) = deg+ (v ) = |E |.
v 2V v 2V

In other words, the sum of the in-degrees and the sum of the
out-degrees of all vertices in a graph with directed edges are
the same.

18/71
Some Special Simple Graphs a is number of

vertices
Complete Graphs
A complete graph on n vertices, denoted byO Kn , is a simple
graph that contains exactly one edge between each pair of
distinct vertices. A simple graph for which there is at least one
pair of distinct vertex not connected by an edge is called
noncomplete.

19/71
Some Special Graphs

Cycles
A cycle Cn , n 3, consists of n vertices v1 , v2 , . . . , vn and
edges {v1 , v2 }, {v2 , v3 }, . . . , {vn 1 , vn }, and {vn , v1 }.

20/71
Some Special Graphs
Wheels
We obtain a wheel Wn when we add an additional vertex to a
cycle Cn , for n 3, and connect this new vertex to each of
the n vertices in Cn , by new edges.

21/71
Some Special Graphs
n-Cubes
An n-dimensional hypercube, or n-cube, denoted by Qn , is
a graph that has vertices representing the 2n bit strings of
length n. Two vertices are adjacent if and only if the bit
strings that they represent di↵er in exactly one bit position.

22/71
Bipartite Graphs
Definition
A simple graph G is called bipartite if its vertex set V can be
partitioned into two disjoint sets V1 and V2 such that every edge
in the graph connects a vertex in V1 and a vertex in V2 (so that no
edge in G connects either two vertices in V1 or two vertices in V2 ).
When this condition holds, we call the pair (V1 , V2 ) a bipartition
of the vertex set V of G .

Example
C6 is bipartite since its vertex set
can be partitioned into the two
sets V1 = {v1 , v3 , v5 } and
V2 = {v2 , v4 , v6 } and every edge
of C6 connects a vertex in V1
and a vertex in V2 .
23/71
Bipartite Graphs

Example
K3 is not bipartite. Note that
if we divide the vertex set of
K3 into two disjoint sets, one
of the two sets must contain
two vertices.
If the graph were bipartite,
these two vertices could not be
connected by an edge, but in
K3 each vertex is connected to
every other vertex by an edge.

24/71
Bipartite Graphs
Example
Are the graphs G and H bipartite? v, = (a ,
c)

vz =
&a , b
, d3
O 8 O
O

Solution:
G is bipartite because its vertex set is the union of two disjoint
sets, {a, b, d} and {c, e, f , g }.
H is not bipartite because its vertex set cannot be partitioned into
two subsets so that edges do not connect two vertices from the
same subset. 25/71
Complete Bipartite Graphs
A complete bipartite graph Km,n is a graph that has its
vertex set partitioned into two subsets of m and n vertices,
respectively with an edge between two vertices if and only if
one vertex is in the first subset and the other vertex is in the
second subset.
set
Oh

C
-
secondet

26/71
New Graphs from Old

Definition
A subgraph of a graph G = (V , E ) is a graph H = (W , F )
where W ✓ V and F ✓ E .

Definition
Let G = (V , E ) be a simple graph. The subgraph induced
by a subset W of the vertex set V is the graph (W , F ), where
the edge set F contains an edge in E if and only if both
endpoints of this edge are in W.

27/71
New Graphs from Old

Example
The graph G shown is a subgraph of K5 . If we add the edge
connecting c and e to G , we obtain the subgraph induced by
W = {a, b, c, e}.

(b) subgraph induced


(a) A subgraph of K5 by W

28/71
New Graphs from Old
Definition
The union of two simple graphs G1 = (V1 , E1 ) and
G2 = (V2 , E2 ) is the simple graph with vertex set V1 [ V2 and
edge set E1 [ E2 . The union of G1 and G2 is denoted by
G1 [ G2 .

29/71
Representing Graphs
One way to represent a graph with no multiple edges is to use
adjacency lists, which specify the vertices that are adjacent
to each vertex of the graph.

Example
Use adjacency lists to describe Solution:
the simple graph
Vertex Adjacent Vertices
a b, c, e
b a
c a, d, e
d c, e
e a, c, d

30/71
Representing Graphs

Example
Use adjacency lists to describe Solution:
the directed graph
Vertex Adjacent Vertices
a b, c, d, e
b b, d
c a, c, e
d
e b, c, d

31/71
IMPORTANT
Adjacency Matrices
The adjacency matrix A (or AG ) of G is the n ⇥ n zero-one
matrix, AG = [aij ], where

1 if {vi , vj } is an edge of G ,
aij =
0 otherwise.

Example
Solution:
Use an adjacency matrix to
We order the vertices as
represent the graph
a, b, c, d. 4x4 vertices
2 3
mirror
0 1 1 1 &
6 1 0 1 0 7b
AG = 6 4 1 1 0 0 5E
7

1 0 0 0 &
ab C d
32/71
Adjacency Matrices
Example
Solution:
Draw a graph with adjacency
matrix
2 3
0 1 1 0
6 1 0 0 1 7
AG = 64 1
7
0 0 1 5
0 1 1 0

with respect to the ordering of


vertices a, b, c, d.

Remark
Note that an adjacency matrix of a graph is based on the ordering
chosen for the vertices. Hence, there may be as many as n!
di↵erent adjacency matrices for a graph with n vertices, because
there are n! di↵erent orderings of n vertices. 33/71
Adjacency Matrices
I The adjacency matrix of a simple graph is symmetric.
I Since a simple graph has no loops, each entry
aii , i = 1, 2, 3, . . . , n is 0.
I Adjacency matrices can also be used to represent
undirected graphs with loops and with multiple edges.
I A loop at the vertex vi is represented by a 1 at the (i, i)th
position of the matrix.
I When multiple edges or loops at the same vertex are
present, the adjacency matrix is no longer a zero-one
matrix.
I All undirected graphs, including multigraphs and
pseudographs gave symmetric adjacency matrices.
I The adjacency matrices for a directed graph does not
have to be symmetric because there may be not be an
edge from vj to vi when there is an edge from vi to vj .
34/71
Adjacency Matrices

Example
Use an adjacency matrix to Solution:
represent the pseudograph We order the vertices as
a, b, c, d.
bcd
2a 3
0 1 0 1
· 66 0 1 0 1 7
7
AG = 4
1 1 0 0 5
a 0 1 0 0

35/71
Adjacency Matrices

Example
Use an adjacency matrix to Solution:
represent We order the vertices as
a, b, c, d.
bcd
2A 3
0 3 0 2

:
6 3 0 1 1 7
AG = 6 4 0
7
1 1 2 5
2 1 2 0

36/71
Incidence Matrices
Let G = (V , E ) be an undirected graph. Suppose that
v1 , v2 , . . . , vn are the vertices and e1 , e2 , . . . , em are the edges of G .
Then the incidence matrix with respect to this ordering of V and
E is the n ⇥ m matrix M = [mij ], where

1 when edge ej is incident with vi ,
mij =
0 otherwise.

Example
2
Represent the following graph Solution:
with an incidence matrix. -

&
E
37/71
Incidence Matrices
Example
Represent the following graph with an incidence matrix.

Solution:

38/71
Isomorphism of Graphs
two graphs

Definition
The simple graphs G1 = (V1 , E1 ) and G2 = (V2 , E2 ) are
isomorphic if there exists a one-to-one and onto function f
from V1 to V2 with the property that a and b are adjacent in
G1 if and only if f (a) and f (b) are adjacent in G2 , for all a and
b in V1 . Such a function f is called an isomorphism. Two
simple graphs that are not isomorphic are called
nonisomorphic.
In other words, when two simple graphs are isomorphic, there
is a one-to-one correspondence between vertices of the two
graphs that preserves the adjacency relationship.

39/71
Isomorphism of Graphs
Example
Solution: The function f with
Show that the graphs
f (u1 ) = v1 , f (u2 ) = v4 , f (u3 ) = v3 ,
G = (V , E ) and H = (W , F )
and f (u4 ) = v2 is a one- to-one
are isomorphic.
correspondence between V and W .

↓I
To see that this correspondence
preserves adjacency, note that
adjacent vertices in G are u1 and u2 ,
↑ u1 and u3 , u2 and u4 , and u3 and u4 ,
& and each of the pairs f (u1 ) = v1 and
f (u2 ) = v4 , f (u1 ) = v1 and


f (u3 ) = v3 , f (u2 ) = v4 and
f (u4 ) = v2 , and f (u3 ) = v3 and
f (u4 ) = v2 consists of two adjacent
vertices in H .

40/71
Isomorphism of Graphs
I It is often difficult to determine whether two simple
graphs are isomorphic.
I There are n! possible one-to-one correspondences between
the vertex sets of two simple graphs with n vertices.
I Testing each such correspondence to see whether it
preserves adjacency and nonadjacency is impractical if n
is at all large.
I Sometimes it is not hard to show that two graphs are not
isomorphic. In particular, we can show that two graphs
are not isomorphic if we can find a property only one of
the two graphs has, but that is preserved by isomorphism.
I A property preserved by isomorphism of graphs is called a
graphs invariant.

41/71
Isomorphism of Graphs

I For example, two simple isomorphic graphs must :


I have the same number of vertices,
I have the same number of edges,
I have the same degrees of vertices, i.e. a vertex v of
degree d in G must correspond to a vertex f (v ) of
degree d in H, because a vertex w in G is adjacent to v
if and only if f (v ) and f (w ) are adjacent in H.
I These conditions are necessary but not sufficient to
show that two graphs are isomorphics.
I The breaking of one of these conditions is sufficient but
not necessary to show that two graphs are not isomorphic.

42/71
Isomorphism of Graphs
Example
Show that the graphs displayed below are not isomorphic.

2
S Z
I
1

3 4
5 5 Y
6

are not
these isomorphic
Solution:
Both G and H have five vertices and six edges. However, H
has a vertex of degree one, whereas G has no vertices of
degree one. It follows that G and H are not isomorphic.
43/71
Isomorphism of Graphs

Example
Determine whether the graphs shown below are isomorphic.

44/71
Isomorphism of Graphs

Solution:
The graphs G and H both have eight vertices and 10 edges.
They also both have four vertices of degree two and four of
degree three. Because these invariants all agree, it is still
conceivable that these graphs are isomorphic.
However, G and H are not isomorphic. To see this, note that
because deg(a) = 2 in G , a must correspond to either t, u, x,
or y in H, because these are the vertices of degree two in H.
However, each of these four vertices in H is adjacent to
another vertex of degree two in H, which is not true for a in G .

45/71
Isomorphism of Graphs

I To show that a function f from the vertex set of a graph


G to the vertex set of a graph H is an isomorphism, we
need to show that f preserves the presence and absence
of edges.
I One helpful way to do this is to use adjacency matrices.
I In particular, to show that f is an isomorphism, we can
show that the adjacency matrix of G is the same as the
adjacency matrix of H, when rows and columns are
labeled to correspond to the images under f of the
vertices in G that are the labels of these rows and
columns in the adjacency matrix of G .

46/71
Isomorphism of Graphs
Example
Determine whether the graphs shown below are isomorphic.

Solution:
Both G and H have six vertices and seven edges. Both have four
vertices of degree two and two vertices of degree three. Because G
and H agree with respect to these invariants, it is reasonable to try
to find an isomorphism f .
47/71
Isomorphism of Graphs
We now will define a function f and then determine whether it
is an isomorphism. Because deg(u1 ) = 2 and because u1 is not
adjacent to any other vertex of degree two, the image of u1
must be either v4 or v6 , the only vertices of degree two in H
not adjacent to a vertex of degree two. We arbitrarily set
f (u1 ) = v6 . [If we found that this choice did not lead to
isomorphism, we would then try f (u1 ) = v4 .] Because u2 is
adjacent to u1 , the possible images of u2 are v3 and v5 . We
arbitrarily set f (u2 ) = v3 .
Continuing in this way, using adjacency of vertices and degrees
as a guide, we set f (u3 ) = v4 , f (u4 ) = v5 , f (u5 ) = v1 , and
f (u6 ) = v2 . We now have a one-to-one correspondence
between the vertex set of G and the vertex set of H, namely,
f (u1 ) = v6 , f (u2 ) = v3 , f (u3 ) = v4 , f (u4 ) = v5 , f (u5 ) =
v1 , f (u6 ) = v2 .
48/71
Isomorphism of Graphs

To see whether f preserves edges, we examine the adjacency


matrix of G , and the adjacency matrix of H with the rows and
columns labeled by the images of the corresponding vertices in
G,

Because AG = AH , it follows that f preserves edges. We


conclude that f is an isomorphism, so G and H are isomorphic.

49/71
Paths
I A path is a sequence of edges that begins at a vertex of
a graph and travels from vertex to vertex along edges of
the graph.
I A path of length n from u to v in G is a sequence of n
edges e1 , e2 , . . . , en of G .
I When the graph is simple, we denote this path by its
vertex sequence x0 , x1 , . . . , xn .
I The path is a circuit if it begins and ends at the same
vertex.
I The path or circuit is said to pass through the vertices
x1 , x2 , . . . , xn 1 or traverse the edges e1 , e2 , . . . , en .
undirected
I A path or circuit is simple if it does not contain the same
edge more than once.
50/71
Paths
Example

I a, d, c, f , e is a simple path of length 4 since


{a, d}, {d, c}, {c, f }, {f , e} are all edges
I d, e, c, a is not a path because {e, c} is not an edge.
I b, c, f , e, b is a circuit of length 4.
I a, b, e, d, a, b is of length 5 is not simple because it
contains the edge {a, b} twice.
51/71
Connectedness In Undirected Graphs

I An undirected graph is called connected if there is a


path between every pair of distinct vertices of the graph.
I An undirected graph that is not connected is called
disconnected.
I We say that we disconnect a graph when we remove
vertices or edges, or both, to produce a disconnected
subgraph.

52/71
Connectedness In Undirected Graphs

a diacent
vertices

I G1 is connected because there is a path between every


pair of distinct vertices.
I G2 is not connected since for instance, there is no path
between vertices a and d.
Theorem
There is a simple path between every pair of distinct vertices
of a connected undirected graph. 53/71
Connectedness In Undirected Graphs
I A connected components of a graph G is a connected
subgraph of G that is not a proper subgraph of another
connected subgraph ofG .

The graph H is the union of three disjoint connected


subgraphs H1 , H2 , H3 .
These subgraphs are the connected components of H.
54/71
How Connected is a Graph?

I Sometimes the removal of a vertex and all edges incident


with it produces a subgraph with more connected
components than in the original graph. Such vertices are
called cut vertices (or articulation points). The
removal of a cut vertex from a connected graph produces
a subgraph that is not connected.
I An edge whose removal produces a graph with more
connected components than in the original graph is called
a cut edge or bridge.

55/71
How Connected is a Graph?
Example
Find the cut vertices and cut edges in the graph

on its own

Solution:
The cut vertices are b, c, and e. The removal of one of these
vertices (and its adjacent edges) disconnects the graph. The
cut edges are {a, b} and {c, e}. Removing either one of these
edges disconnects the graph. not
major a out subgrags
Vertex to become

56/71
Connectedness in Directed Graphs
& b
S
-
M

L
d L

I A directed graph is strongly connected if there is a path


from a to b and from b to a whenever a and b are
vertices in the graph.
I A directed graph is weakly connected if there is a path
between every two vertices in the underlying undirected
graph.
I Any strongly connected directed graph is also weakly
connected.

57/71
Connectedness in Directed Graphs
Example

I G is strongly connected because there is a path between


any two vertices in this directed graph. Hence, G is also
weakly connected.
I The graph H is not strongly connected. There is no
directed path from a to b in this graph. However, H is
weakly connected, because there is a path between any
two vertices in the underlying undirected graph of H.
58/71
Paths and Isomorphism
check the number of
vertices,

I There are several ways that paths and circuits can help
determine whether two graphs are isomorphic.
I For example, the existence of a simple circuit of a
particular length is a useful invariant that can be used to
show that two graphs are not isomorphic.
I In addition, paths can be used to construct mappings that
may be isomorphisms.

59/71
Paths and Isomorphism
if it is not isomorphic
then you don't have to find

Example Solution: dia cency


a .

I Both G and H have six


Determine whether the graphs vertices and eight edges.
G and H are isomorphic.
I Each has four vertices of
degree three, two vertices
of degree two.
I H has a simple circuit of
length three but G has no
simple circuit of length
three.
I Therefore, G and H are
not isomorphic.

60/71
Paths and Isomorphism
Solution:
I Both G and H have five vertices
and six edges. Each has two
Example vertices of degree three, three
Determine whether the graphs G vertices of degree two.
and H are isomorphic. I Both have a simple circuit of
length three, a simple circuit of

#*
length four and a simple circuit of
length five. Therefore, G and H
maybe isomorphic.
vide reve-length
, of s

I To find possible isomorphism, we


can follow paths that go through
all vertices so that the
corresponding vertices in the two
graphs have the same degree.
61/71
Paths and Isomorphism
Solution:
I For example, the path u1 , u4 , u3 , u2 , u5 in G and
v3 , v2 , v1 , v5 , v4 in H. We can define f to be
f (u1 ) = v3 , f (u4 ) = v2 , f (u3 ) = v1 , f (u2 ) = v5 , f (u5 ) = v4 .
I To see whether f preserves edges, we examine the adjacency
matrix of G , and the adjacency matrix of H

u1 u2 u3 u4 u5 v3 v5 v1 v2 v4
2 3 2 3
u1 0 0 1 1 1 v3 0 0 1 1 1
u2 60 0 1 0 17 v5 60 0 1 0 17
6 7 6 7
AG = u 3 61 1 0 1 07 A H = v1 61 1 0 1 07
6 7 6 7
u4 41 0 1 0 05 v2 41 0 1 0 05
u5 1 1 0 0 0 v4 1 1 0 0 0

I Since AG = AH . Thus, f is an isomorphism.

62/71
Counting Paths Between Vertices
I The number of paths between two vertices in a graph can be
determined using its adjacency matrix.
I Let G be a graph with adjacency matrix A. The number of
di↵erent paths of length r from vi to vj , where r is a positive
integer, equals the (i, j)th entry of Ar .

Example
How many paths of length four are there from a to d in the simple
b Cd
graph a

T]
I
g

, 0
-
63/71
Counting Paths Between Vertices

Solution:
First, find the adjacency matrix (ordering the vertices as
a, b, c, d, e). Next, find Ar

2 3 2 3
0 1 1 0 8 0 0 8
6 1 0 0 1 7 6 0 8 8 0 7
A=6
4 1
7 A4 = 6 7
0 0 1 5 4 0 8 8 0 5
0 1 1 0 8 0 0 8

Hence, the number of paths of length four from a to d is the


(1, 4)th entry of A4 . Thus, there are exactly eight paths of
length four from a to d.

64/71
Euler Paths & Circuits E-keyword for Euler

I An Euler circuit in a graph G is a simple circuit


containing every edge of G . An Euler path in G is a
simple path containing every edge of G .

I G1 has an Euler circuit, for example, a, e, c, d, e, b, a.


I G2 does not have an Euler circuit and Euler path.
I G3 does not have an Euler circuit but has an Euler path,
namely, a, c, d, e, b, d, a, b.
65/71
Euler Paths & Circuits

I H1 does not have an Euler circuit and Euler path.


I H2 has an Euler circuit, for example, a, g , c, b, g , e, d, f , a.
I H3 does not have an Euler circuit but has an Euler path,
namely, c, a, b, c, d, b.

66/71
Euler Paths & Circuits
I A connected multigraph with at least two vertices has an
Euler circuit if and only if each of its vertices has even
degree.

deg(A) = 5, deg(B) = 3, deg(C ) = 3, deg(D) = 3. Thus, the


degree (odd) fren
there is no
graph has no Euler circuit. ifno even
,

encer circuit.

67/71
Euler Paths & Circuits
I A connected multigraph has an Euler path but not an Euler
circuit if and only if it has exactly two vertices of odd degree.

I G1 contains exactly two vertices of odd degree, namely, b and


d . Hence, it has an Euler path that must have b and d as its
endpoints. One such Euler path is d, a, b, c, d, b.
I G2 has exactly two vertices of odd degree, namely, b and d.
So it has an Euler path that must have b and d as endpoints.
One such Euler path is b, a, g , f , e, d, c, g , b, c, f , d.
I G3 has no Euler path because it has six vertices of odd degree.
68/71
times
Euler-vertex many

Hamilton Paths & Circuits edge once


-

hamilton-vertex once
edge many times
-

I A simple path in a graph G that passes through every vertex


exactly once is called a Hamilton path, and a simple circuit
in a graph G that passes through every vertex exactly once is
called a Hamilton circuit.

I G1 has a Hamilton circuit: a, b, c, d, e, a.


I G2 has no Hamilton circuit but G2 does have a Hamilton
path, namely, a, b, c, d.
I G3 has neither a Hamilton circuit nor a Hamilton path.
69/71
Hamilton Paths & Circuits
I A graph with a vertex of degree one cannot have a
Hamilton circuit, because in a Hamilton circuit, each
vertex is incident with two edges in the circuit.

I There is no Hamilton circuit in G because G has a vertex


of degree one, namely, e.

70/71
Hamilton Paths & Circuits

Dirac’s Theorem
If G is a simple graph with n vertices with n 3 such that the
degree of every vertex in G is at least n/2, then G has a
Hamilton circuit.

Ore’s Theorem
If G is a simple graph with n vertices with n 3 such that
deg(u) + deg(v ) n for every pair of nonadjacent vertices u
and v in G , then G has a Hamilton circuit.

71/71

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy