Tải bản đầy đủ (.ppt) (50 trang)

§5.2 5.3 Graphs and Graph Terminology

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (2.14 MB, 50 trang )

§5.2 - 5.3 Graphs and
Graph Terminology
“Liesez Euler, Liesez
Euler, c’est
notre
maître à tous.”
- Pierre Laplace


Graphs consist of
 points called
vertices
 lines called edges
1. Edges connect two
vertices.
2. Edges only
intersect at vertices.
3. Edges joining a
vertex to itself are
called loops.

Example 1: The
following picture
is a graph. List its
vertices
and
A
D
edges.
C


E
B


Example 2:
This is also a graph. The vertices just
happen to have people’s names.
Such a graph could represent friendships
(or any kind of relationship).

Flexo

Bender

Leela
Zoidberg
QuickTime™ and a
TIFF (LZW) decompressor
are needed to see this picture.

QuickTime™ and a
TIFF (LZW) decompressor
are needed to see this picture.

Fry

Amy

Farnsworth



Now check out the graph below.
What can we say about it in comparison to
the previous figure?

Leela

Fry
Flexo
Amy

Bender

QuickTime™ and a
TIFF (LZW) decompressor
are needed to see this picture.

Farnsworth

Zoidberg
QuickTime™ and a
TIFF (LZW) decompressor
are needed to see this picture.


Moral of the Story
• One graph may be drawn in
(infinitely) many ways, but it
always provides us with the same
information.

• Graphs are a structure for
describing relationships between
objects.
(The vertices denote the objects and
the edges represent the relationship.)


Graph Terminology


Graph Terminology
could ask
e
on
on
rg
ja
-y
th
ma
e
(ie - all th
for)

e
r
a
s
e
c

i
t
r
e
V
t
n
e
c
a
 Adj
e
r
a
t
a
h
t
s
e
c
i
t
r
e
v
two
.
e
g

d
e
n
a
y
b
d
e
n
i
o
j
 Adjacent Edges are
two edges that
intersect at a vertex.
 The degree of a
f
o
r
e
b
m
u
n
e
h
t
s
i
x

e
t
r
ve
edges at that vertex.


Graph Terminology
e
c
i
w
t
s
t
n
u
o
c
p
o
o
l
A
toward the degree.
An
vertex
An
vertex


odd vertex is a
of odd degree.
even vertex is a
of even degree.


Example 3:
1) Find the degree
of each vertex.
2) Is A adjacent
B?
Is D adjacent
A?
Is E adjacent
itself?
Is C adjacent
itself?

A

D

to

C

to
to
E


to

3) Is AB adjacent to
BC?
Is CE adjacent to
BD?

B


Graph Terminology
A path is a sequence
t
a
h
t
h
c
u
s
s
e
c
i
t
r
e
v
of
t

n
e
c
a
j
d
a
s
i
x
e
t
r
e
each v
to the next. In a
e
b
n
a
c
e
g
d
e
h
c
a
e
,

h
t
pa
traveled only once.
h
t
a
p
a
f
o
h
t
g
n
e
l
•The
s
e
g
d
e
f
o
r
e
b
m
u

n
e
h
t
is
in that path.


Graph Terminology
•A path that starts
and ends at the same
vertex is called a
circuit.
•A graph is connected
if any two vertices
can be joined by a
path. If this is not
possible then the
.
d
e
t
c
e
n
n
o
c
s
i

d
s
i
h
p
a
r
g


Graph Terminology
•The connected
parts of a
h
p
a
r
g
d
e
t
c
e
n
n
o
c
dis
are called
components.

•A bridge is an
d
e
t
c
e
n
n
o
c
a
n
i
e
edg
l
a
v
o
m
e
r
e
s
o
h
w
h
p
a

gr
makes it
disconnected.


Example 4:
1) Find a path from B to
K passing through W
but not S.

J

S

B
H

W
K

2) Find a path from H to
J of length 4.
3) Find a circuit of
length 5.

4) Find a circuit of
length 1.
Example 5: Draw a picture of a 5)
graph
satisfies

Findthat
a bridge.
the following:
Vertices:

A, B, C, D

Edges: AB, AC, AD, B is adjacent to D.


Graph Terminology
•An Euler Path is a
path that travels
f
o
e
g
d
e
y
r
e
v
e
h
g
u
o
thr
d

n
a
e
c
n
o
(
h
p
a
r
g
e
h
t
only once).
a
s
i
t
i
u
c
r
i
C
r
e
l
u

E
•An
s
l
e
v
a
r
t
t
a
h
t
t
i
u
c
r
ci
through every edge of
a gra ph.


Example 6: The graph on the
left has no Euler paths, but
the one on the right has
several.
R

R


D

A

L

D

A

L


§5.4 - 5.5 Graph
Models and Euler’s
Theorems
“Now I will have less
distraction.”
- Leonhard Euler
after losing sight
in his right eye.


Königsberg’s Bridges II
(The rare sequel that is not entirely
gratuitous.)
Recall from Tuesday the
puzzle that the residents
of Königsburg had been

unable to solve until
Euler’s arrival:
• Is there a way to cross
all seven bridges exactly
once and return to your
starting point?
• Is there even a way to
cross all seven bridges
exactly once?

R

A

D

L
A stylized (i.e. - inaccurate)
map of Königsberg’s Bridges.


What Euler realized was that most of the information
on the maps had no impact on the answers to the two
questions.
R

R

D


A

L

D

A

L

By thinking of each bank and island as a vertex and each
bridge as an edge joining them Euler was able to model
the situation using the graph on the right. Hence, the
Königsberg puzzle is the same as asking if the graph has
an Euler path or Euler circuit.


Slay-

Example:
• The Scooby Gang needs to patrol the following section of
town starting at Sunnydale High (labeled G). Draw a
graph that models this situation, assuming that each
side of the street must be checked except for those
along the park. (Map is from p. 206)

age


Example 2: (Exercise 21, pg 207) The

map to the right of downtown Kingsburg,
shows the Kings River running through
the downtown area and the three islands
(A, B, and C) connected to each other
and both banks by seven bridges. The
Chamber of Commerce wants to design a
walking tour that crosses all the bridges.
Draw a graph that models the layout of
Kingsburg.


Example 3:
The Kevin Bacon Game
( />

Euler’s Theorems
• Euler’s Theorem 1
(a) If a graph has any odd vertices, then
it cannot have an Euler circuit.
(b) If a graph is connected and every
vertex is even, then it has at least one
Euler circuit.


• Euler’s Theorem 2
(a) If a graph has more than two odd
vertices, then it cannot have an Euler
path.
(b) If a connected graph has exactly two
odd vertices then it has at least one

Euler path starting at one odd vertex
and ending at another odd vertex.


Example 4: Königsburg’s Bridges III (The Search For More Money)
Money
Let us consider again the Königsburg Brdige puzzle as represented by the graph
below:
R

D

A

L
We have already seen that the puzzle boils down to whether this graph has
an Euler path and/or an Euler circuit. Does this graph have either?


Example 5: (Exercise 60, pg 214) Refer to Example 2. Is it possible to take a
walk such that you cross each bridge exactly once? Explain why or why not.

N

A

B

S


C


×