s9.3 Graph Isomorphism
s9.3 Graph Isomorphism
Discrete Mathematics
Graph Isomorphism 1
Definition: Isomorphism of Graphs
Definition
The simple graphs G1 = (V1 , E1 ) and G2 = (V2 , E2 ) are
isomorphic if there is an injective (one-to-one) and surjective
(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.
Graph Isomorphism 2
Example of Isomorphic Graphs
u2 v1
v5 v2
u1 u3
u5 u4 v4 v3
G H
Graph Isomorphism 3
Example of Isomorphic Graphs
G u1 u2 u3 u4 u5 H v1 v2 v3 v4 v5
u1 0 1 0 0 1 v1 0 0 1 1 0
u2 1 0 1 0 0 v2 0 0 0 1 1
u3 0 1 0 1 0 v3 1 0 0 0 1
u4 0 0 1 0 1 v4 1 1 0 0 0
u5 1 0 0 1 0 v5 0 1 1 0 0
G u1 u2 u3 u4 u5 H v1 v3 v5 v2 v4
u1 0 1 0 0 1 v1 0 1 0 0 1
u2 1 0 1 0 0 v3 1 0 1 0 0
u3 0 1 0 1 0 v5 0 1 0 1 0
u4 0 0 1 0 1 v2 0 0 1 0 1
u5 1 0 0 1 0 v4 1 0 0 1 0
Graph Isomorphism 4
Isomorphic Graph’s Invariant
Graph Isomorphism 5
Example of Non-Isomorphic Graphs
u2 v1
u1 u3 v5 v2
u5 u4 v4 v3
Graph Isomorphism 6
Are These Graphs Isomorphic?
u1 u2 v1 v2
v5 v3
u5 u4 u3 v4
G H
Graph Isomorphism 7
Are These Graphs Isomorphic?
u1 u2 v1 v2
v5 v3
u5 u4 u3 v4
G H
Graph Isomorphism 8
These Two Graphs Are Isomorphic
u1 u2 v1 v2
v5 v3
u5 u4 u3 v4
G H
G u1 u2 u3 u4 u5 H v1 v5 v2 v3 v4
u1 0 1 0 1 1 v1 0 1 0 1 1
u2 1 0 1 1 1 v5 1 0 1 1 1
u3 0 1 0 1 0 v2 0 1 0 1 0
u4 1 1 1 0 1 v3 1 1 1 0 1
u5 1 1 0 1 0 v4 1 1 0 1 0
Graph Isomorphism 9