3. ACKNOWnfiFMFNT
I cannot express enough thanks to my committee for their continued support
and encouragement: prof:- Apurba Ghosh, my Beloved professor Of MR, Rupak
Bhattacharjee; I offer my sincere appreciation for the learning opportunities
provided by my committee.
My completion of this project could not have been accomplished without
the support of my classmates, Jit Deb, Arun Kumar Sarkar, Supali Ojha, Somnath
Kundu, Joy Sankar Mandal, Aritra Bhattacharya, Ankit Bharati,
- thank you for allowing me time away from you to research and write. You
deserve a trip to Disney! Thanks to my parents as well, The countless times you
kept the children during our hectic schedules will not be forgotten.
Finally, to my caring, loving, and supportive wife, Margaret: my deepest
gratitude. Your encouragement when the times got rough are much appreciated
and duly noted. It was a great comfort and relief to know that you were willing to
provide management of our household activities while I completed my work. My
heartfelt thanks.
4. Introduction
1.1 Introduction to Trees
A tree is a connected undirected graph with no simple circuits.
Theorem 1
An undirected graph is a tree if and only if there is a unique simple
path between any two of its vertices.Forest
A (not-necessarily-connected) undirected graph without
simple circuits is called a forest.
Rooted Trees
A rooted tree is a tree in which one vertex has been
designated as the root and every edge is directed away from the root.
Parent Suppose that T is a rooted tree. If v is a vertex in T other than the root, the parent
of v is the unique vertex u such that there is a directed edge from u to v.
5. Tree
Definition:-
Tree is a discrete structure that represents hierarchical relationships between individual elements or nodes. A tree in which a
parent has no more than two children is called a binary tree.
There is exactly one path between a node pair in a tree.
I There is a path because the tree is connected.
I If there were more than one path:
The following statements are equivalent for a loop-free undirected graph G(V, E) and |V| _ 2:
1. ) G is a tree (is connected and has no cycles.)
2. ) there is exactly one path between each node pair.
3. ) G is connected, but if an edge is removed it becomes disconnected.
4. ) G does not have a cycle, but if an edge is added between any two nodes a cycle is formed.
I proof method: 1 ) 2 ) 3 ) 4 ) 1
The following statements are equivalent for a loop-free undirected graph T(V, E):
graph T(V, E):
1. T is a tree.
2. T is connected, and |V| = | E| + 1
6. 3. T contains no cycles, and | V | = |E| + 1
For every tree T(V, E), if | V| _ 2, then T has at least two
pendant vertices.
Proof.
I2|E| =
Pv2V dv
I Assume there is one vertex of degree 1:
) 2|E| _ 2(|V| - 1) + 1 ) 2|E| _ 2|V| - 1 ) |E| _ |V| - 12 > |V| -
1 contradiction
Tree and it’s Properties:-
Definition - A Tree is a connected a cyclic undirected graph.
There is path between every pair of in GG. A tree with N a
unique vertices number of vertices contains (N-1)(N-1)
number of edges. The vertex which is of 0 degree is called
root of the tree. The vertex which is of 1 degree is called
leaf node of the tree and the degree of an internal node is
at least 2.
Example - The following is an example of a tree -
7. Centers and Bi-Centers of a Tree:-
The center of a tree is a vertex with minimal eccentricity.
The eccentricity of a vertex XX in a tree GG is the
maximum distance between the vertex XX and any other
vertex of the tree. The maximum eccentricity is the tree
diameter. If a tree has only one center, it is called Central
Tree and if a tree has only more than one center it is called
Bi-central Tree. Every tree is either central or bi-central.
Step 1 - Remove all the vertices of degree 1 from the given tree
and also remove their incident edges.
Step 2 - Repeat step 1 until either a single vertex or two vertices
joined by an edge is left. If a single vertex is left then it is the
center of the tree and if two vertices joined by an edge is left
then it is the bi-center of the tree.
Problem 1
Find out the center/bi-center of the following tree -
8. Finally we got a single vertex 'c' and we stop the
algorithm. As there is single vertex, this tree has one
center 'c' and the tree is a central tree.
Problem 2
Find out the center/bi-center of the following tree -
Solution:-
At first, we will remove all vertices of degree 1 and also
remove their incident edges and get the following tree -
Again, we will remove all vertices of degree 1 and also
remove their incident edges and get the following tree -
9. Finally, we got two vertices 'c' and 'd' left, hence we stop
the algorithm. As two vertices joined by an edge is left,
this tree has bi-center 'cd' and the tree is Bi-central.
Labeled Trees
Definition - A labeled tree is a tree the vertices of which are
assigned unique numbers from 1 to n. We can count such trees
for small values of n by hand so as to conjecture a general
formula. The number of labeled trees of n number of vertices is
nn-2nn-2. Two labeled trees are isomorphic if their graphs are
isomorphic and the corresponding points of the two trees have
the same labels.
Example:-
10. Unlabeled Trees:-
Definition - An unlabeled tree is a tree the vertices of
which are not assigned any numbers. The number of
labeled trees of n number of vertices is
(2n)!(n+1)!n!(2n)!(n+1)!n! (nth Catalan number)
Example:
11. Rooted Tree
A rooted tree GG is a connected acyclic graph with a special node that is called the
root of the tree and every edge directly or indirectly originates from the root. An
ordered rooted tree is a rooted tree where the children of each internal vertex are
ordered. If every internal vertex of a rooted tree has not more than m children, it is
called an m-ary tree. If every internal vertex of a rooted tree has exactly m children,
it is called a full m-ary tree. If m=2m=2, the rooted tree is called a binary tree.
Binary Search Tree
Binary Search tree is a binary tree which satisfies the following property -
• XX in left sub-tree of
vertex V,Value(X)<Value(V)V,Value(X)<Value(V)
• YY in right sub-tree of
vertex V,Value(Y)>Value(V)V,Value(Y)>Value(V)
So, the value of all the vertices of the left sub-tree of an internal node VV are less than
or equal to VV and the value of all the vertices of the right sub-tree of the internal
node VV are greater than or equal to VV. The number of links from the root node to the
deepest node is the height of the Binary Search Tree.
Example
12. Algorithm to search tor a key in BBT
BST_Search(x, k) if ( x = NIL or k = Value[x} ) return x; if ( k <
Value[x]) return BST_Search (left[x], k); else
return BST_Search (right[x], k)
INTRODUCTION OF SPANNING TREE:- A spanning tree of
a connected undirected graph GG is a tree that minimally
includes all of the vertices of GG. A graph may have many
spanning trees.
Example:-
13. Minimum Spanning Tree:-
A spanning tree with assigned weight less than or equal to
the weight of every possible spanning tree of a weighted,
connected and undirected graph GG, it is called minimum
spanning tree (MST). The weight of a spanning tree is the
sum of all the weights assigned to each edge of the
spanning tree.
And We Introduce To Kruskal’s Algorithm:-
Kruskal's algorithm is a greedy algorithm that finds a minimum
spanning tree for a connected weighted graph. It finds a tree of
that graph which includes every vertex and the total weight of
all the edges in the tree is less than or equal to every possible
spanning tree.
Algorithm:-
Step 1 - Arrange all the edges of the given graph G(V,E)G(V,E) in
nondecreasing order as per their edge weight.
Step 2 - Choose the smallest weighted edge from the graph and
check if it forms a cycle with the spanning tree formed so far.
Step 3 - If there is no cycle, include this edge to the spanning
tree else discard it.
Step 4 - Repeat Step 2 and Step 3 until (V-1)(V-1) number
of edges are left in the spanning tree.
15. Now we will rearrange the table in ascending order with
respect to Edge weight -
Edge No. Vertex Pair Edge Weight
E4 (b, c) 1
E7 (c, d) 2
E8 (d, e) 3
E5 (b, e) 4
E6 (b, f) 5
E2 (a, c) 9
E3 (a, d) 13
E9 (d, f) 14
Edge No. Vertex Pair Edge Weight
E4 (b, c) 1
E7 (c, d) 2
E8 (d, e) 3
E5 (b, e) 4
E6 (b, f) 5
E2 (a, c) 9
E3 (a, d) 13
E9 (d, f) 14
16. Since we got all the 5 edges in the last figure, we stop the algorithm and this is the minimal
spanning tree and its total weight is (1+2+3+5+9)=20(1+2+3+5+9)=20.
Prim’s Algorithm:-
INTRODUCTION:-
Prim's algorithm, discovered in 1930 by mathematicians, Vojtech Jarnik and Robert C. Prim, is a
greedy algorithm that finds a minimum spanning tree for a connected weighted graph. It finds
a tree of that graph which includes every vertex and the total weight of all the edges in the
tree is less than or equal to every possible spanning tree. Prim's algorithm is faster on dense
graphs.
Algorithm:-
1. Initialize the minimal spanning tree with a single vertex, randomly chosen from the
graph.
2. Repeat steps 3 and 4 until all the vertices are included in the tree.
3. Select an edge that connects the tree with a vertex not yet in the tree, so that the
weight of the edge is minimal and inclusion of the edge does not form a cycle.
4. Add the selected edge and the vertex that it connects to the tree.
5. Problem:-
Suppose we want to find minimum spanning tree for the following graph G using Prim's
algorithm.
Solution:-
Here we start with the vertex ‘a’ and proceed.
18. This is the minimal spanning tree and its total weight is
(1+2+3+5+9)=20(1+2+3+5+9)=20.
APPLICATION OF MATHEMATICS IN TREE:-
I. In mathematics Tree is Very Important Role. Trees A binary
search tree is a binary tree with the following properties:
19. II. • Each vertex has a value called a key. • The left sub tree of
a vertex contains only vertices with keys less than the
vertex's key. • The right sub tree of a vertex contains only
vertices with keys greater than the vertex's key. • The left
and right sub tree must also be a binary search tree. A
binary search tree for the numbers 1 to 15.
Keywords Child
If u is the parent of v, then v is called a child of u.
Siblings
Vertices with the same parent are called siblings.
Ancestors
The ancestors of a vertex other than the root are the vertices in the path from the root to this vertex, excluding
the vertex itself and including the root.
Descendants
The descendants of a vertex v are those vertices that have v as an ancestor.
Leaf
A vertex of a tree is called a leaf if it has no children.
Internal Vertices
Vertices that have children are called internal vertices. Sub tree
20. If a is a vertex in a tree, the sub tree with a as its root is the
sub graph of the tree consisting of a and its descendants
and all edges incident to these descendants.
m-ary Tree
A rooted tree is called an m-ary tree if every internal vertex
has no more than m children. The tree is called a full m-ary
tree if every internal vertex has exactly m children.
Example of a full 3-ary tree:
Binary Tree
An m-ary tree with m = 2 is called a binary tree.
Ordered Root Tree
An ordered rooted tree is a rooted tree where the children
of each internal vertex are ordered.
21. Left and Right Child
In an ordered binary tree, the first child is called the left
child and the second child is called the right child.
Left and Right Subtree
The tree rooted at the left child is called the left subtree
and the tree rooted at the right child is called the right
subtree.
Theorem 2
A tree with n vertices has n - 1 edges.
Theorem 3
A full m-ary tree with i internal vertices contains n = mi + 1 vertices.
Theorem 4 A full m-ary tree with
. n — 1 (m — 1 )n + 1
1. n vertices has* ~~ m internal vertices ana - m leaves.
2. i internal vertices has n = mi + 1 vertices and l = (m - 1)i + 1
leaves.
ml — 1 .1 — 1
3 . / leaves hasn ~ m - 1 vertices and* ~ m- 1 internal vertices.
Level
22. Height
The height of a rooted tree is the maximum of the levels of
vertices. In other words, the height of a rooted tree is the
length of the longest path from the root to any vertex.
Balanced
A rooted m-ary tree of height h is balanced if all leaves are
at levels h or h - 1.
Theorem 5
There are at most mh leaves in an m-ary tree of height h.
Corollary 1
If an m-ary tree of height h has l leaves, then h > dlogm le.
If the m-ary tree is full and balanced, then h = dlogm le.
Which of these graphs are trees?
This graph is a tree because it is connected
has no simple circuits.
b )
a )
Not a tree because it is not connected.
23. This graph is a tree because it is connected has no
simple circuits.
d )
c )
Not a tree because it has a simple circuit.
This graph is a tree because it is connected has no
simple circuits.
e)
24. Not a tree because it has a simple circuit.
Answer these questions about the rooted tree illustrated
a) Which vertex is a root? a is the root of the tree.
b) Which vertices are internal?
The internal vertices are a,b,c,d,f,h,j,q,t.
c) Which vertices are leaves?
The leaves are e,g,i,k,l,m,n,o,p,r,s,u.
d) Which vertices are children of j?
The children of j are q and r.
e) Which vertex is the the parent of h?
The parent of h is c.
f) Which vertices are siblings of o?
The sibling of o is p.
g) Which vertices are ancestors of m?
The ancestors of m are f,b,a.
h) Which vertices are descendants of b?
The descendants of b are e,fl,m,n.
26. Conclusion
It's often said that mathematics is useful in solving a very wide variety of practical problems. {MathILy,
MathILy-Er} focus on discrete mathematics, which, broadly conceived, underpins about half of pure
mathematics and of operations research as well as all of computer science. As time goes on, more and more
mathematics that is done, both in academia and in industry, is discrete. But what are the actual applications
people talk about when they say discrete mathematics can be applied? What problems are being solved? This
webpage attempts to address those questions. There are short descriptions, with links to longer explanations,
of examples of discrete mathematics as applied to our everyday lives and as used in important and
interesting research and corporate applications.
Everyday applications of discrete mathematics
Computers :-run software and store files. The software and files are both stored as huge strings of 1s and 0s.
Binary math is discrete mathematics.
Networks:- are, at base, discrete structures. The routers that run the internet are connected by long cables.
People are connected to each other by social media ("following" on Twitter, "friending" on Facebook, etc.).
The US highway system connects cities with roads.
Doing web searches :-in multiple languages at once, and returning a summary, uses linear algebra.
Google Maps :-uses discrete mathematics to determine fastest driving routes and times. There is a simpler
version that works with small maps and technicalities involved in adapting to large maps.
Scheduling problems:-like deciding which nurses should work which shifts, or which airline pilots should be
flying which routes, or scheduling rooms for an event, or deciding timeslots for committee
27. meetings, or which chemicals can be stored in which parts of a warehouse---are solved either using graph coloring
or using combinatorial optimization, both parts of discrete mathematics. One example is scheduling games for a
professional sports league.
An analog clock :-has gears inside, and the sizes/teeth needed for correct timekeeping are determined using
discrete math.
Wiring a computer network:- using the least amount of cable is a minimum-weight spanning tree problem.
Encryption and decryption are part of cryptography, which is part of discrete mathematics. For example, secure
internet shopping uses public-key cryptography.
Area codes: How do we know when we need more area codes to cover the phone numbers in a region? This is a
basic combinatorics problem.
Designing password criteria is a counting problem: Is the space of passwords chosen large enough that a hacker
can't break into accounts just by trying all the possibilities? How long do passwords need to be in order to resist
such attacks? (find out here!)
Machine Job Scheduling:-Scheduling tasks to be completed by a single machine uses graph theory. Scheduling
tasks to be completed by a set of machines is a bin-packing problem, which is part of discrete optimization.
Google describes the issue for multiple types of jobs on multiple machines.
Railway planning :-uses discrete math: deciding how to expand train rail lines, train timetable scheduling, and
scheduling crews and equipment for train trips use both graph theory and linear algebra.
Apportionment:- In the U.S., the legislative branch of the government has a House of Representatives with 435
members. The process of
28. Chemistry :-Balancing chemical equations uses linear algebra, and understanding molecular
structure uses graph theory.We can straighten an image taken by a misaligned camera using
linear algebra.Many ways of producing rankings use both linear algebra and graph theory.
Specific examples include ranking relevance of search results using Google, ranking teams
for tournaments or chicken pecking orders, and ranking sports team performances or
restaurant preferences that include apparent paradoxen.
Changing patterns in lizard skin:-are described by discrete cellular automata.
Modeling traffic: -Determining the effect of regulation on network traffic flow---whether
that's cars on roads or packets across the internet---is a matter of game theory and graph
theory together. Optimizing traffic-light cycles uses both discrete and continuous
mathematics.
Design of radar and sonar systems :-uses graph theory via Golomb rulers.
Graph theory is used in DNA sequencing:-
Graph theory is used in neuroscience to study brain network organization (see abstract here)
and understand neuropathology for nervous system disorders.Understanding the spread of
information through a social network---which includes trying to make items go viral---uses
graph theory.Linear algebra and graph theory are used in clustering analysis on geosocial
data to locate gangs and insurgencies.Researchers have used phylogenetic trees, which are
part of graph theory, to test hypotheses for why birds lay eggs of different shapes (also see
.pdf of research article)