0% found this document useful (0 votes)
2 views

Module 5 - Graph Theory (Part-3)

The document provides an overview of tree structures in graph theory, defining key concepts such as trees, forests, leaves, and branch nodes. It discusses properties of trees, including their unique paths, spanning trees, and the relationship between branch nodes and leaves in m-ary trees. Additionally, it presents examples and problems related to tree structures and their applications.

Uploaded by

vishakstud24
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Module 5 - Graph Theory (Part-3)

The document provides an overview of tree structures in graph theory, defining key concepts such as trees, forests, leaves, and branch nodes. It discusses properties of trees, including their unique paths, spanning trees, and the relationship between branch nodes and leaves in m-ary trees. Additionally, it presents examples and problems related to tree structures and their applications.

Uploaded by

vishakstud24
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Dr V Bhuvaneswari

Assistant Professor
Department of Mathematics with Computer
Applications
PSG College of Arts & Science
 A tree is an undirected connected graph with
no simple circuit.
 The elements of trees are called their nodes
and the edges of the tree are called branches.
FOREST:
 A collection of disjoint trees is called a forest.
LEAF:
 A vertex of degree 1 in a tree is called a leaf
or a terminal node.
BRANCH NODE:
 A vertex of degree larger than 1 is called a
branch node or an internal vertex.
 Let a be a branch node in a rooted tree.
 A vertex b is said to be a son of a if there is
an edge from a to b.
 Also, a is said to be the father of b.
 Two vertices are said to be brothers if they
are sons of the same vertex.
 The vertex c is said to be a descendant of a if
there is a directed path from a to c.
 Also a is said to be an ancestor of c.
Proof by induction:
Base case: n = 1
 The only such tree is an isolated vertex. This
is n = 1 vertex and no edges.
 Indeed, n − 1 = 0.
 A graph in which there is a unique path
between every pair of vertices is a tree.
 A connected graph with e=v-1 is a tree.
 A graph with e=v-1 that has no circuit is a
tree.
 G is connected, but if any edge is removed
from E, the resulting graph is disconnected.
 G is acyclic, but if any edge is added to E, the
resulting graph contains a cycle.
 Which of the following graphs are trees?
 a) 𝐺 = (𝑉, 𝐸) 𝑤𝑖𝑡ℎ 𝑉 = {𝑎, 𝑏, 𝑐, 𝑑, 𝑒} 𝑎𝑛𝑑
𝐸 = {𝑎, 𝑏}, {𝑎, 𝑒}, {𝑏, 𝑐}, {𝑐, 𝑑}, {𝑑, 𝑒}}
 b) 𝐺 = (𝑉, 𝐸) 𝑤𝑖𝑡ℎ 𝑉 = {𝑎, 𝑏, 𝑐, 𝑑, 𝑒} 𝑎𝑛𝑑
𝐸 = {{𝑎, 𝑏}, {𝑏, 𝑐}, {𝑐, 𝑑}, {𝑑, 𝑒}}
 c) 𝐺 = (𝑉, 𝐸) 𝑤𝑖𝑡ℎ 𝑉 = {𝑎, 𝑏, 𝑐, 𝑑, 𝑒} 𝑎𝑛𝑑
𝐸 = {{𝑎, 𝑏}, {𝑎, 𝑐}, {𝑎, 𝑑}, {𝑎, 𝑒}
 Which of the following graphs are trees?
 a) 𝐺 = (𝑉, 𝐸) 𝑤𝑖𝑡ℎ 𝑉 = {𝑎, 𝑏, 𝑐, 𝑑, 𝑒} 𝑎𝑛𝑑
𝐸 = {𝑎, 𝑏}, {𝑎, 𝑒}, {𝑏, 𝑐}, {𝑐, 𝑑}, {𝑑, 𝑒}} – Not a tree
 b) 𝐺 = (𝑉, 𝐸) 𝑤𝑖𝑡ℎ 𝑉 = {𝑎, 𝑏, 𝑐, 𝑑, 𝑒} 𝑎𝑛𝑑
𝐸 = {{𝑎, 𝑏}, {𝑏, 𝑐}, {𝑐, 𝑑}, {𝑑, 𝑒}} - Tree
 c) 𝐺 = (𝑉, 𝐸) 𝑤𝑖𝑡ℎ 𝑉 = {𝑎, 𝑏, 𝑐, 𝑑, 𝑒} 𝑎𝑛𝑑
𝐸 = {{𝑎, 𝑏}, {𝑎, 𝑐}, {𝑎, 𝑑}, {𝑎, 𝑒} - Tree
 A directed graph is said to be a directed tree
if it becomes a tree when the directions of the
edges are ignored.
 A directed tree is called a rooted tree if there
is exactly one vertex whose incoming degree
is 0 and the incoming degrees of all other
vertices are 1.
 The vertex with incoming degree 0 is called
the root of the rooted tree.
 In the following example,
the root is enclosed in a
small circle.
 All rooted trees with one,
two, three and four
vertices are shown.
 The path length of a vertex in a rooted tree is
defined to be the number of edges in the path
from the root to the vertex.
 Example: Find the path lengths of the nodes b,
f, l, q.
 .
 Solution:
 The path length of node b is one.
 The path length of node f is two.
 The path length of node l is three
 The path length of the node q is four.
 A tree whose graph vertices and graph edges
form subsets of the graph vertices and graph
edges of a given tree .
 An ordered tree is a rooted tree with the
edges incident from each branch node
labeled with integers 1,2,...,i,...
 An ordered tree in which every branch node
has atmost m sons is called an m-ary tree.
 An m-ary tree is said to be regular if every
one of its branch nodes has exactly m sons
 An important class of m-ary trees is binary
trees.
 A binary tree is defined as a tree in which
there is exactly one vertex of degree two and
each of the remaining vertices is of degree
one or three.
 The number of vertices in a binary tree is
always odd.
 The number of pendant vertices in a binary
tree is (n+1)/2 where n is the number of
vertices.
No. of pendent
vertices =
(9+1)/2=5

No. of vertices =
9 (odd)
 Therefore, for a binary (ordered) tree the
subtrees are called the left subtree and the
right subtree.
 The relationship between i, the number of
branch nodes, and t, the number of leaves of
a regular m-ary trees is
(m-1)i=t-1
 Consider the problem of connecting 19 lamps
to a single electric outlet by using extension
cords each of which has four outlets. How
many extension cords are needed to connect
the lights?
 Sol:
Here m=4, t=19,
(4-1)i=19-1
i=18/3
i=6.
Hence six extension cords are needed to connect the
lights.
 Consider a hypothetical computer that has an
instruction which computes the sum of three
numbers. Suppose we want to find the sum of
nine numbers, in how many ways the additional
instruction is being executed?
 Sol:
Here m=3, t=9
(3-1)i=9-1
i=8/2
i=4
Hence additional instruction will always being
executed four times.
 Set of sequence is said to be prefix code
◦ It is alloted at level 1
◦ It is in the form of 0,1
◦ It is applicable to binary tree
◦ For left branch assign 0 and right branch assign 1
◦ Continue the same for all the leaf nodes
 Let w1,w2,...,wt be the weights of the leaf
nodes.
◦ Step1: Arrange weights in increasing order
◦ Step2: Construct new nodes by adding minimum
weight leaf nodes w1 & w2.
◦ Step3: Repeat above step till last node.
 A tree B is called spanning tree if it is without
circuits and it contains all vertices of G.
 If any vertex is missed, it is not a spanning tree.
 A spanning tree of a connected graph is a
spanning subgraph of the graph which is a tree.
 A spanning tree contains unique path between
any two vertices in a graph
 A branch of a tree is an edge of the graph
that is in the tree.
 A chord or a link of a tree is an edge that is
not in a tree.
 The set of all chords of a tree is referred to as
the complement of the tree.

Branch Chords
 A connected graph always contains a
spanning tree.
 For a connected graph with e edges and v
vertices, there are v-1 branches in any
spanning tree.
 Relative to any spanning tree, there are e-
v+1 chords.

Spanning
Tree No of
Graph
V-1=4 chords=E
V=5
branches -V+1=8-
E=8
5+1=4
 Cut set partitions all the vertices in a
connected graph into two disjoint sets.
(OR)
 In a connected graph G a cut-set is a set of
edges whose removal from G leaves G
disconnected.
 Cut set always contain only branch and rest
of chords. Such a cut set is called as
fundamental cut set

You might also like