Transcript Lecture 10

Graphs
Basic properties
Continuation
1
Graph Isomorphism
• A graph G1 is isomorphic to a graph G2, when
there is a one-to-one correspondence f
between the vertices of G1 and G2 such that
vertices A and B are adjacent in G1 if and only
if the vertices f(A) and f(B) are adjacent in G2.
• The function f is called an isomorphism of G1
with G2.
2
Graph Isomorphism

3
Graph Isomorphism Invariant
• A property is said to be a graph isomorphism
invariant if, whenever G1 and G2 are
isomorphic graphs and G1 has this property,
then so does G2. The properties are:
 has n vertices
 has e edges
 has a vertex of degree k
4
Graph Isomorphism and
Degrees of Vertices
• Theorem. Let f be an isomorphism of graphs G1
and G2. For any vertex V in G1, the degrees of V
and f(V) are equal.
• To prove that two graphs G1 and G2 are
isomorphic, it is necessary to show that there is a
one-to-one correspondence (bijection) between
their vertices (to build such a correspondence)
and to show that vertices A and B are adjacent in
G1 if and only if the vertices f(A) and f(B) are
adjacent in G2.
5
Graph Isomorphism
-Negative Examples
• Once you see that graphs are isomorphic, it is
not diffcult to prove it.
• Proving the opposite, is usually more difficult.
To show that two graphs are non-isomorphic,
we need to show that no function can exist
that satisfies defining properties of
isomorphism.
• In practice, we try to find some key property
that differs between the 2 graphs.
6
Graph Isomorphism -Example
Verify, whether
is isomorphic to
.
First label the vertices:
2
2
3
1
5
3
1
4
5
4
7
Graph Isomorphism -Example
 Next, set f (1) = 1’ and try to walk around
clockwise on the star.
2
1
3
5
2
1’
3
4
5
4
8
Graph Isomorphism -Example
 Next, set f (1) = 1’ and try to walk around
clockwise on the star.
 The next vertex seen is 3, not 2!
2
1
5
3
2
1’
3
4
5
4
9
Graph Isomorphism -Example
 Next, set f (1) = 1’ and try to walk around
clockwise on the star.
 The next vertex seen is 3, not 2, so set f (2) = 2’.
2
1
5
3
2
1’
2’
4
5
4
10
Graph Isomorphism -Example
 Next, set f (1) = 1 and try to walk around
clockwise on the star.
 The next vertex seen is 3, not 2 so set f (2) = 2’.
 The next vertex seen is 5.
2
1
5
3
2
1’
2’
4
5
4
11
Graph Isomorphism -Example
 Next, set f (1) = 1 and try to walk around
clockwise on the star.
 The next vertex seen is 3, not 2 so set f (2) = 2’.
 The next vertex seen is 5, so set f (3) = 3’.
2
1
5
3
1
1’
2
2’
4
3’
4
12
Graph Isomorphism -Example
 Next, set f (1) = 1 and try to walk around
clockwise on the star.
 The next vertex seen is 3, not 2 so set f (2) = 3.
 The next vertex seen is 5, so set f (3) = 5.
 The next vertex seen is 2.
2
1
3
1’
2
2’
5
4
3’
4
13
Graph Isomorphism -Example
 Next, set f (1) = 1 and try to walk around
clockwise on the star.
 The next vertex seen is 3, not 2 so set f (2) = 3.
 The next vertex seen is 5, so set f (3) = 5.
 The next vertex seen is 2, so set f (4) = 4’.
2
1
3
1’
4’
2’
5
4
3’
4
14
Graph Isomorphism -Example
 Next, set f (1) = 1 and try to walk around
clockwise on the star.
 The next vertex seen is 3, not 2 so set f (2) = 3.
 The next vertex seen is 5, so set f (3) = 5.
 The next vertex seen is 2, so set f (4) = 4’.
 The next vertex seen is 4.
1
5
2
3
4
1’
4’
2’
3’ 4
15
Graph Isomorphism -Example
 Next, set f (1) = 1 and try to walk around
clockwise on the star.
 The next vertex seen is 3, not 2 so set f (2) = 3.
 The next vertex seen is 5, so set f (3) = 5.
 The next vertex seen is 2, so set f (4) = 4’.
 The next vertex seen is 4, so set f (5) = 5’.
1
5
2
3
4
1’
4’
2’
3’ 5’
16
Graph Isomorphism -Example
 If we would continue, we would get back to f (1)
=1.
 Thus, we showed that if any two vertices are
adjacent in the “pentagon” if they are adjacent in
the “star” and vice versa.
 To show that these graphs are isomorphic, it is
necessary to show that a mapping, which we have
built, is a one-to-one correspondence (bijection).
2
1
3
5
1=1’
2=4’
3=2’
4
5=3’ 4=5’
17
Graph Isomorphism -Example
 Both graphs have 5 vertices, each of the vertices from
the “star” is an image of some vertex from the
“pentagon” (onto mapping), and has a unique
prototype in the “pentagon”. Hence, the mapping
between these graphs is one-to-one correspondence.
 This means that these graphs are isomorphic.
 It is clear that the opposite mapping can also be easily
built.
2=4’
2
3
1
5
1=1’
3=2’
4
5=3’ 4=5’
18
Graph Isomorphism -Example
Q: Are the following isomorphic?
A: No, because the 1st graph has more vertices
than the 2nd.
u2
u1
u5
v2
u3
u4
v1
v3
v4
19
Graph Isomorphism -Example
Q: Are the following graphs isomorphic?
A: No, because the 1st graph has more edges
than 2nd.
u2
u1
u5
v2
u3
u4
v1
v5
v3
v4
20
Graph Isomorphism -Example
Q: Are the following graphs isomorphic?
A: No, because the 2nd graph has vertex of
degree 1, the 1st graph doesn't.
u2
u1
u5
v2
u3
u4
v1
v5
v3
v4
21
Multigraphs
• If computers are connected via internet
instead of directly, there may be several
routes to choose from for each connection.
Depending on traffic, one route could be
better than another. Makes sense to allow
multiple edges:
22
Multigraphs
1
e3
e1
e2
e4 e5
3
2
e6
4
Edge-labels distinguish between edges sharing
same endpoints.
e1  {1,2}, e2  {1,2}, e3  {1,3}, e4  {2,3},
e5  {2,3}, e6  {1,2}
23
Multigraphs
• A multigraph G = (V, E, f ) consists of a nonempty set V of vertices, a set E (possibly
empty) of edges and a function f with domain
E and codomain the set of pairs in V.
L23
24
Pseudographs
If self-loops in a multigraph are allowed, we get a
pseudograph:
e6
e1
1
2
e2
e5
e3
e4
e7
3
4
Now edges may be associated with a single
vertex, when the edge is a loop
e1  {1,2}, e2  {1,2}, e3  {1,3},
e4  {2,3}, e5  {2}, e6  {2}, e7  {4}
25
Pseudographs
• A pseudograph G = (V, E, f ) consists of a nonempty set V of vertices, a set E (possibly
empty) of edges and a function f whose
domain is E and whose codomain the set of
pairs and singletons in V.
26
Homework
• Read pp. 158-161, 164-167
• Problems (Exercises 4.1) 31, 33, 42c, 43a
27