0% found this document useful (0 votes)
38 views81 pages

Graph Theory: Module-2

The document covers graph theory concepts, focusing on Eulerian and Hamiltonian graphs, including definitions, properties, and examples of Euler paths, circuits, and operations on graphs. It also discusses directed graphs, types of digraphs, and their representation of binary relations. Additionally, it addresses the Traveling Salesman Problem as a Hamiltonian circuit challenge and provides insights into graph operations like union, intersection, and fusion.

Uploaded by

Shlok Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views81 pages

Graph Theory: Module-2

The document covers graph theory concepts, focusing on Eulerian and Hamiltonian graphs, including definitions, properties, and examples of Euler paths, circuits, and operations on graphs. It also discusses directed graphs, types of digraphs, and their representation of binary relations. Additionally, it addresses the Traveling Salesman Problem as a Hamiltonian circuit challenge and provides insights into graph operations like union, intersection, and fusion.

Uploaded by

Shlok Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 81

1

Graph theory: Module-2


Eulerian and Hamiltonian graphs: Euler graphs,
Operations on graphs, Hamiltonian paths and
circuits, Travelling salesman problem. Directed
graphs – types of digraphs, Digraphs and binary
relation.
EULER GRAPHS 2

 graph theory was born in 1736 with Euler’s famous paper in which
he solved the Königsberg bridge problem.

 In the same paper, Euler posed (and then solved) a more general
problem: In what type of graph G is it possible to find a closed
walk running through every edge of G exactly once? Such a
walk is now called an Euler line, and a graph that consists of an
Euler line is called an Euler graph.

 More formally:If some closed walk in a graph contains all the


edges of the graph, then the walk is called an Euler line and the
graph an Euler graph
3

 By its very definition a walk is always connected. Since the


Euler line (which is a walk) contains all the edges of the
graph, an Euler graph is always connected, except for any
isolated vertices the graph may have.
 Each edge to be traversed one and only once.

 Since isolated vertices do not contribute anything to the


understanding of an Euler graph,
THEOREM 2-4
 A given connected graph G is an Euler graph if and only if
all vertices of G are of even degree 4
5
6
EX 7

•This graph is a connected graph and all its vertices are of even degree.
•Therefore, it is an Euler graph.

Alternatively, the above graph contains an Euler circuit BACEDCB, so it is


an Euler graph.
Euler Path-
8
 Euler path is also known as Euler Trail or Euler
Walk.

 If there exists a Trail in the connected graph that


contains all the edges of the graph, then that trail
is called as an Euler trail.
OR
 If there exists a walk in the connected graph that
visits every edge of the graph exactly once with
or without repeating the vertices, then such a
walk is called as an Euler walk.
 A graph will contain an Euler path if and only if it contains
at most two vertices of odd degree.
Euler Graph Examples 9

BCDFBEDAB
10

Euler path doesnot exist


Euler Circuit 11
 If there exists a Circuit in the connected graph that contains all the
edges of the graph, then that circuit is called as an Euler circuit.
OR
 If there exists a walk in the connected graph that starts and ends at
the same vertex and visits every edge of the graph exactly once
with or without repeating the vertices, then such a walk is called as
an Euler circuit.
OR
 An Euler trail that starts and ends at the same vertex is called as an
Euler circuit.
OR
 A closed Euler trail is called as an Euler circuit.
 A graph will contain an Euler circuit if and only if all its vertices are
of even degree.
12
13
OPERATIONS ON GRAPHS 14

 The union of two graphs G1 = (V1, E1) and G2 = (V2, E2) is


another graph G3 (written as G3 = G1 ⋃ G2) whose vertex set
V3 = V1 ⋃ V2 and the edge set E3 = E1 ⋃ E2.
15
2) 16
17
Intersection of Graphs 18

 Given two graphs G and G2 with atleast one vertex in


common then their intersection will be a graph such that

 the intersection G1 ⋂ G2 of graphs G1 and G2 is a graph G4


consisting only of those vertices and edges that are in both G1
and G2.
19
2) 20
21
Ring Sum 22
 The ring sum of two graphs G1 and G2 (written as G1 ⊕ G2) is a
graph consisting of the vertex set V1 ⋃ V2 and of edges that are
either in G1 or G2, but not in both.
23
24
25
 Deletion: If vi is a vertex in graph G, then G — vi denotes a
subgraph of G obtained by deleting (i.e., removing) vi from 26
G.

 Deletion of a vertex always implies the deletion of all edges


incident on that vertex.
Find the deletion of the vertices 27
graph for
and
28
Find the deletion of the edge 29
e1 in the following graph
30
Fusion:
31
A pair of vertices a, b in a graph are said to be fused (merged or
identified) if the two vertices are replaced by a single new vertex
such that every edge that was incident on either a or b or on both
is incident on the new vertex.

 Thus fusion of two vertices does not alter the number of edges,
but it reduces the number of vertices by one.
Find the fusion of the following graph 32
when v1 fused with v2
33
HAMILTONIAN PATHS AND 34

CIRCUITS
 A Hamiltonian circuit in a connected graph is defined
as a closed walk that traverses every vertex of G
exactly once, except of course the starting vertex, at
which the walk also terminates.

 Hamiltonian Path in a graph G is a path that visits every


vertex of G exactly once and Hamiltonian Path doesn’t
have to return to the starting vertex. It’s an open path.
Hamiltonian Circuit Example 35
36
Does the Hamiltonian Path or 37
Circuit exists on the graph
38
Does a Hamiltonian path or circuit exist on the graph below? 39
40
41
Important 42

 The number of different Hamiltonian cycles in a complete


undirected graph on n vertices is (n – 1)!/2 and

 in a complete directed graph on n vertices is (n – 1)!.


Complete Graph 43

 Complete Graph: A simple graph in which there


exists an edge between every pair of vertices is
called a complete graph.

 A complete graph is sometimes also referred to as a


universal graph or a clique.
How many circuits would a 44
complete graph with 8 vertices
have?
45
TRAVELING-SALESMAN 46

PROBLEM
 Hamiltonian circuits is the traveling-salesman
problem, stated as follows: A salesman is required to
visit a number of cities during a trip. Given the
distances between the cities, in what order should
he travel so as to visit every city precisely once and
return home.
 Representing the cities by vertices and the roads
between them by edges, we get a graph. In this
graph, with every edge ei there is associated a real
number (the distance in miles, say), w(ei). Such a
graph is called a weighted graph; w(ei) being the
weight of edge ei..
EX 47
2) 48
49
Directed Graphs 50

 A directed graph G consists of a set of vertices V ={v1, v2, . . .}, a


set of edges E = {e1, e2, . . .}, and a mapping Ψ that maps every
edge onto some ordered pair of vertices (vi, vj).

 A directed graph, also called a digraph, is a graph in which the


edges have a direction.
51
 In a digraph an edge is not only incident on a vertex,
but is also incident out of a vertex and incident into a
vertex.

 The number of edges incident out of a vertex vi is


called the out-degree (or out-valence or outward
demidegree) of vi and is written d+(vi). The number of
edges incident into vi is called the in-degree (or
invalence or inward demidegree) of v1 and is written
as d−(vi).
52
53

In any digraph G the sum of all in-degrees is equal to the


sum of all out-degrees, each sum being equal to the
number of edges in G; that is,

 An isolated vertex is a vertex in which the in-degree


and the out-degree are both equal to zero
Directed Acyclic Graph 54
 Directed acyclic graphs, which are also sometimes
referred to as DAGs, are specific names given
to acyclic graphs.
 Here, acyclic means "without cycles." So we can say
that the edges in a DAG are directed, meaning they
have a specific flow direction, and the graph itself is
acyclic, meaning there are no cycles or loops.
Degree in Diagraph 55
Prove that in any digraph the sum of the in-degrees of all vertices is
equal to the sum of their out-degrees; and this sum is equal to the
number of edges in the digraph.
56
57

Any directed edge(u,v) contributes 1 to the indegree of u and 1 to the


Outdegree of v
Find the digraph the sum of the in-degrees of all 58
vertices is equal to the sum of their out-degrees;
and this sum is equal to the number of edges in
the digraph.
59

Sum of Indegree(V) = 8
Sum of Outdegree(V) = 8
Number of edges = 8
Types of Diagraph 60

 Symmetric Diagraph :Diagraph in which for every


edge (a,b) there is also an edge (b,a).

 Asymmetric Diagraph : Diagraph that have atmost


one directed edge between a pair of vertices but
are allowed to have self loop.

 Simple Diagraph: A diagraph that have no self loop


and no parallel edges.
 Complete Diagraph: A complete digraph is a directed
graph in which every pair of distinct vertices is connected by a
pair of unique edges (one in each direction).
61
62
Digraph representation of 63
binary relations
 A binary relation on a set can be represented by a digraph.

Let R be a binary relation on a set A, that is R is a subset of A *A.


Then the digraph, call it G, representing R can be constructed as follows:
1. The vertices of the digraph G are the elements of A, and
2. <x, y> is an arc of G from vertex x to vertex y if and only if <x, y> is in R.
64

 Every binary relation on a finite set can be


represented by a digraph without parallel edges.

 Conversely, every digraph without parallel edges


defines a binary relation on the set of its vertices.
65
66
1)Consider the relation for the graph tells us
that s is a relation on A={1,2,3} and
that s={(1,2),(2,1),(1,3),(3,1),(2,3),(3,3)}.
Draw its directed graph
67
68
2)Let A={0,1,2,3},𝐴={0,1,2,3}, and let
r={(0,0),(0,3),(1,2),(2,1),(3,2),(2,0)},
Draw the diagraph

3)
69
70
71
72
73
74
75
76

Reflexive- Self loop


symmetric property –N o Closed loop,so no symmetric property
Antisymmetric- No closed loop between the vertices
Transitive-
77
78

Check the different properties of graph


1) Is R reflexive
3€A but 3Ŕ3
i.e (3,3) ≠ R

2) Is R Symmetric?
4R2 but no 2R4
(4,2) € R but (2,4) ≠ R

3) Is R Transitive?
4R2 and 2R3 but not 4R3

4)Is R antisymmetric?
2R3 and 3R2 but 2 ≠3
79
80
https://slideplayer.com/slide/1526 81
2998/

You might also like