3 Graph Theory 1684054250291
3 Graph Theory 1684054250291
Nisha Mittal
Types of Graphs
Isomorphic Graph
Homomorphism Graph Hamilton path
Bipartite Graph
Complete Bipartite graph
Hamilton Circuit
Euler path K-regular graph
Euler Circuit
Planar Graphs
Graph Coloring
Complete Graph
Graph Theory
Isolated Nodes:
a node which is not adjacent to any other node is called isolated
node.
Edge Type
Directed: Ordered pair of vertices. Represented as (u, v) directed from vertex
u to v.
u v
u v
Edge Type
• Self Loop: An Edge which joins a vertex to itself is called a
loop. Represented as {u, u} = {u}
a
• Parallel (Multiple) Edges: Two or more edges joining the
same pair of vertices.
Graph Type
Undirected Graph A graph in which every edge is undirected is
known as Undirected Graph
Representation Example: G(V, E), V = {u, v, w}, E = {{u, v}, {v, w}, {u, w}}
u v
w
Graph Type
Multigraph: Any graph which contains some parallel edges is called
multigraph
u
1 2 w
v 3
Graph Type
Directed Graph: A graph in which every edge is directed
u v
w
Undirected graphs
• u and v are adjacent if {u, v} is an edge, e is called incident with u and v. u and v are
called endpoints of {u, v}
• Degree of Vertex (deg (v)): the number of edges incident on a vertex. A loop
contributes twice to the degree (why?).
deg- (u) = 0
deg+ (u) = 2
deg- (v) = 1,
u v deg+ (v) = 1
deg- (w) = 2,
w deg+ (w) = 0
If all the vertices have same degree then the graph is called REGULAR GRAPH
If the degree of each vertex is k then the graph is called K-Regular Graph
Every complete Graph is a regular graph but Every regular graph need not to be complete.
u4 v1 v2
u3
v3 v4
u3 u2
Homomorphic Graph
• We can obtain a new graph by dividing an edge of G with additional vertices. The
graph G and G* are said to be homomorphic if they can be obtained from the
same graph.
Homomorphic Graph
V1 V2
V4
V3
Bipartite graphs
• A graph G=(V,E) is called Bipartite graph , if its vertices V can be
partitioned into two subsets V1 and V2 such that each edge of G
connects a vertex V1 to a vertex V2
V = { V1, V2 , V3, V4}
V1’= {V1, V3}
V2’={V2,V4} V2
V1
V4
V3
Complete Bipartite graphs
• Where every Vertex of V1 is adjacent to every vertex of V2, Where V1
and V2 are two partitioned subsets of vertex set V of G.
Representation example: K2,3, K3,3
K2,3 K3,3
Euler Path , Euler Circuit , Hamilton path
Eulerian path (Eulerian trail, Euler walk) in a graph is a path whose edge list
contains each edge of the graph exactly once.
Eulerian cycle (Eulerian circuit, Euler tour) it is a path through a graph in which
initial vertex appears second time as terminal vertex.
Hamilton Path:- It is a path whose vertex list contains each vertex exactly once.
Euler Path , Euler Circuit , Hamilton path
Eulerian path (Eulerian trail, Euler walk) in a graph is a path whose edge list contains each edge of the graph exactly once.
An Euler path is a path that uses every edge in a graph with no repeats. Being a path, it does not have to return to the starting
vertex.
Eulerian cycle (Eulerian circuit, Euler tour) it is a path through a graph in which initial vertex appears second time as terminal
vertex.
An Euler circuit is a circuit that uses every edge in a graph with no repeats. Being a circuit, it must start and end at the same
vertex.
(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.
a) The sum of the degrees of all the vertices of a graph equals twice the number
of edges.
(b) A graph always has an even number of odd vertices.
0 Graph has Euler circuit(s)
1, 3, 5, . . . Impossible!
Hamiltonian Graph
• Hamiltonian path is a path that visits each vertex exactly once.
• A Hamiltonian cycle is a cycle that visits each vertex exactly once (except for the starting vertex, which is visited once at the
start and once again at the end).
• A graph that contains a Hamiltonian path is called a traceable graph. A graph that contains a Hamiltonian cycle is called a
Hamiltonian graph.
• Any Hamiltonian cycle can be converted to a Hamiltonian path by removing one of its edges, but a Hamiltonian path can be
extended to Hamiltonian cycle only if its endpoints are adjacent.
Hamiltonian Graph
• The Hamiltonian cycle problem or Hamiltonian circuit problem in graph theory is to find a Hamiltonian cycle in a given graph.
The Hamiltonian path problem is to find a Hamiltonian path in a given graph.
• There is a simple relation between the two problems. The Hamiltonian path problem for graph G is equivalent to the
Hamiltonian cycle problem in a graph H obtained from G by adding a new vertex and connecting it to all vertices of G.
• Both problems are NP-complete. However, certain classes of graphs always contain Hamiltonian paths. For example, it is
known that every tournament has an odd number of Hamiltonian paths.
Hamiltonian Graph
• DIRAC’S Theorem: if G is a simple graph with n vertices with n ≥ 3
if degree of each vertex deg(v)≥ n/2
Then graph has Hamilton circuit.
K4
Planar Graphs
Planar Graphs
• Representation examples: K3,3 is Nonplanar
v1 v2 v3 v1 v5 v1 v5
R21
R2 R1 R1
R22
v3
v4 v5 v6 v4 v2 v4 v2
Planar Graphs
Theorem : Euler's planar graph theorem
For a connected planar graph or multigraph:
v–e+r=2
number number
number
of vertices of regions
of edges
Planar Graphs
Example of Euler’s theorem
A planar graph divides the plane
R1
K4 R2 R4 into several regions (faces), one
of them is the infinite region.
R3 v=4,e=6,r=4, v-e+r=2
Planar Graphs
• Kuwratoski’s Theorem: A graph is non-planar if and only if it contains a subgraph
homeomorephic to K3,3 or K5
Representation
b Example: G is
a Nonplanar
b b
a
c a
j
c d
h e c
i
k e
d
g f d
e H K5
g
f
G
Vertex Coloring Problem
• An assignment of colors to the vertices of a graph G, so that no two adjacent vertices have same color is called vertex
coloring.
• If G is null X(G)=1
• A graph that can be assigned a (proper) k-coloring is k-colorable, and it is k-chromatic if its chromatic number is exactly k.
Vertex Coloring Problem
• The chromatic number for Cn = 3 (n is odd) or 2 (n is even), Kn = n, Km,n = 2
C4 C5 K4 K2, 3
Vertex Covering Problem
• The Four color theorem: Every planer graph G is 4 colorable
• Example: G1 chromatic number = 3, G2 chromatic number = 4
G1 G2