2215Ch9 2022
2215Ch9 2022
C c
D
A
a d
B b
Simple Graph
• A graph consists of
– a nonempty set of vertices called V
– a set of edges (unordered pairs of
distinct elements of V) called E
• Notation: G = (V,E)
• A graph is simple if there is at most one
edge linking two vertices.
Simple Graph Example
Detroit
New York
San Francisco
Chicago
Denver Washington
Los Angeles
Washington
Pseudographs
Multigraphs
Simple Graphs
Directed Graph
The edges are ordered pairs of (not necessarily
distinct) vertices.
Detroit
Chicago New York
San Francisco
Denver Washington
Los Angeles
Detroit
New York
Chicago
San Francisco
Denver Washington
Los Angeles
Directed
Multigraphs
Directed Graphs
Graph Models
Chapter 9.2
Graph Terminology
a g f e
Cycles: C3 C4 C5 C6
Wheel
When a new vertex is added to a cycle Cn and
this new vertex is connected to each of the n
vertices in Cn, we obtain a wheel Wn.
Wheels: W3 W4 W5 W6
Subgraph
• A subgraph of a graph G = (V,E) is a graph
H = (W,F) where W V and F E.
K5 C5
Is C5 a subgraph of K5?
Union
• The union of 2 simple graphs G1 = (V1, E1) and
G2 = (V2, E2) is the simple graph with vertex set V
= V1V2 and edge set E = E1E2. The union is
denoted by G1G2.
c c c
b d b f
f b d d
a e a e a e
S5 C5 W5
S5 C5 = W5
MTH 2215
Applied discrete mathematics
Chapter 9.4
Connectivity
– Is it simple?
u1 u2 – yes
u5 u3
– What is the length?
u4 –5
– Is it simple?
– yes
u1 u2
a b a b
c e
f d c
g e d f
Yes No
Connectedness (Cont.)
b d e f
a c h g
Example
• What are the connected components of
the following graph?
b d e f
a c h g
a d f g
b c e h
Example
• Find the cut vertices and cut edges in the
following graph.
a d f g
b c e h
Chapter 9.5
Euler and Hamilton Paths
C
c
D
A
a d
B
b
Euler Paths and Circuits
e e
d c d c c d e
yes no no
(a, e, c, d, e, b, a)
Example
• Which of the following graphs has an
Euler path?
a b a b a b
e e
d c d c c d e
yes no yes
(a, e, c, d, e, b, a ) (a, c, d, e, b, d, a, b)
Hamilton Paths and Circuits
• No vertex of degree 1
• If a node has degree 2, then both edges
incident to it must be in any Hamilton
circuit.
• No smaller circuits contained in any
Hamilton circuit (the start/endpoint of any
smaller circuit would have to be visited
twice).
A Sufficient Condition
Let G be a connected simple graph with n
vertices with n 3.
G has a Hamilton circuit if the degree of
each vertex is n/2.
Travelling Salesman Problem
A Hamilton circuit or path may be used to
solve practical problems that require visiting
“vertices”, such as:
road intersections
pipeline crossings
communication network nodes
A classic example is the Travelling Salesman
Problem – finding a Hamilton circuit in a
complete graph such that the total weight of
its edges is minimal.
Summary
Property Euler Hamilton
Repeated visits to a given Yes No
node allowed?
Repeated traversals of a No No
given edge allowed?
Omitted nodes allowed? No No