What Is Graph Isomorphism?: Necessary Conditions For Two Graphs To Be Isomorphic
What Is Graph Isomorphism?: Necessary Conditions For Two Graphs To Be Isomorphic
Graph Isomorphism is a phenomenon of existing the same graph in more than one forms. Such graphs
are called as isomorphic graphs.
Condition-04: If a cycle of length k is formed by the vertices { v1 , v2 , ….. , vk } in one graph, then a
cycle of same length k must be formed by the vertices { f(v1) , f(v2) , ….. , f(vk) } in the other graph as well.
NOTE-
• It is important to note that the above four conditions are just the necessary conditions for two graphs to
be isomorphic. They are not sufficient to prove that the two graphs are isomorphic.
• Even if all the above four conditions are satisfied by the two graphs, then also we can’t say that the two
graphs will surely be isomorphic.
• However, if any of the above four conditions violate, then we can surely say that the two graphs will
never be isomorphic.
Sufficient conditions for two graphs to be Isomorphic-
The following conditions are the sufficient conditions for two graphs to be isomorphic. If any of these
conditions satisfy, then we can surely say that the two graphs are isomorphic.
Condition-01: Two graphs are isomorphic if and only if their complement graphs are isomorphic.
Condition-02: Two graphs are isomorphic if their adjacency matrices are same.
Condition-03: Two graphs are isomorphic if their corresponding sub graphs obtained by the deletion
of some vertices of one graph and their corresponding images in the other graph are isomorphic.
Problem-01:
Are the following two graphs isomorphic?
Solution-
Check necessary conditions-
Condition-01:
• Number of vertices in graph G1 = 4
• Number of vertices in graph G2 = 4
Condition-01 satisfies here because both the graphs G1 and G2 have same number of vertices. So, they
may be isomorphic.
Condition-02:
• Number of edges in graph G1 = 5
• Number of edges in graph G2 = 6
Condition-02 violates here because both the graphs G1 and G2 have different number of edges. So, they
can not be isomorphic.
Therefore,
G1 and G2 are not isomorphic graphs.
Problem-02:
Which of the following graphs are isomorphic?
Solution-
Check necessary conditions-
Condition-01:
• Number of vertices in graph G1 = 4
• Number of vertices in graph G2 = 4
• Number of vertices in graph G3 = 4
Condition-01 satisfies here because all the graphs G1, G2 and G3 have same number of vertices.
Condition-02:
• Number of edges in graph G1 = 5
• Number of edges in graph G2 = 5
• Number of edges in graph G3 = 4
Condition-02 satisfies here for the graphs G1 and G2 because they have same number of edges. So,
they may be isomorphic. However, condition-02 violates here for the graphs (G1,G2) and G3 because
they have different number of edges.
Therefore,
G3 can neither be isomorphic to G1 nor isomorphic to G2.
Now, let us continue to check for the graphs G1 and G2.
Condition-03:
• Degree Sequence of graph G1 = { 2 , 2 , 3 , 3 }
• Degree Sequence of graph G2 = { 2 , 2 , 3 , 3 }
Condition-03 satisfies here because both the graphs G1 and G2 have same degree sequence. So, they
may be isomorphic.
Condition-04:
• Both the graphs contain two cycles each of length 3 formed by the vertices having degrees { 2 , 3 , 3 }
Condition-04 satisfies here because both the graphs G1 and G2 have same cycles in them. So, they may
be isomorphic.
Since, all the necessary conditions are satisfied, therefore the graphs G1 and G2 may be isomorphic.
Now, let us check the sufficient condition.
Check sufficient condition-
By sufficient conditions, we know that the two graphs are isomorphic if and only if their complement
graphs are isomorphic. So, let us draw their complement graphs-
Clearly, Complement graphs of G1 and G2 are isomorphic.
Therefore,
Graphs G1 and G2 are isomorphic graphs.
Problem-03:
Are the following two graphs isomorphic?
Solution-
Check necessary conditions-
Condition-01:
• Number of vertices in graph G1 = 8
• Number of vertices in graph G2 = 8
Condition-01 satisfies here because both the graphs G1 and G2 have same number of vertices. So, they
may be isomorphic.
Condition-02:
• Number of edges in graph G1 = 10
• Number of edges in graph G2 = 10
Condition-02 satisfies here because both the graphs G1 and G2 have same number of edges. So, they
may be isomorphic.
Condition-03:
• Degree Sequence of graph G1 = { 2 , 2 , 2 , 2 , 3 , 3 , 3 , 3 }
• Degree Sequence of graph G2 = { 2 , 2 , 2 , 2 , 3 , 3 , 3 , 3 }
Condition-03 satisfies here because both the graphs G1 and G2 have same degree sequence. So, they
may be isomorphic.
Condition-04:
In graph G2, the degree-3 vertices form a cycle of length 4 but in graph G2, the degree-3 vertices do not
form a 4-cycle as the vertices are not adjacent.
Condition-04 violates here because both the graphs G1 and G2 do not contain same cycles in them. So,
they can not be isomorphic.
Therefore,
G1 and G2 are not isomorphic graphs.
Hamiltonian Graph-
If there exists a closed walk in the connected graph that visits every vertex of the graph exactly once
(except starting vertex) without repeating the edges, then such a graph is called as a Hamiltonian graph.
OR
Any connected graph that contains a Hamiltonian circuit is called as Hamiltonian Graph.
Example-
Hamiltonian Path-
• If there exists a walk in the connected graph that visits every vertex of the graph exactly once without
repeating the edges, then such a walk is called as Hamiltonian path.
OR
• If there exists a path in a connected graph that contains all the vertices of the graph, then such a path is
called as Hamiltonian path.
Note- In Hamiltonian path, all the edges may or may not be covered but edges must not repeat.
Examples-
Hamiltonian Circuit-
• If there exists a walk in the connected graph that visits every vertex of the graph exactly once (except
starting vertex) without repeating the edges and returns to the starting vertex, then such a walk is called
as Hamiltonian circuit.
OR
• If there exists a cycle in a connected graph that contains all the vertices of the graph, then that cycle is
called as Hamiltonian circuit.
OR
• A Hamiltonian path which starts and ends at the same vertex is called as Hamiltonian circuit.
OR
• A closed Hamiltonian path is called as Hamiltonian circuit.
Examples-
NOTES-
• Any Hamiltonian circuit can be converted to a Hamiltonian path by removing one of its edges.
• Every graph that has a Hamiltonian circuit also has a Hamiltonian path but vice versa is not true.
• There may exist more than one Hamiltonian paths and Hamiltonian circuits in a graph.
• Hamiltonian circuit is also sometimes called as Hamiltonian cycle.
Solution-
A)
The graph neither contains a Hamiltonian path nor it contains a Hamiltonian circuit.
Since, graph does not contain a Hamiltonian circuit, therefore graph is not a Hamiltonian Graph.
B)
The graph neither contains a Hamiltonian path nor it contains a Hamiltonian circuit.
Since, graph does not contain a Hamiltonian circuit, therefore graph is not a Hamiltonian Graph.
C)
The graph contains both a Hamiltonian path (ABCDHGFE) and a Hamiltonian circuit (ABCDHGFEA).
Since, graph contains a Hamiltonian circuit, therefore graph is a Hamiltonian Graph.
D)
The graph contains both a Hamiltonian path (ABCDEFG) and a Hamiltonian circuit (ABCDEFGA).
Since, graph contains a Hamiltonian circuit, therefore graph is a Hamiltonian Graph.
E)
The graph neither contains a Hamiltonian path nor it contains a Hamiltonian circuit.
Since, graph does not contain a Hamiltonian circuit, therefore graph is not a Hamiltonian Graph.
F)
The graph contains both a Hamiltonian path (ABCDEFGHI) and a Hamiltonian circuit (ABCDEFGHIA)
Since, graph contains a Hamiltonian circuit, therefore graph is a Hamiltonian Graph.
Euler Graph-
Definition-01:
Any connected graph is called an Euler Graph if and only if all its vertices are of even degree.
Thus, for any graph to be an Euler graph, following two conditions must be satisfied-
1. Graph must be connected.
2. All the vertices must be of even degree.
Example-
As per the definition, this graph is an Euler Graph because the graph is connected and all its vertices are
of even degree.
Definition-02:
An Euler Graph is a connected graph that contains an Euler Circuit.
Example-
As per the definition, this graph is an Euler Graph because it contains an Euler Circuit BACEDCB.
Examples-
Semi-Euler Graph-
If a connected graph contains an Euler trail but does not contain an Euler circuit, then such a graph is
called as semi-Euler graph.
Thus, for a graph to be a semi-Euler graph, following two conditions must be satisfied-
1. Graph must be connected.
2. Graph must contain an Euler trail.
Example-
This graph contains an Euler trail BCDBAD but does not contain an Euler circuit. Therefore, this graph is a
semi-Euler graph.
Graph Coloring-
• Graph coloring also called as Vertex coloring is a process of assigning colors to all the vertices of the
graph such that no two adjacent vertices of it are assigned the same color.
• In other words, there must not be any edge in the graph whose end vertices are colored with the same
color. Such a graph is called as properly colored graph.
Example-
In this graph, no two adjacent vertices have the same color and therefore this graph is a properly colored
graph.
In this graph, no two adjacent vertices have the same colors and the minimum number of colors = 3 have
been used to color the vertices.
Therefore,
Chromatic number of this graph = 3
We can not properly color this graph with less than 3 colors.
Chromatic Number
• If number of vertices in cycle graph is even, then its chromatic number = 2
• If number of vertices in cycle graph is odd, then its chromatic number = 3
Examples-
2. Planar Graphs-
A planar graph is a graph that can be drawn in a plane such that none of its edges cross each other.
Chromatic Number
Chromatic Number of Planar Graphs = Less than or equal to 4
Examples-
All the above cycle graphs are also planar graphs where chromatic number of each graph is less than or
equal to 4.
3. Complete Graphs-
• A complete graph is a graph in which every two distinct vertices are joined by exactly one edge.
• In a complete graph, because each vertex is connected with every other vertex, so we need as many
different colors as there are number of vertices in the given graph in order to properly color the graph.
Chromatic Number
Chromatic Number of Complete Graphs = Number of vertices in the Complete
Graph
Examples-
4. Bipartite Graphs-
A bipartite graph consists of two sets of vertices X and Y. The edges only join vertices in X to vertices in
Y, not vertices within a set.
Chromatic Number
Chromatic Number of Bipartite Graphs = 2
Example-
5. Trees-
• A tree is a special type of connected graph in which there are no circuits.
• Every tree is a bipartite graph, so chromatic number of tree with n vertices = 2.
Chromatic Number
Chromatic Number of any tree = 2
Examples-