#Graph Theory
#Graph Theory
We hereby declare that the Project Report, entitled “GRAPH THEORY AND ITS APPLICATIONS”,
submitted to the Department of Mathematics(SF), PSG College of Arts & Science, Coimbatore, in partial
fulfilment of the requirements for the award of degree of Bachelor of Science in Mathematics, of the
Bharathiar University is a record of original project work done by us during the year 2020 –2021 under the
supervision and guidance of Dr.V.Nithya M.Sc., M.Phil.,Ph.D.,Assistant Professor of Mathematics (SF), PSG
College of Arts & Science,Coimbatore, and it has not formed the basis for award of any Degree / Diploma /
Associateship / Fellowship or other similar title to any candidate of any University.
1. PRAVEENA R 19BMA129
2. SHIVADASS R D 19BMA138
3. SIVARANJANI A 19BMA140
during the period 2021– 2022 of their study in the Department of Mathematics (Unaided) at
PSG College of Arts & Science, under supervision and guidance and the project has not formed
the basis for the award of any Degree / Diploma / Associate ship / Fellowship or other similar
title to any candidate of any University.
Signature of the Guide
Counter signed
Head of the Department
ACKNOWLEDGEMENT
ACKNOWLEDGEMENT
We express our deep gratitude and pleasure to thank our guide of Dr.V.Nithya M.Sc., M.Phil.,Ph.D.,
Assistant Professor of Mathematics (SF), PSG College of Arts & Science, Coimbatore, for her constant
encouragement and valuable guidance throughout the
preparation of the project report.
We express our sincere thanks to Prof. T. KANNIAN, Secretary of PSG College of Arts
& Science, Coimbatore, for providing all the facilities in the college to complete the project
successfully.
We wish to thank Dr. D. BRINDHA, M.Sc.,M.Phil.,PhD., Principal of PSG College of
Arts & Science, Coimbatore for her kind help in completing this project successfully.
We wish to thank Dr. A. ANGURAJ, MSc.,MPhil.,PhD., Vice Principal (Academics),
Dr.M. JAYANTHI, MCom.,MBA.,MPhil.,PhD.,Vice Principal (Student affairs), PSG
College of Arts & Science, Coimbatore, for their support for this project completion.
We wish to thank Ms. M. UMARANI, MCom.,MPhil., Faculty In - Charge (Student
Affairs) of PSG College of Arts & Science, Coimbatore, for her kind support for
completing this project successfully.
We offer our gratitude to Dr. M. LATHA MAHESWARI, M.Sc.,M.Phil.,PhD.,PGDCA,
Head, Department of Mathematics (SF), PSG College of Arts & Science, Coimbatore,
for helping and continuous encouragement during the entire course of study.
It is our privilege to acknowledge all the Staff Members in the Department of Mathematics
(SF), for their kind and encouragement throughout our project work.
We express our heartfelt thanks to our Parents and Friends for their good support. Above
all we thank the Almighty for His grace.
1. PRAVEENA R 19BMA129
2. SHIVADASS R D 19BMA138
3. SIVARANJANI A 19BMA140
CONTENTS
CONTENTS:
1. INTRODUCTION TO GRAPH THEORY
1.1 Graph
1.2 Graph theory
1.3 Graph coloring
1.4 Origin of graph theory
1.5 History of graph theory
1.6 Basic definitions of graph theory
1.6.1 Vertex
1.6.2 Edge
1.6.3 Degree of vertex
1.6.4 Path
1.6.5 Circuit
1.7 Types of graph
1.8 Incidence and degree
1.9 First theorem in graph theory
1.10 Isolated vertex,Pendant vertex and Null graph
1.11 Subgraph
1.11.1 Edge disjoint sugraph
1.12 Walk
1.13 Path and Connections
1.13.1 Simple graph and complete graph
1.14 Circuit
2. EULER GRAPH AND HAMILTON CYCLES
Conclusion
References
CHAPTER 1
1.1. GRAPH:
In one restricted but very common sense of the term, a graph is an ordered pair comprising:
A set of vertices (also called nodes or points); E({{x,y} | x,y ∈ V and x≠y} A set of edges (also
called links or lines), which are unordered pairs of vertices (that is, an edge is associated with two distinct
vertices).
To avoid ambiguity, this type of object may be called precisely an undirected simple graph.In the edge{x,y}, the
vertices x and y are called the endpoints of the edge. The edge is said to join x and y and to be incident on x
and on y. A vertex may exist in a graph and not belong to an edge. Multiple edges, not allowed under the
definition above, are two or more edges that join the same two vertices.
In one more general sense of the term allowing multiple edges, a graph is an ordered
triple G=(V,E,∅) comprising:
∅:E→{{x,y} | x,y ∈ V and x≠y}, an incidence function mapping every edge to an unordered pair of vertices
(that is, an edge is associated with two distinct vertices).
To avoid ambiguity, this type of object may be called precisely an undirected multigraph.
A loop is an edge that joins a vertex to itself. Graphs as defined in the two definitions above cannot have loops,
because a loop joining a vertex x to itself is the edge (for an undirected simple graph) or is incident on (for an
undirected multigraph) {x,x}={x} which is not in {{x,y} | x,y ∈ 𝑉 and x≠y}.So to allow loops the definitions
must be expanded. For undirected simple graphs, the definition of should be modified to
E∈{{x,y} | x,y ∈ V }.For undirected multigraphs, the definition of ∅ should be modified to ∅:E→{{x,y} | x,y ∈
V}.To avoid ambiguity, these types of objects may be called undirected simple graph permitting
loops and undirected multigraph permitting loops, respectively.
V and E are usually taken to be finite, and many of the well-known results are not true (or are rather different)
for infinite graphs because many of the arguments fail in the infinite case. Moreover, V is often assumed to be
non-empty, but E is allowed to be the empty set. The order of a graph is |V| , its number of vertices. The size of
a graph is |E|, its number of edges. The degree or valency of a vertex is the number of edges that are incident to
it, where a loop is counted twice. The degree of a graph is the maximum of the degrees of its vertices.
In an undirected simple graph of order n, the maximum degree of each vertex is n − 1 and the maximum size of
the graph is n(n − 1)/2.
The edges of an undirected simple graph permitting loops G induce a symmetric homogeneous relation ~ on the
vertices of G that is called the adjacency relation of G . Specifically, for each edge(x,y) , its endpoints x and
y are said to be adjacent to one another, which is denoted x ~y
Graph Theory is a branch of Mathematics in which we study graphs .Graphs are mathematical structures which
consists of a set V of vertices and set E of edges.In mathematics, graph theory is the study of graphs, which are
mathematical structures used to model pairwise relations between objects. A graph in this context is made up of
vertices (also called nodes or points) which are connected by edges (also called links or lines). A distinction is
made between undirected graphs, where edges link two vertices symmetrically, and directed graphs, where
edges link two vertices asymmetrically. Graphs are one of the principal objects of the study in discrete
mathematics
1.3. Graph drawing:
Graphs are represented visually by drawing a point or circle for every vertex, and drawing a line between two
vertices if they are connected by an edge. If the graph is directed, the direction is indicated by drawing an
arrow.
A graph drawing should not be confused with the graph itself (the abstract, non-visual structure) as there are
several ways to structure the graph drawing. All that matters is which vertices are connected to which others by
how many edges and not the exact layout. In practice, it is often difficult to decide if two drawings represent the
same graph. Depending on the problem domain some layouts may be better suited and easier to understand than
others.
The pioneering work of W. T. Tutte was very influential on the subject of graph drawing. Among other
achievements, he introduced the use of linear algebraic methods to obtain graph drawings.
Graph drawing also can be said to encompass problems that deal with the crossing number and its various
generalizations. The crossing number of a graph is the minimum number of intersections between edges that a
drawing of the graph in the plane must contain. For a Planner graph, the crossing number is zero by definition.
Graph coloring:
In a 1670 letter to Christian Huyge ns (1629–1695), the celebrated philosopher and mathematician Gottfried W.
Leibniz (1646–1716) wrote as follows:
Known today as the field of Topology, Leibniz’s Geometry of Position was slow to develop as a mathematical
field. As C. F. Gauss (1777–1855) noted in 1833,
The ‘feeble glance’ which Leonhard Euler(1707–1783) directed towards the geometry of position consists of a
single paper now considered to be the starting point of modern graph theory. The paper published by Euler
appeared in Commentarii Academiae Scientiarum Imperialis Petropolitanae in 1736 on the Seven Bridges of
Konigsberg is regarded as the first paper in the history of graph theory. He created first graph to simulate a real
time place and situation to solve a problem which was then considered one of the toughest problems. Yet from
such deceptively simple origins, graph theory has grown into a powerful and deep mathematical theory with
applications in the physical, biological, and social sciences.
The basic idea of graphs were first introduced in the 18th century by Swiss mathematician Leonhard Euler. His
attempts & eventual solution to the famous Königsberg bridge problem depicted below are commonly quoted
as origin of graph theory:
The German city of Königsberg (present-day Kaliningrad, Russia) is situated on the Pregolya river. The
geographical layout is composed of four main bodies of land connected by a total of seven bridges. The
question posed to Euler was straightforward: was it was possible to take a walk through the town in such a way
as to cross over every bridge once, and only once (known as a Euler walk)
Euler, recognizing that the relevant constraints were the four bodies of land & the seven bridges, drew out
the first known visual representation of a modern graph. A modern graph, as seen in bottom-right image C,
is represented by a set of points, known as vertices or nodes, that connected by a set of connecting lines
known as edges.
Fig 1.1
By first attempting to draw paths in the graph above, then later experimenting with multiple theoretical
graphs with alternating number of vertices & edges, he eventually extrapolated a general rule:
In order to be able to walk in an Euler path (aka without repeating an edge), a graph can have none or two odd
number of nodes?
From there, the branch of math known as graph theory lay dormant for decades.In modern times, however,it’s
application is finally exploring.
1.6.1. Vertex:
“Vertex” is a synonym for a node of a graph, i.e., one of the points on which the graph is defined and
which may be connected by graph edges.
A Vertex is a corner where edges meet.
A Vertex of a graph is one of the objects that are connected together.
1.6.2. Edge:
An edge (or link) of a network (or graph) is one of the connected between the nodes(or vertices) of the
network.
The connection between the vertices are called edges or links.
The degree of a vertex is the number of edges incident with that vertex.
1.6.4. Path:
A path may follow a single edge directly between two vertices, or it may follow multiple vertices.
A path is a sequence of vertices with the property that each vertex in the sequence is adjacent to
the vertex next to it
A path that does not repeat vertices is called a simple path.
1.6.5. Circuit:
Example:
Fig 1.2
Vertices:A,B,C,D
Edges: AB,BC,BD,AA,AC,AD
Degree of vertex:A-5,B-3,C-3,D-3
Path:A-B-D
Circuit: A-B-C-D
1. Null graph
2. Trivial graph
3. Simple graph
4. Undirected graph
5. Directed graph
6. Complete graph
7. Connected graph
8. Disconnected graph
9. Cycle graph
10. Acyclic graph
11. Regular graph
12. Bipartite graph
13. Complete bipartite graph
14. Star graph
15. Weighted graph
16. Multi graph
17. Planar graph
18. Non planar graph
When a vertex 𝒗𝒊 is an end vertex of some edge 𝒆𝒋 , 𝒗𝒊 and 𝒆𝒋 are said to be incident with (on or to) each other.
In Fig. 1.3, for example, edges 𝒆𝟐 , 𝒆𝟔 and 𝒆𝟕 are incident with vertex 𝒆𝟕 . Two nonparallel edges are said to be
adjacent if they are incident on a common vertex. For example, 𝒆𝒋 and 𝒆𝟕 in Fig. 1.3 are adjacent. Similarly,
two vertices are said to be adjacent if they are the end vertices of the same edge. In Fig. 1.3, 𝒗𝟒 and 𝒗𝟓 are
adjacent, but 𝒗𝟏 and 𝒗𝟒 are not. The number of edges incident on a vertex 𝒗𝒊 , with self-loops counted twice, is
called the degree, d(𝒗𝒊 ) of vertex 𝒗𝒊. In Fig. 1.3, for example, d(𝒗𝟏 ) = d(𝒗𝟑 ) = d(𝒗𝟒 ) = 3, d(𝒗𝟐 ) = 4, and
d(𝒗𝟓) = 1. The degree of a vertex is sometimes also referred to as its valency.
Fig 1.3
Let us now consider a graph G with e edges and n vertices 𝒗𝟏 , 𝒗𝟐 ,……, 𝒗𝒏 Since each edge contributes two
degrees, the sum of the degrees of all vertices in G is twice the number of edges in G. That is,
𝑛
∑𝑖=1 𝑑(𝑣𝑖) = 2𝑒 (1.1)
Statement:
Proof:
If we consider the vertices with odd and even degrees separately,the quantity in the left side of equation 1.1 can
be expressed as the sum of two sums,each taken over vertices of even and odd degrees,respectively as follows:
𝑛
∑𝑖=1 𝑑(𝑣𝑘) = ∑𝑒𝑣𝑒𝑛 𝑑(𝑣𝑗) + ∑𝑜𝑑𝑑 𝑑( 𝑣𝑘) (1.2)
Since the left hand side in equation 1.2 is even and the first expression on the right hand side is even ,the second
expression must:
Because in equation (1.3) each 𝑑(𝑣𝑘) is odd,the total number of terms in the sum must be even to make the sum
of an even number .
A vertex having no incident edge is called an isolated vertex. In other words, isolated vertices are vertices with
zero degree. Vertices 𝑣4 and 𝑣7 in Fig. 1.4, for example, are isolated vertices. A vertex of degree one is called
a pendant vertex or an end vertex. Vertex 𝒗𝟑 in Fig. 1.4 is a pendant vertex. Two adjacent edges are said to be
in series if their common vertex is of degree two. In Fig. 1.4, the two edges incident on are in series.
Fig 1.4
In the definition of a graph G = (V, E), it is possible for the edge set E to be empty. Such a graph, without
any edges, is called a null graph. In other words, every vertex in a null graph is an isolated vertex. A null
graph of six vertices is shown in Fig. 1.5. Although the edge set E may be empty, the vertex set V must not
be empty; otherwise, there is no graph. In other words, by definition, a graph must have at least one vertex.
Fig 1.5
1.11. Subgraph:
A graph g is said to be a subgraph of a graph G if all the vertices and all the
edges of g are in G, and each edge of g has the same end vertices in g as in G.
Fig 1.5
Fig a Fig b
1.12. Walk:
A walk is defined as a finite alternating sequence of vertices and edges,
beginning and ending with vertices, such that each edge is incident with the
vertices preceding and following it. No edge appears (is covered or traversed)
more than once in a walk. A vertex, however, may appear more than once. In
Fig (a), for instance,𝑣1 a 𝑣2 b 𝑣3 c 𝑣3 d 𝑣4 𝑒 𝑓 𝑣5is a walk shown with
heavy lines. A walk is also referred to as an edge train or a chain. The set of
vertices and edges a given walk in a graph G is clearly a subgraph of
G.
Vertices with which a walk begins and ends are called its terminal vertices.
Such a walk is called a closed walk. A walk that is not closed (i.e., the terminal vertices are distinct) is called
an open walk
1.13. Path and connection:
A graph is defined to be a simple graph if there is at the most one edge connecting any pair of vertices and an
edge does not loop to connect a vertex to itself.
A complete graph is a graph that has an edge between every single vertex in the graph; we represent a
complete graph with n vertices using the symbol Kn.
v1, v2,v3,…… vk−1of its vertices; hence a walk in a simple graph can be specified
simply by its vertex sequence. Moreover, even in that are not simple,
We shall sometimes refer to a sequence of vertices in graph which consecutive
terms are adjacent as a 'walk'. In such cases it. should be understood that the
discussion is valid for every walk with that vertex sequence.
Fig 1.6
(a) A connected graph; (b) a disconnected graph with three components.
vertices u and v are connected if and only if both u and v belong to the
same set Vi. The subgraphs G[V1],G[V2], ••• , G[Vω] are called the components
,of G. If G has exactly one component, G is connected; otherwise G
is disconnected. We denote the number of components of G by ω( G)..
1.14. Circuit:
A circuit is also called a cycle, elementary cycle, circular path, and polygon.
In electrical engineering a circuit is sometimes referred to as a loop—not to be
confused with self-loop. (Every self-loop is a circuit, but not every circuit is a
self-loop.)
Problems:
1. Show that there exists no graph G=(V,E) with |V| = 48 vertices such that the degrees of 30 of the vertices
are 16,the degrees of 15 vertices is 9 and the degree of the remaining 3 vertices is 12.
Solution:The number of odd-degree vertices is even, and thus no such graph can exist, since it should have 15
vertices of degree 9. Alternatively, the sum of the degrees of the vertices is twice the number of edges and
therefore even. However 30×16+15×9+3×12.
Let graph G=(V,E) be a (p,q) graph. Complement of the graph is a graph V(𝑮̅ ) = V(G) and E( 𝑮̅)= {xy : xy ∉ E
(G), x, y ∈V (G)}. From the above definition, we can say that complement of a graph has, V(𝑮̅ )=V(G) and
E( 𝑮̅)= {xy : xy ∉ E (G), x, y ∈V (G)}. Complement of is G (V(𝑮̅ ))’=V(G) and (E( ) )’={xy : xy ∉ E (𝑮̅ ), x, y
∈V (G)}=E(G).
Hence proved.
Example :
V(G)={A,B,C,D,E} E(G)={AE,AB,BC,CD,DE}
V(𝑮̅)={A,B,C,D,E} E( 𝑮̅)={AD,AC,BE,BD,EC}
Similarly :Complement of 𝑮̅ is G.
Hence proved.
Number of edges in a complete graph of n vertices = n(n-1)/2 In the above question, number of vertices ,n
=5 Number of edges = (n(n-1))/2 = (5(5-1))/2 =(5*4)/2 =10.
CHAPTER 2
A graph is said to be connected if there is a path between every pair of vertex. From every vertex to any other
vertex, there should be some path to traverse. That is called the connectivity of a graph. A graph with multiple
disconnected vertices and edges is said to be disconnected.
A graph G=(V(G),E(G)) is considered Eulerian if the graph is both connected and has a closed trial (a walk
with no repeated edges) containing all edges of the graph or 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. An Euler graph is always
connected, except for any isolated vertices the graph may have.
A path that travels through every edge of a connected graph once and only once and starts and ends at different
vertices.
An Euler circuit is a circuit that uses every edge of a graph exactly once. An Euler circuit always starts and ends
at the same vertex. A connected graph G is an Euler graph if and only if all vertices of G are of even degree, and
a connected graph G is Eulerian if and only if its edge set can be decomposed into cycles
Fig 2.1
The above graph is an Euler graph as a 1 b 2 c 3 d 4 e 5 c 6 f 7 g covers all the edges of the graph.
2.4. Non-Euler Graph
Fig 2.2
Here degree of vertex b and d is 3, an odd degree and violating the euler graph condition.
• Euler circuit: no
• Euler path: no
Fig 2.4
Theorem 2.1:
Statement:
A given connected graph G is an Euler graph if and only if all vertices of G
are of even degree.
Proof:
Suppose that G is an Euler graph. It therefore contains an Euler line
(which is a closed walk). In tracing this walk we observe that every time the
walk meets a vertex v it goes through two “new” edges incident on v—with one
we “entered” v and with the other “exited.” This is true not only of all
intermediate vertices of the walk but also of the terminal vertex, because we
“exited” and “entered” the same vertex at the beginning and end of the walk,
respectively. Thus if G is an Euler graph, the degree of every vertex is even.
To prove the sufficiency of the condition, assume that all vertices of G are of
even degree. Now we construct a walk starting at an arbitrary vertex v and going
through the edges of G such that no edge is traced more than once. We continue
tracing as far as possible. Since every vertex is of even degree, we can exit from
every vertex we enter; the tracing cannot stop at any vertex but v. And since v is
also of even degree, we shall eventually reach v when the tracing comes to an
end. If this closed walk h we just traced includes all the edges of G, G is an Euler
graph. If not, we remove from G all the edges in h and obtain a subgraph h′ of G
formed by the remaining edges. Since both G and h have all their vertices of
even degree, the degrees of the vertices of h′ are also even. Moreover, h′ must
touch h at least at one vertex a, because G is connected. Starting from a, we can
again construct a new walk in graph h′. Since all the vertices of h′ are of even
degree, this walk in h′ must terminate at vertex a; but this walk in h′ can be
combined with h to form a new walk, which starts and ends at vertex v and has
more edges than h. This process can be repeated until we obtain a closed walk
that traverses all the edges of G. Thus G is an Euler graph.
Theorem 2.2:
Statement:
Proof:
Conversely, let G be an Euler graph. Consider a vertex v1. There are at least
two edges incident at v1. Let one of these edges be between v1 and v2. Since
vertex v2 is also of even degree, it must have at least another edge, say between
v2 and v3. Proceeding in this fashion, we eventually arrive at a vertex that has
previously been traversed, thus forming a circuit Γ. Let us remove Γ from G. All
vertices in the remaining graph (not necessarily connected) must also be of even
degree. From the remaining graph remove another circuit in exactly the same
way as we removed Γ from G. Continue this process until no edges are left.
Hence the theorem.
2.7. Problems:
1.(a) Find a graph such that every vertex has even degree but there is no Euler tour.
(b) Find a disconnected graph that has an Euler tour.
Solution:
(a) Take a graph that is the vertex-disjoint union of two cycles. It is not connected, so there is no Euler tour.
(b) The empty graph on at least 2 vertices is an example. Or one can take any connected graph with an
Euler tour and add some isolated vertices. 4. Determine the girth and circumference of the following
graphs.
2. Prove that in any connected graph G,there is a walk that uses every edge exactly
twice. Solution:
We duplicate each edge of G in order to get the new (multi)graph G. Since all vertices of Ghave even degree
by construction, Ghas an Eulerian trail. This gives the desired walk.
3. Consider the graph below.
a) Is A B CD E F A an euler circuit?
b) Does the graph have an Euler circuit?
Solution:
a) No, it does not use edge BD.
A B CD E F D B FA
b) Yes, the circuit is an Euler circuit.
Yes, because the graph is connected and each vertex has even degree.
2.8. Operations on graph:
2.8.1. Unary operations:
2.8.1.1. Elementary operations:
Elementary operations or editing operations, which are also known as graph edit operations, create a new graph
from one initial one by a simple local change, such as addition or deletion of a vertex or of an edge, merging
and splitting of vertices, edge contraction, etc. The graph edit distance between a pair of graphs is the minimum
number of elementary operations required to transform one graph into the other.
Graph union:
G1 𝖴 G2. There are two definitions. In the most common one, the disjoint union of graphs, the union is assumed
to be disjoint. Less commonly (though more consistent with the general definition of union in mathematics) the
union of two graphs is defined as the graph (V1 𝖴 V2, E1 𝖴 E2).
Graph intersection:
G1 ∩ G2 = (V1 ∩ V2, E1 ∩ E2);[1]
Graph join:
Graph with all the edges that connect the vertices of the first graph with the vertices of the second graph. It is
a commutative operation.
2.9.1. Cycles:
In graph theory, a cycle in a graph is a non-empty trail in which only the first and last vertices are equal.
A directed cycle in a directed graph is a non-empty directed trail in which only the first and last vertices are
equal.
A graph with edges colored to illustrate a closed walk H–A–B–A–H in green, a circuit which is a closed walk in
which all edges are distinct B–D–E–F–D–C–B in blue, and a cycle which is a closed walk in which all vertices
are distinct but the first and last vertices H–D–G–H in red.
A graph without cycles is called an acyclic graph. A directed graph without directed cycles is called a directed
acyclic graph. A connected graph without cycles is called a tree.
2.9.2. Tour and Trail:
An Eulerian tour in a graph is a closed walk that traverses every edge exactly once. def: An Eulerian graph is a
graph that has an Eulerian tour.
Trail is an open walk in which no edge is repeated. Vertex can be repeated. Traversing a graph such that not an
edge is repeated but vertex can be repeated and it is closed also i.e. it is a closed trail......These can have
repeated vertices only.An Eulerian trail in a graph is a trail that traverses every edge exactly once.
A Hamiltonian path or traceable path is a path that visits each vertex of the graph exactly once. A graph that
contains a Hamiltonian path is called a traceable graph. A graph is Hamiltonian-connected if for every pair of
vertices there is a Hamiltonian path between the two vertices.
A Hamiltonian cycle, Hamiltonian circuit, vertex tour or graph cycle is a cycle that visits each vertex exactly
once. A graph that contains a Hamiltonian cycle is called a Hamiltonian graph.
Similar notions may be defined for directed graphs , where each edge (arc) of a path or cycle can only be traced
in a single direction (i.e., the vertices are connected with arrows and the edges traced "tail-to-head").
A Hamiltonian decomposition is an edge decomposition of a graph into Hamiltonian circuits.
A Hamilton maze is a type of logic puzzle in which the goal is to find the unique Hamiltonian cycle in a given
graph.
EXAMPLES:
A complete graph with more than two vertices is Hamiltonian.
Every cycle graph is Hamiltonian.
2.9.4. History:
The cycle was named after Sir William Rowan Hamilton who, in 1857, invented a puzzle-game which involved
hunting for a Hamiltonian cycle.....To solve the puzzle or win the game one had to use pegs and string to find
the Hamiltonian cycle — a closed loop that visited every hole exactly once.
2.9.5. Properties:
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.
All Hamiltonian graphs are biconnected, but a biconnected graph need not be Hamiltonian.
An Eulerian graph G (a connected graph in which every vertex has even degree) necessarily has an Euler tour,
a closed walk passing through each edge of G exactly once. This tour corresponds to a Hamiltonian cycle in
the line graph L(G), so the line graph of every Eulerian graph is Hamiltonian. Line graphs may have
other Hamiltonian cycles that do not correspond to Euler tours, and in particular the line graph L(G) of
every Hamiltonian graph G is itself Hamiltonian, regardless of whether the graph G is Eulerian.[10]
A tournament (with more than two vertices) is Hamiltonian if and only if it is strongly connected.
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)!. These counts assume that cycles that are the same apart from
their starting point are not counted separately.
Theorem 2.3:
Statement:
A nonempty connected· graph is eulerian if and only if it has
no vertices of odd degree.
Proof:
Let G be eulerian, and let C be an Euler tour G with origin
(and terminus) u. Each time a vertex v as an internal vertex of C, two
of the edges incident with v are accounted, Since an Euler tour contains
Fig 2.5
every edge of G, d(v) is even for all v ≠ u. Similarly, since C starts and ends at u, d (u) is also even. Thus G has
no vertices of odd degree.
Conversely, suppose that G is a noneulerian connected graph with.
at least one edge and no vertices of odd degree. Choose such a graph G with
as few edges as possible. Since each vertex of G has degree at least two, G
contains a closed trail. Let C be a closed trail of maximum
possible length in G. By assumption, C is not an Euler tour of G and so
G - E(C) has some component G' with ε (G')> 0. Since C is itself eulerian,
it has no vertices of odd degree; thus the connected graph G' also has no
vertices of odd degree.Since ε (G') < ε (G) , it follows from the choice of G
that G' has an Euler tour C'. Now, because G is connected, there is a vertex
v in V(C) ∩ V(C'), and we may assume, without loss of generality, that v is
the origin and terminus of both C and C'. But then CC' is a closed trail of G
with ε (CC') > ε (C), contradicting the choice of C.
Theorem 2.4:
Statement:
If G is hamiltonian then, for every nonempty proper subset S of V.
ω(G − S) ≤ |S| (2.1)
Proof :
Let C be a Hamilton cycle of G. Then, for every nonempty
proper subset S of V.
ω(G − S) ≤ |S|
Also ,C-S is a subgraph of G-S and so
ω(G − S) ≤ ω(C − S)
The theorem follows;
The classic textbook example of the use of backtracking is the eight queens puzzle, that asks for all
arrangements of eight chess queens on a standard chessboard so that no queen attacks any other. In the common
backtracking approach, the partial candidates are arrangements of k queens in the first k rows of the board, all in
different rows and columns. Any partial solution that contains two mutually attacking queens can be abandoned.
Backtracking can be applied only for problems which admit the concept of a "partial candidate solution" and a
relatively quick test of whether it can possibly be completed to a valid solution. It is useless, for example, for
locating a given value in an unordered table. When it is applicable, however, backtracking is often much faster
than brute-force enumeration of all complete candidates, since it can eliminate many candidates with a single
test.
Backtracking is an important tool for solving constraint satisfaction problems, such as crosswords, verbal
arithmetic, Sudoku, and many other puzzles. It is often the most convenient technique for parsing, for
the knapsack problem and other combinatorial optimization problems. It is also the basis of the so-called logic
programming languages such as Icon, Planner and Prolog.
The term "backtrack" was coined by American mathematician D. H. Lehmer in the 1950s. The pioneer string-
processing language SNOBOL (1962) may have been the first to provide a built-in general backtracking
facility.
2.9.7. Algorithm:
In backtracking, we first take a step and then we see if this step taken is correct or not i.e., whether it will give a
correct answer or not. And if it doesn’t, then we just come back and change our first step. In general, this is
accomplished by recursion. Thus, in backtracking, we first start with a partial sub-solution of the problem
(which may or may not lead us to the solution) and then check if we can proceed further with this sub-solution
or not. If not, then we just come back and change it.
General steps:
Start with a solution
Check if this sub -solution will lead to the solution or not.
If not , then come back and change the sub – solution and continue again.
2.9.8. Problems:
Given a graph G = (V, E) we have to find the Hamiltonian Circuit using Backtracking approach. We start our
search from any arbitrary vertex say 'a.' This vertex 'a' becomes the root of our implicit tree. The first element
of our partial solution is the first intermediate vertex of the Hamiltonian Cycle that is to be constructed. The
next adjacent vertex is selected by alphabetical order. If at any stage any arbitrary vertex makes a cycle with
any vertex other than vertex 'a' then we say that dead end is reached. In this case, we backtrack one step, and
again the search begins by selecting another vertex and backtrack the element from the partial; solution must be
removed. The search using backtracking is successful if a Hamiltonian Cycle is obtained.
Example:
Consider a graph G=(V,E) shown in figure .We have to find a Hamiltonian circuit using Backtracking method.
Solution:
Firstly, we start our search with vertex 'a.' this vertex 'a' becomes the root of our implicit tree.
Next, we choose vertex 'b' adjacent to 'a' as it comes first in lexicographical order (b,c,d).
From backtracking, the vertex adjacent to 'e' is b, c, d, and f from which vertex 'f' has already been checked, and
b, c, d have already visited. So, again we backtrack one step. Now, the vertex adjacent to d are e, f from which e
has already been checked, and adjacent of 'f' are d and e. If 'e' vertex, revisited them we get a dead state. So
again we backtrack one step.
Now, adjacent to c is 'e' and adjacent to 'e' is 'f' and adjacent to 'f' is 'd' and adjacent to 'd' is 'a.' Here, we get
the Hamiltonian Cycle as all the vertex other than the start vertex 'a' is visited only once. (a - b - c - e - f -d -
a).
There are three houses (Fig. 3.3) H1, H2, and H3, each to be
connected to each of the three utilities—water (W), gas (G), and electricity (E)—
by means of conduits. Is it possible to make such connections without any
crossovers of the conduits?
Figure 3.4 shows how this problem can be represented by a graph—the
conduits are shown as edges while the houses and utility supply centers are
vertices.
and
𝑛−2, if n is even.
2
graphs:
Kolam’s complexity can reach really high scales, therefore one can either come to some sort of classification
scheme or to learn how to encode kolams into some simpler objects.
Therefore we focus on two main objects here: kolam graphs and kolam maps. We define kolam maps as
follows.
Def. Kolam map is a mathematical object of a graph, denoted here by letters Gm. Every kolam
map Gm corresponds to a kolam, which we denote here by a letter G. Kolam map Gm consists of nodes and
edges. Nodes of kolam map Gm are dots, around which the initial kolam G is drawn. Edges of kolam map
Gm
are defined between each two nodes of kolam map if two closed kolam cells are neighboring cells of kolam,
see Figure below. Therefore instead of a complex object of kolam we get its simpler representation as a kolam
map graph: G → Gm.
Fig 3.7
1.
One type is square array with odd number of rows and columns.
Number of rows : n
Number of columns : n
2.
• Sum of increasing odd number is always a square number.
(Eg:1+3+5=9=3^2)
• If n is the no. of dots in the center row, then the no. of rows in half of the kolam including the center
row=(n+1)/2.
• Sum of all the rows = 2((n+1)/2)^2 [including the center row twice].
• If any two numbers are given, we can find the another number by the formula
Google maps helps in achieving the destination from one place to other. Graph theory is the study of points
and lines where set of points are called vertices. Lines connecting points are called edges.....Google map
identifies all possible routes from the starting point to the ending point.Graphs can either be directed or
undirected depending upon the walk on one side or both sides.
A walk destined to change history. It was a morning in 1956 and Dijkstra, who at the time worked as a
programmer at the Centrum Wiskunde & Informatica (CWI) in Amsterdam, was walking with his girlfriend
to do some shopping. When they got tired of walking they sat at a coffee shop, the Dutch scientist had an
illumination: in just 20 minutes, in front of a cup of coffee, he designed the algorithm that would make him
enter the history of computer science.
To understand how it works we need to introduce the concept of graph. A graph, like the one represented in the
figure, is a structure formed by nodes, represented by dots, and arcs, lines that connect the nodes. Although
simple, this model can be used to describe many problems. For example, nodes can represent people and arcs
connect those who know each other; in anatomy, the nodes can represent the organs and the arches the blood
vessels that connect them, in astronomy, the stars are nodes that, joined together by the arches, form the
constellations. In our case, instead, the arches represent the roads, while the nodes are the intersections, that is
all the points where it is possible to choose which road to take.
Fig 3.8
Fig 3.8 repesents how a map becomes graph.The streets are arches (the black lines),while the intersections are
nodes(the white circles).
The arches are not all the same. When we have to choose between two possible roads we take into account the
one that gets us to destination first. The factors that come into play are many: the maximum speed, the size of
the road, the presence of traffic lights, traffic and so on. We can summarize them all in a single value, the
(estimated) travel time of that section. This information is integrated into our graph by weights, that are the
values attributed to each arc. Consequently, if a “4” is written on the arc that connects the node X and the node
Y, this indicates that to go from the intersection X to the intersection Y we estimate that it takes 4 minutes.
What does Dijkstra’s algorithm do? Given a weighted graph, a starting point and an endpoint within the
graph itself, the algorithm finds the “minimum path” that connects the two points, that is the sequence of arcs
that minimizes the sum of the weights and therefore, in the case of Maps, minimizes the estimated travel
time.
A closer look. To work properly, the algorithm keeps a “cost” associated with each node, which represents the
value of the minimum path to reach each node. Before starting, the nodes are assigned an infinitely high cost,
which indicates that a road has not yet been found to reach it. To everyone except the starting node, which is set
at zero cost (after all, arriving at the departure node from the departure node has no cost!). Moreover, it keeps a
list of all the nodes that are still to be visited, which at the start includes all the nodes of the network. The
algorithm always repeats the same steps. First, it extracts the node with the lowest cost from the list of nodes to
visit. For each node not yet visited on the network reachable from the examined node, the algorithm evaluates
how much it costs to reach this node. If the cost is lower, then it is updated, otherwise, it is left unchanged, since
there is a more convenient way. The node just examined is marked as visited and starts again, until the node to
be visited is not the destination.
Dijkstra’s algorithm always finds the fastest route. It has been shown mathematically that Dijkstra always finds
the shortest path, as long as there is at least one possible route. This fact sometimes plays against us: often, in
fact, in order to save a few seconds, the navigator sends us on “alternative” roads against common sense, and
that we would never have dreamed of travel. On the other hand, however, it is extremely versatile, in fact, it is
always able to find the fastest route. Moreover, it can take into account additional information such as traffic
information or the presence of congestion, simply by going to change the weights on the graph
3.8. Application of graph theory to solve a crime:
3.8.1. Graph coloring:
Graph coloring is nothing but a simple way of labelling graph components such as vertices, edges, and
regions under some constraints. In a graph, no two adjacent vertices, adjacent edges, or adjacent regions are
colored with minimum number of colors. This number is called the chromatic number and the graph is called
a properly colored graph.
While graph coloring, the constraints that are set on the graph are colors, order of coloring, the way of
assigning color, etc. A coloring is given to a vertex or a particular region. Thus, the vertices or regions having
same colors form independent sets.
3.8.1.1. Vertex Coloring:
Vertex coloring is an assignment of colors to the vertices of a graph ‘G’ such that no two adjacent vertices
have the same color. Simply put, no two vertices of an edge should be of the same color.
3.8.2. Chromatic Number:
The minimum number of colors required for vertex coloring of graph ‘G’ is called as the chromatic number
of G, denoted by X(G).
χ(G) = 1 if and only if 'G' is a null graph. If 'G' is not a null graph, then χ(G) ≥ 2.
Note − A graph ‘G’ is said to be n-coverable if there is a vertex coloring that uses at most n colors,
i.e., X(G) ≤ n.
Example
The chromatic number of Kn is
n
n–1
[n/2]
[n/2]
Consider this example with K4.
In the complete graph, each vertex is adjacent to remaining (n – 1) vertices. Hence, each vertex requires a new
color. Hence the chromatic number of Kn = n.
3.8.3. Problem:
A says I am not the thief,B says A is the thief, C says I am not the thief.Here only one person either A or B or C
telling truth.
Suppose A is a thief, then B is saying the truth and also C .This is not possible, since only one
person is telling the truth. So A cannot be the thief.
Suppose B is the thief ,then A and C are telling the truth. This also not possible. So B cannot be
the thief even
If C is the thief,the B is lying and C is also lying and A is telling the truth. so this the unique
case,So C is the thief.
Since there are three person it was quite easy. Suppose there are 4 or 5, is it possible to solve?
B says A is the thief.So draw a directed lines from B to A.C says I am not the thief.It means A or B is the
thief.Similarly A says I am not the thief. It means B or C is the thief .So how to solve it?
If A is the thief,if I redraw the graph ignoring all the lines coming out of A.
Suppose there are four A,B,C and D.A,B, and C are saying the same statement has above and D is saying B is
the thief.
Since the degree of C in this situation is also 1. So C is the thief.Therefore we can use the graph theory
concept to suspect the thief.
3.9. Conclusion:
Graph theory enables us to study and model networks and solve some difficult problems inherently capable of
being modelled using networks.
When solving a problem by developing a graph-based program,careful attention must be given at the design
stage to the structuring of data to help make solving the problem tractable,to enable linkages to be traced
efficiently and to avoid duplication of data.
Many of the traffic real world problems can be solved by graph theory.Recent technologies are used to get
efficient solutions to the traffic problems to provide sader,cheaper and better life.
Graph theoretical concepts are widely used to study and model various applications in different areas. It
provides a convenient way to represent various kinds of mathematical objects. Graphs gives us many
techniques and flexibility while defining and solving a real life problem. Mathematicians are concerned with
the abstract structure of a graph. They analyse and manipulate graphs and develop theorems based upon
structural axioms. Not only in Mathematics, graph theoretical concepts are widely used in various applications
in
different areas also. They include study of molecules, construction of bonds and study of atoms in chemistry. In
biology, graph theory is used for conservation efforts where a vertex represent regions where certain species
exist and the edges represent migration path or movement between them. This information is important
when looking at breeding patterns or tracking the spread of diseases, parasites and to study the impact of
migration that affect other species. Graph theory is used in sociology to measure actor’s prestige or to
explore diffusion mechanism. It is also used in computer applications for development of graph algorithms.
REFERENCES:
2. Grpah theory with applications- J.A.Bondy and U.S.R. Murty-Published in USA 1976 by Elsevier
Science Publishing Co.,Inc.
www.cmi.ac.in./gift/kolam/kola_pattern_htm(July 12,2006).
9. https://www.javatpoint.com/hamiltonian-circuit-problems
10. https://www.gatevidyalay.com/tag/euler-graph-ppt/.
11. https://towardsdatascience.com/graph-theory-history-overview-f89a3efc0478
12. https://pi.math.cornell.edu/~mec/Summer2009/meerkamp/Site/Sudokus-as-Graphs-html.
13. https://www.tutorialspoint.com/graph_theory/graph_theory_coloring.htm
14. https://magazine.impactscool.com/en/speciali/google-maps-e-la-teoria-dei-grafi/
15. https://aviyalpresentations.files.wordpress.com/2018/05/solved-question-paper-questions-graph-theory1.pdf
16. https://kanchiuniv.ac.in/coursematerials/eulersgraph.pdf