0% found this document useful (0 votes)
4 views12 pages

Lec 39

The lecture discusses the concept of trees in graph theory, defining a tree as a connected graph without cycles and explaining that a tree has one and only one path between any two vertices. It also covers the properties of trees, including their chromatic number being 2 and the concept of spanning trees, which include all vertices of a graph while maintaining tree properties. Additionally, the lecture introduces minimal spanning trees, which are spanning trees with the smallest sum of edge lengths among all spanning trees of a graph.

Uploaded by

anandvivekraj734
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)
4 views12 pages

Lec 39

The lecture discusses the concept of trees in graph theory, defining a tree as a connected graph without cycles and explaining that a tree has one and only one path between any two vertices. It also covers the properties of trees, including their chromatic number being 2 and the concept of spanning trees, which include all vertices of a graph while maintaining tree properties. Additionally, the lecture introduces minimal spanning trees, which are spanning trees with the smallest sum of edge lengths among all spanning trees of a graph.

Uploaded by

anandvivekraj734
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/ 12

Higher Engineering Mathematics

Professor P N Agrawal
Department of Mathematics
Indian Institute of Technology Roorkee
Module 08
Lecture 39
Trees - I

Hello friends, welcome to my lecture on Trees. A connected graph without any circuit or
cycle ok, circuit is also called cycle, so a connected graph without any circuit is called a tree.

(Refer Slide Time: 0:39)

For example you can look at this graph, it is a tree okay, you can see there is no cycle in this,
but if you look at this graph there is a cycle here. You can see, you can start from here, you
can follow this path and you can come back here so there is a cycle in this graph and
therefore it is not a tree, this graph is however a tree because there is no circuit in this graph
and it is a connected graph.
(Refer Slide Time: 1:05)

Now, let us see these ones, this is the tree with one vertex, this is the tree 2 vertices, this is the
tree with 3 vertices, this is the tree with 4 vertices and this is another tree with 4 vertices ok.
Now, parallel edges and self-loops both form circuits and therefore, a tree cannot have
parallel edges and self-loops, thus a tree has to be a simple graph.

(Refer Slide Time: 1:32)

A graph G is a tree is and only if there is one and only one path between any 2 vertices of G.
First, let us suppose that the graph is a tree, then by definition of tree, G is a connected graph.
We have said that a connected graph is called a tree if it has no cycle okay, if it has no cycle.
A connected graph without any circuit or cycle is called a tree. So, if the graph is a tree then
by definition of tree, G is a connected graph therefore, there must exist at least one path, if it
is a connected graph there must exist at least one path between any 2 vertices in G.

Now suppose that there are 2 distinct paths between vertices A and B of G okay, then the
union of these 2 paths will contain a circuit and G cannot be a tree okay so there is only one
and only one path between any 2 vertices of G.

(Refer Slide Time: 2:29)

Conversely, suppose that there is one and only one path between any 2 vertices of G, let us
show that G is a tree okay. Since, there exist a path between any 2 vertices of G therefore G is
connected, so first thing we have shown is that G is a connected graph. Now, let us show that
it is without any circuit. So, a circuit in a graph with 2 or more vertices implies that there
exist a pair of vertices a and b such that there are 2 distinct paths between a and b, okay, that
is the meaning of circuit. Since, G has one and only one path between the 2 vertices, G can
have no circuit and therefore G must be a tree.
(Refer Slide Time: 3:10)

Now, let us go to this theorem, let G be a finite graph with n > 1 vertices, then if G is a finite
graph with n > 1 vertices then the following are equivalent. G is a tree implies and implied
by, G is cycle free and has n - 1 edges, ok. Now, G is a tree means it is a connected graph and
it is without any circuit, connected graph without any circuit means it is cycle free, without
any circuit means it is cycle free and moreover it is connected so every vertex between any 2
vertex there is an edge, one and only one edge, okay therefore it has n – 1 edges ok.

Now 2 implies 3 so 1 implies 2, 2 implies 3, 2 implies 3 because G is cycle free and has n – 1
edges so G is connected and cycle free and cycle free and has n - 1 edges means you take any
2 vertices okay, since it has n - 1 edges, n - 1 edges means between any 2 vertices there
cannot be more than one edge ok. So there are n vertices, there are n - 1 edges therefore
between any 2 vertices there is an edge so G is connected and has n - 1 edges ok and if G is
connected and has n-1 edges then g is a tree.
(Refer Slide Time: 4:33)

Now every tree with 2 or more vertices, if you take any tree with 2 or more vertices it is 2
chromatic. That means if you take a tree with 2 vertices or more than 2 vertices, it can be
painted with 2 colors ok, minimum number of colors that can be used to paint this tree will be
2 okay. So, let T be a tree and V be any vertex in T ok, V be any vertex in T so let us that this
be a vertex ok, assign color 1, color 1 we can assign to this vertex, assign all the P vertices
adjacent to V with color 2 ok. Suppose this is like this okay so and then it is like this so this
one and then you can say this one, this one okay and this one this one okay so, let us say this
is this vertex okay, this vertex is adjacent to this one so it will be painted with color 2 and this
vertex is adjacent to this vertex will be painted with color 2.

And then this vertex is adjacent to 2, it will be painted with color 1, this vertex is adjacent to
2 it will be painted with color 1. And here this vertex is adjacent to this vertex it will be
painted with color 1 and this is also adjacent to this so it will be painted with color 1, so 2
colors are required to paint a tree okay. If there are only 2 vertices okay then you have a
graph, you have this graph okay which is a tree okay. So in such case 1 color will be needed
to color this and one color will be needed to color this so 2 colors are required if the tree has
2 vertices.

And if it has more than 2 vertices then you need again 2 colors only to color it ok. So assign
all the P vertices adjacent to V with color 2 and assign color 1 to all vertices adjacent to the
vertices of color 2 like we have done here, continuing the process till every vertex in T is
colored. Since there is one and only one path between any 2 vertices in a tree, no 2 adjacent
vertices will have the same color ok. So, T has been properly colored with 2 colors. Since T
has at least 2 vertices okay, so it will have at least one edge and therefore, one color will not
be enough, hence therefore, T is 2-chromatic.

(Refer Slide Time: 7:04)

So this one we have, this is vertex V ok, this vertex is adjacent to V so it is colored with color
2, V is colored with color 1, it is colored with color 2, this vertex is adjacent to this vertex V
so it is also colored with color 2. Now this is adjacent to this vertex so it is colored with color
1, this is adjacent to this vertex so it is also colored with color 1, here this vertex in adjacent
to this and it is colored with 1 so it will be colored with 2 and then this is adjacent to this so it
will be colored with 1, this is adjacent to this so it is colored with 2, this is adjacent to this so
it will be colored with 2, so you can see that the entire tree can be colored with just 2 colors.

(Refer Slide Time: 7:50)


Now, converse of the above theorem is true that is to say the graph is 2-chromatic ok, if a
graph is 2 chromatic then it not need be a tree ok. So for example, this one, you can see this
graph okay, this graph with 4 vertices you can see this is a here we are using 2 colors to color
the vertices of this graph. This is colored with color 1, this is colored with color 2, this is
colored with color 1, this is colored with color 2 so adjacent vertices have different colors ok.
Now, so it is a 2 chromatic, chromatic number here is 2, χ(G) = 2 but you can see it is not a
tree because between any 2 vertices there must be one and only one path. But here you can
see suppose you take this vertex ok then you have one path is this, this path ok.

One path is AB, the other path is this one AB, AC, CB, DB ok so that is another path between
A and B so there is not one and only one path between any 2 vertices here therefore this is not
a tree. Or you can see it is a cycle, you can start with A, you can go along AC then CD then
DB, you can come along DA back to A so it is also a cycle and therefore it is not… It is a
connected graph but it is not a cycle. It is a cycle, connected graph without any cycle is called
tree and here it is a connected graph with a cycle so it is not a tree. So 2 chromatic graph, a
graph which is 2 chromatic need not be a tree.

(Refer Slide Time: 9:42)


Now, let us consider a subgraph T of a graph G ok, a subgraph T of a graph G is called a
spanning tree if T is a tree and T includes all the vertices of G. Can see this graph okay, there
are 9 vertices okay so number of vertices is 9. Now, let us consider a spanning tree, a
spanning tree means it is a tree which has N vertices, all the vertices of this graph okay and it
is a tree. Now you can see here it is not a tree, it is not a tree because between any 2 vertices
there does not exist one and only one path so it is not a tree ok. We will find a spanning tree
here that is a graph which has all these N vertices and it is a tree so let us see this one.

(Refer Slide Time: 10:41)

You can see this graph, it is all N vertices, it has 9 vertices you can see and we have come to
this graph by removing the edge of the previous graph, this edge has been removed okay and
these edges have been removed, this edge and this edge okay so and moreover this edge is
also removed this one ok. So we have removed this one, we have removed this one, we have
removed this one and we have removed this one and we have removed this one ok, yeah and
also this one. So this, this, this okay this one has been removed, this one has been removed,
this one has been removed, this one, this one and this one ok so these edges are removed and
we come to this.

Now you can see, between any 2 vertices there is one and only one path okay. Suppose you
take this one these 2 vertices, there is one and only one path, between these 2 there is only
one path and this is only one path ok there is only one path between any 2 vertices here so
this is a tree and number of vertices is 9, so it is a spanning tree ok.
(Refer Slide Time: 12:24)

Now, here let us look at the other figure, this is also further obtained from here ok so we have
this, this we have removed this one, we have removed this one, this one we have removed
okay and then we have removed this one, this one we have removed okay, this one we have
removed and then we have removed this one, this one okay and we have removed this one,
this one and this one okay. So after removing these edges we reach here ok. And you can see
now between any 2 vertices here there is one and only one path okay, so it includes all the N
vertices here so it is also a spanning tree so two possible spanning trees are given here.

(Refer Slide Time: 13:27)

Now, minimal spanning trees, suppose G is a graph whose edges are assigned lengths ok,
here you can see a graph whose edges are assigned lengths that is are labeled with positive
numbers. T is called minimal spanning tree if all, among all the spanning trees of G, T has the
smallest sum length. The labeled graph G in the figure given below has 3 spanning trees, we
have 3 spanning trees where the first part is find the spanning trees of G and their lengths,
which is the minimal spanning tree of G so you can see 3 minimal spanning trees here which
are spanning trees okay.

(Refer Slide Time: 14:04)

And we can find the length of each of these trees and then see which one has the minimum
sum length okay so we have this graph. Okay so let us draw the graph here so 2, 6, 2, 3, 3, 1
ok so, now this one has length 2, this one has length 6, this one has length 2 ok this one has
length 3, this one has length of 1 ok, we have removed this edge to reach here.

And then we consider this we remove this edge to get this one and we have removed this
edge to get this one. So we have 2, 3, 2, 3, 1 and then we have here 2, 6, 3, 3, 1 ok so let us
find the minimum length ok; 2 + 6 + 2 + 3 + 1, so T 1 has 14 so sum length here is 14. 2 + 3
is 5 + 2 is 7 + 3 is 10 and then 11 so T 2 has sum length 11 and here 2 + 3 + 6 + 3 + 1 is 15 so
T 2 has the minimum sum length, so minimal spanning trees.

Okay they are all spanning trees but T 2 has the smallest sum length ok and therefore, T 2 is the
minimal spanning tree. So for the given graph we first find all the spanning trees and then
calculate the sum length so then we will find out the smallest sum length, the spanning tree
for which we get the smallest sum length will then be the minimal spanning tree. So that is
the end of my lecture, thank you very much for your attention.

You might also like