Graph Theory
Graph Theory
A PROJECT REPORT
Submitted
In partial fulfilment of the requirements for the award of degree
Master of Science
In
Mathematics
By
S.MANIKANTA
(HT.NO:1683531014)
Department of Mathematics
GOVERNAMENT COLLEGE (A), RAJAMAHENDRAVARAM
Affiliated by AKNU, Rajamahendravaram
Andhra Pradesh, India
2017-2018
1
Certificate
This is to certify that the project entitled
“APPLICATIONS OF GRAPH THEORY” is the bonafide
work carried out by S.MANIKANTA during the academic
year 2017-18 in partial fulfilment of the requirements for
the award of the degree of master of science in dept. of
mathematics , Government(A) College ,
Rajamahendravaram .
External Examiner
The matter embodied in this project work has not been submitted earlier
for award of any degree or diploma to the best of my knowledge and
belief. Certified that the above mentioned project has been duly carried
out as per the norms of the college and statutes of the university
2
Acknowledgements
3
CONTENTS
Certificate 2
Acknowledgements 3
1. Graph theory 7-9
1.1. History
1.2. Definition
2. Terminology 9-12
2.1. Loop
2.2. Multigraph
2.3. Directed and Un-directed graph
2.4. Pseudo graph
2.5. Simple graph
2.6. Finite and Infinite graphs
2.7. Degree of vertex
2.8. Isolated and pendent vertices
3. Types of Graphs 12-15
3.1. Null graph
3.2. Complete graph
3.3. Regular graph
3.4. Cycles
3.5. Wheels
3.6. Platonic graph
3.7. N-Cube
4. Tree and Forest 15-16
4.1. Tree
4.2. Forest
4.3. Poly tree
4.4. Types of trees
5. Graph isomorphism and Graph operations 17-23
5.1. Graph isomorphism
5.2. Complex graph operations
5.2.1. Union
5.2.2. Sum of two graphs
4
5.2.3. Intersection
5.2.4. Graph join
5.2.5. Difference of graphs
5.2.6. Graph compliment
5.2.7. Power graph
6. Walks, paths and circuits 24-25
6.1. Walk
6.2. Closed walk
6.3. Trail
6.4. Circuit
6.5. Path
6.6. Cycle
6.7. Connected graph
6.8. Component
7. Representation of graphs as Matrix 25-26
7.1. Adjacency matrix
7.2. Incidence matrix
8. Graph in Circuits 26-30
8.1. Tree
8.2. Matrix
8.2.1. Incident matrix
8.2.2. Loop matrix or Tie set matrix
8.2.3. Cut set matrix
9. Applications in Computer science 31-33
9.1. Network
9.2. Webpage
9.3. Workflow
9.4. Neural networks
9.5. Google maps
5
11. Graph theory models in security 38-40
11.1. The four-color graph theorem
11.1.1. Applying of the four color theorem in wireless a cell tower
placement plan.
11.1.2. Node coloring theorem
12. Network coding 40-42
13. Chemical graph theory 42-44
13.1. Definitions
13.2. Molecular energy
13.3. Graph nullity and zero-Energy states
14. Recent applications of graph theory in molecular
biology 45-48
14.1. New applications in molecular biology
14.2. New field has recently emerged called bioinformatics –
application of IT and CS to molecular biology.
15. Knight’s Tour 47-50
16. Common Problem 51-54
16.1. House of Santa Claus
16.2. Three utilities problem
16.3. Seven Bridges of Königsberg
16.4. Shortest path problem
16.5. Travelling salesman problem(TSP)
17. Bibliography 55
6
1 Graph theory
1.1 History
In the present century, there have already been a great many rediscoveries
of graph theory which can only mention most briefly.
Euler (1707-1782) becomes the father of graph theory as well as Topology.
The paper written by Leonhard Euler on the Seven Bridges of Konigsberg
and published in 1736 is regarded as the first paper in the history of graph
theory. This paper, as well as the one written by Vandermonde on the knight
problem, carried on with the analysis situs initiated by Leibniz. Euler's
formula relating the number of edges, vertices, and faces of a convex
polyhedron was studied and generalized by Cauchy and L'Huilier, and
represents the beginning of the branch of mathematics known as topology.
7
More than one century after Euler's paper on the bridges of Konigsberg and
while Johann Benedict Listing was introducing the concept of topology,
Cayley was led by an interest in particular analytical forms arising from
differential calculus to study a particular class of graphs, the trees. This
study had many implications for theoretical chemistry.
1.2 Definitions
There is large number of definitions in graph theory. The following are
some of the more basic ways of defining graphs and related mathematical
structure
Graph
The set V(G) is called the vertex set of G and E(G) is called the edge set.
Usually the Graph is denoted by G=(V,E) for u,vϵV set and {u,v} an edge
of G. Since {u,v} is 2-elements set, we may write {v,u}.
8
If e=uv is an edge of G, then we say that u and v are adjacent in G and e
joins u and v.
For example:
A graph G is denoted by the sets
V(G)={ u, v, w, x, ,z} and E(G)={ uv, uw, wx, xy, xz}.
Now we have the following graph by considering these sets.
2 TERMINOLOGY
2.1 Loop: an edge of the graph that joins a node to itself is called
loop or self-loop i.e., a loop is an edge (vi, vj) where vi = vj.
9
2.3 Directed & Un-directed graph: If each edge of graph G
has a direction then the graph is called Directed Graph
(Example of directed graph fig.1). In Directed Graph each edge
is represented by an arrow or direction curve from initial point u
of e to the terminal point v (fig.2). If each edge of G has no-
direction then the graph is called as An Un--Directed Graph.
2.4 Pseudo graph: a graph with loops and multiple edges are
allowed, is called a pseudo graph
2.5 Simple graph: a graph which has neither loops nor multiple
edges
10
1. Statement: (Handshaking theorem)
If G = (V, E) be an undirected graph with e edges.
Then G (v) =2e
i.e., the sum of the degree of the vertices in an undirected
graph is even.
2. Statement: The number of vertices of odd degree in a graph is
always even
11
Problem 2.2. Draw the graphs of the chemical molecules of
(i) Methane (CH4) (ii) Propane (C3H8)
3 Types of Graphs
3.1 Null Graph: A graph which contains only isolated node, is
called a null graph
i.e., the set of edges in the graph is empty.
Null graph is denoted on n vertices by Nn
N4 is shown in the finger 8.
Fig.8
12
3.2 Complete Graph: A simple graph G is said to be complete
if every vertex in G is connected with every other vertex.
i.e., If G contains exactly one edge between each pair of distinct
vertices.
A complete graph is usually denoted by Kn. It should be noted that
Kn has exactly edges.
The graph Kn for n= 1, 2, 3,4,5,6 are shown in Fig 9.
13
displayed in the Fig 11.
3.7 N-cube : The N-cube denoted by Qn, is the graph that has
vertices representing the 2n bit strings of length n. The adjacent if
and only if the bit strings that they represent differ in exactly one
bit position. The graphs Q1 ,Q2 ,Q3 are displayed in the figure 13.
Thus Qn has 2n vertices and n.2n-1 edges, and is regular of degree n.
14
4 Tree and Forest
4.1 Tree
A tree is an undirected graph G that satisfies any of the following equivalent
conditions:
15
4.2 Forest
A forest is an undirected graph, all of whose connected components are
trees; in other words, the graph consists of a disjoint union of trees.
Equivalently, a forest is an undirected acyclic graph. As special cases, an
empty graph, a single tree, and the discrete graph on a set of vertices (that
is, the graph with these vertices that has no edges), are examples of forests.
Since for every tree V - E = 1, we can easily count the number of trees that
are within a forest by subtracting the difference between total vertices and
total edges. TV - TE = number of trees in a forest.
4.3 Poly tree
A polytree[11] (or oriented tree[4A][4B] or singly connected network[4C]) is
a directed acyclic graph (DAG) whose underlying undirected graph is a tree.
In other words, if we replace its directed edges with undirected edges, we
obtain an undirected graph that is both connected and acyclic.
A directed tree is a directed graph which would be a tree if the directions on
the edges were ignored, i.e. a polytree. Some authors restrict the phrase to
the case where the edges are all directed towards a particular vertex, or all
directed away from a particular vertex (see arborescence)
16
5 GRAPH ISOMORPHISM and GRAPH
OPERATIONS:
17
The following three graphs are isomorphic.
The following two graphs are not isomorphic, because x is adjacent to two
pendent vertex is not preserved.
18
The union of two graphs G(VG, EG) and H(VH, EH) is the union of their
vertex sets and their edge families. Which means G H = (VG VH, EG
EH).
The below image shows a union of graph G and graph H. Make sure that all
the vertices and edges from both the graphs are present in the union. If
possible draw it once yourself.
19
union where the VG and VH are disjoint. In this case the Union is
referred to as disjoint Union and it is denoted by G + H .
Notice that the vertex set is a union of both the vertex sets but the edge
family consists only the edges which exist in both the graphs G and H.
5.2.4 Graph join: Given two graphs G(VG, EG) and H(VH, EH), the
join Graph will contain the union of the two graphs and all edges
which can connect the vertices of G to vertices of H.
Below is an image to demonstrate that.
20
Note that the join graph
contains new edges (which
join the vertices of G to
vertices of H) apart from
the disjoint union.
5.2.5 Difference of Graphs: Given two graphs G(VG, EG) and H(VH,
EH), the difference Graph G – H will contain the union of the
vertices of two graphs G and H and the edges in the difference is
the difference of edges which is EG – EH
Few points
The Graph Difference of any graph and itself is an empty graph. Which
means G – G = Empty Graph.
The vertices of the Graph Difference (G – H) are the union of the
vertices of the graphs G and H
The edges of the Graph Difference (G – H) are the complement of the
edges of the graphs G and H.
The Graph Difference (G – H) of two graphs has the same vertices as
Graph Union (G H)
The Graph Difference (G – H) of two graphs has the same vertices as
Graph Intersection G ∩ H
Below is an image to demonstrate the Graph Difference (union of the
two vertices)
21
Note that the vertex set is the union of the two vertex sets where as the
edges in the difference is the family of edges which are present in G but
not in H.
22
Consider the below graph G(V, E), and let’s say that we need to derive its
square, which means the value of k is 2.
So the graph will result into the graph on the right.
Note that the vertices 1 and 3 are connected because the there exists a path
of length two or less in the original graph..
Similarly there exists paths of length two or less between {2, 4}, {3, 5}, {4,
1}, {5, 2 }, hence these vertices are connected in the power graph.
This concludes that all the graph are the first power of themselves. Which
means if value of k is 1 then we get the same graph? And if the adjacency
matrix of G is A then each cell (i,j) of A1 will give you the number of paths
of length 1 between i and j.
Lets take another example. Again let the value of k is 2. Consider the graph
below.
The edges {1,3}, {2,3}, {3,4}, {4,6}, {5,1} and {6,2} are connected
because they have a path length of 2 or less between them in the original
graph.
The edges {1,4}, {2,5} and {3,6} are not connected because the length of
the path between them is three which is more than two.
23
6 WALKS, PATHS, CIRCUITS
6.2 Closed Walk: closed walk occurs when x=y(in above fig)
i.e., a walk from vertex v to the same v.
6.3 Trail : a trail is a walk with no repeated edges
24
6.5 Path: An open walk in which no vertex appears more than once
is called path. The number of edges in the path is called length of
a path.
6.6 Cycle: A closed path is called as cycle
6.7 Connected graph: A graph G is said to be connected if there
is at least one path between every pair of vertices in G. Otherwise,
G is disconnected.
6.8 Component: disconnected graph consists of two or more
connected graphs. Each of these connected subgraph is called a
component.
25
7.1 Adjacency matrix: To any graph G there corresponds v
v matrix A(G) = [ aij ], in which aij is the number of edges joining
vi and vj.
7.2 Incidence matrix: To any graph G there corresponds a v
e matrix called the incident matrix of G. The incidence matrix of
G is the matrix M(G) = [mij], where mij is the number of times (0,
1 or 2) that vi and ej are incident. this is a different way of
specifying the graph.
8 Graph in Circuits:
Graph: Diagram consisting Node and Branch is called graph.
Node: Inter connection of components.
Branch: Line connecting two nodes.
Circuit
Here a, b, c and d are called Nodes and ab, bc, cd, db, and ad are
Branches.
26
When we convert this circuit in to graph we get
4-nodes (a, b, c, d)
6-branches.
Twig: - 1, 2 and 3
Links: -4, 5 and 6
27
8.2 Matrix :-
In graphs we have 3 kinds of matrices.
Here we take the values as per the direction. If the arrow is
coming towards node we take -1 and if the arrow going away from
node we take +1. if node and branch has no connection we take
zero as a element in matrix corresponding to them.
28
Here we will consider the loops existed in the graph. We will take
those branches which leads to loops in graph. The following are the
loops occurred in graph
`
<= Loop 3
Loop 4=>
<=Loop 6
Loop 7=>
29
8.2.3 Cut set matrix
By taking the cut set tree, we forms a matrix between branches of
cut set branches of original graph.
W
e
consider the cut set branches 1, 3, 4 and 7. Taking +1 if the
branch of a column is in the direction of branch on row. If not we
take -1 at which the node at the head of the branch is considered
and takes zero if the branch is not connected to that node.
30
9 Applications in computer Science
Since computer science is not a concrete/centralized subject, we
can introduce graph theory in many areas
31
9.3 Workflow: It’s sequence of processes through which a piece
of work passes from initiation to completion. Can be also
represented as directed graph.
32
9.5 Google Maps:
33
10.1 FINGERPRINT TYPES
The lines that flow in various patterns across fingerprints are called Ridges
and the spaces between ridges are Valleys.
34
10.2 MINUTE, CORE AND DELTA
35
10.4 OLD METHOD:-
NEW METHOD:-
PROCESS FLOWS :-
36
10.5 Construction of related weight graph
Wn = Area (Ri)
Where
i = 1, 2, 3… n.
Wn is the weight of nodes.
Ri is the specified region in block directional image.
We = (Adj − p) × (Node − d) × (Diff −v)
Where
Adj-p is the boundary of two adjacent regions linking with an edge.
Node-d is the distance difference between nodes that links by an edge
Diff-v is the phase difference or direction difference between two
regions of block directional image.
37
11 Graph Theory Models In Security
Graph theory :
The famous four-color theorem states that for any map, such as
that of the contiguous (touching) provinces of France below, one
needs only up to four colors to color them such that no two
adjacent provinces of a common boundary have the same color.
With the aid of computers, mathematicians have been able to
prove that this applies for all maps irrespective of the boarder or
surface shape
38
colors are limited to four, the task of finding where to
economically position broadcast towers for maximum coverage is
equitable to the four-color map problem.
The two challenges are:
1. Elimination of the no-coverage spots ( marked red in the
diagram below )
2. Allocation of a different channel in the spots where channel
overlap occurs (marked in blue). In analogy, colors must be
different, so that cell phone signals are handed off to a
different channel.
Each cell region therefore uses one control tower with a specific
channel and the region or control tower adjacent to it will use
another tower and another channel. It is not hard to see how by
using 4 channels, a node coloring algorithm can be used to
efficiently plan towers and channels in a mobile network, a very
popular method in use by mobile service providers today
39
Fig16(b). The simplified network version of the
Fig.16(a) A Map with complex wandering
map derived by node coloring
boundaries
12 Network Coding
Network coding is another technique where graph theory finds
application in mobile communication networks. In a traditional
network, nodes can only replicate or forward incoming packets.
Using network coding, however, nodes are able to algebraically
combine received packets to create new packets
-hoc networks
40
Peer-to-peer file distribution
-to-peer streaming
nd
First slot 2 slot EX-OR Computation
41
Finally , when Destination t1 receives A and A(EX-OR)B, it will be
able to compute B by B=A (EX-OR){ A(EX-OR)B}
Likewise, when Destination t2 receives B and A (EX-OR) B, it will
be able to compute A by: A= {A (EX-OR) B} (EX-OR) B as shown
below
Network Coding application in Opportunistic Routing
Opportunistic routing is a technique that makes use of multiple
paths in a network to obtain diversity. Network coding can be
applied in such a case (fig 9) to coordinate transmissions in order
Fig 19. Shows how network coding simply helps us determine how many packets should be
sent by each node
42
These graph theoretic invariants are expected to correlate with physical
observables measures by experiments in a way that theoretical
predictions can be used to gain chemical insights even for not yet
existing molecules. In this brief review we shall present a selection of
results in some of the most relevant areas of CGT.
13.1 DEFINITIONS
D1: A molecular graph G = (V;E) is a simple graph having n =│ V │
nodes and m = │E │ edges. The nodes vi ϵ V represent non-hydrogen
atoms and the edges (vi; vj) ϵ E represent covalent bonds between the
corresponding atoms. In particular, Hydrocarbons are formed only by
carbon and hydrogen atoms and their molecular graphs represent the
carbon skeleton of the molecule.
D2: An alternant conjugated hydrocarbon is a hydrocarbon with
alternant multiple (Double and/or triple) and single bonds, such as the
molecular graph is bipartite and the edges of the graph represents C = C
and = C − C = or C ≡ C and ≡ C − C ≡ bonds only
13.2 Molecular Energy
In the Huckel Molecular Orbital (HMO) method for
conjugated hydrocarbons the energy of the jth molecular orbital
of the so-called -electrons is related to the graph Spectra by
43
Let G be a graph with n vertices and m edges. Then,
;
For all sufficiently large n, there is a graph G of order n such
that
44
14 Recent Applications Of Graph Theory
In Molecular Biology
45
Human Genome Project
How many genes are in the Human Genome?
Majority of biologists believed a lot more than
50,000
Rice genome contains about 50,000 genes
Big surprise, humans only have about half that many!
46
The building blocks of a DNA molecule are nucleotide bases—
Adenine, Guanine, Cytosine, and Thymine (AGCT.) arranged in a
sequence.
Length of sequence is order of 3x10**9
A special technology allows us to “see” fragments of length 500-
1200 nucleotides.
How do we piece them together to find out the whole sequence of
the DNA?
Difference in DNA between 2 people is less than 0.1%.
Construct a directed graph where V- fragments E – (vi,vj) if end of
fragment i coincides with beginning of fragment j.
Find an Euler trail Is it unique?
Are all possible fragments there?
Possible errors?
47
Example: studies on bird population
Ecological landscapes can be modeled using graphs.
V- represents habitat patches or roosts for birds,
E - represent movement between the patches.
Graphs help study the structural organization of a landscape,
importance of certain nodes, degree of connectivity between them.
These properties affect the spread of disease, the vulnerability to
disturbance of the landscape, and other issues related to conservation
15 Knight’s Tour
A knight's tour is a sequence of moves of a knight on
a chessboard such that the knight visits every square only
once. If the knight ends on a square that is one knight's move
from the beginning square (so that it could tour the board
again immediately, following the same path), the tour
is closed, otherwise it is open.
48
The knight's tour problem is an instance of the more
general Hamiltonian path problem in graph theory. The
problem of finding a closed knight's tour is similarly an
instance of the Hamiltonian cycle problem. Unlike the general
Hamiltonian path problem, the knight's tour problem can be
solved in linear time.
There are quite a number of ways to find a knight's tour on a
given board with a computer. Some of these methods
are algorithms while others are heuristics.
1.1.1 Brute-force algorithms
A brute-force search for a knight's tour is impractical on all but
the smallest boards;[10] for example, on an 8 × 8 board there
are approximately 4×1051 possible move sequences,[11] and it is
well beyond the capacity of modern computers (or networks of
computers) to perform operations on such a large set.
However, the size of this number gives a misleading
impression of the difficulty of the problem, which can be
solved "by using human insight and ingenuity ... without much
difficulty."[10]
1.1.2 Divide and conquer algorithms
By dividing the board into smaller pieces, constructing tours
on each piece, and patching the pieces together, one can
construct tours on most rectangular boards in linear time - that
is, in a time proportional to the number of squares on the
board. [5][12]
1.1.3 Neural network solutions
49
The Knight's Tour problem also lends itself to being solved by
a neural network implementation.[13] The network is set up
such that every legal knight's move is represented by a neuron,
and each neuron is initialized randomly to be either "active" or
"inactive" (output of 1 or 0), with 1 implying that the neuron is
part of the final solution. Each neuron also has a state function
(described below) which is initialized to 0.
When the network is allowed to run, each neuron can change
its state and output based on the states and outputs of its
neighbors (those exactly one knight's move away) according to
the following transition rules:
50
16 Common Problems
Suppose there are three cottages on a plane (or sphere) and each needs to
be connected to the gas, water, and electricity companies. Without using a
third dimension or sending any of the connections through another
company or cottage, is there a way to make all nine connections without
any of the lines crossing each other?
51
The problem is an abstract mathematical puzzle which imposes constraints
that would not exist in a practical engineering situation. It is part of
the mathematical field of topological graph theory which studies
the embedding of graphs on surfaces. In more formal graph-
theoretic terms, the problem asks whether the complete bipartite
graph K3,3 is planar.[1] This graph is often referred to as the utility graph in
reference to the problem;[2] it has also been called the Thomsen graph
52
16.4 Shortest path problem:
In graph theory, the shortest path problem is the problem of finding
a path between two vertices (or nodes) in a graph such that the sum of
the weights of its constituent edges is minimized.
The problem of finding the shortest path between two intersections on a
road map (the graph's vertices correspond to intersections and the edges
correspond to road segments, each weighted by the length of its road
segment) may be modeled by a special case of the shortest path problem in
graphs
53
The problem was first formulated in 1930 and is one of the
most intensively studied problems in optimization. It is used as
a benchmark for many optimization methods. Even though the
problem is computationally difficult, a large number of heuristics
and exact algorithms are known, so that some instances with tens
of thousands of cities can be solved completely and even
problems with millions of cities can be approximated within a
small fraction of 1%.
The TSP has several applications even in its purest
formulation, such as planning, logistics, and the manufacture
of microchips. Slightly modified, it appears as a sub-problem in
many areas, such as DNA sequencing. In these applications, the
concept city represents, for example, customers, soldering points,
or DNA fragments, and the concept distance represents travelling
times or cost, or a similarity measure between DNA fragments.
The TSP also appears in astronomy, as astronomers observing
many sources will want to minimize the time spent moving the
telescope between the sources. In many applications, additional
constraints such as limited resources or time windows may be
imposed
54
Bibliography
[4A]:-Harary & Sumner (1980).
[4B]:- Simion (1991).
[4C]:- Kim & Pearl (1983).
[12]:- arberry, Ian (1997). "An Efficient Algorithm for the Knight's Tour
Problem" . Discrete Applied Mathematics
[13]:- Y. Takefuji, K. C. Lee. "Neural network computing for knight's tour
problems." Neurocomputing, 4(5):249–254, 1992.
[16]:- Euler, Leonhard (1736). "Solutio problematis ad geometriam situs
pertinentis". Comment. Acad. Sci. U. Petrop 8. Shields, Rob (December
2012). "Cultural Topology: The Seven Bridges of Königsburg 1736
55