Professional Documents
Culture Documents
𝐺1 𝐺3 𝐺5
𝐺2 𝐺4 𝐺6
Terminal Node or Leaf :
That vertex whose degree one is Root
1 2
4
3
Trees 1,2,3,4,5 are sapping tree of given graph .
2 and 3 are isomorphic trees.
Minimum Spanning Tree : If G is a connected weighted
graph , the spanning tree of G with the ( sum of the
weights of its edges) is called the minimum spanning tree
of G.
Kruskal’s Algorithm:
Step1: Name all the vertices and also list all the edges in
the increasing order of their weights.
Step2: Get the first edge by joining the vertices of mi
nimum weight.
Step 2: Get the second edge by joining the vertices of
next minimum weight.
Step4: repeat the above step till you get a spanning tree .
You have joined all the vertices.
Step1: Name all the vertices
and also list all the edges in the
increasing order of their weights
A
2 6
8 4
E B
6
4 8
7 6
C
D 3
Edge Weight Included in the spanning If not included circuit
tree or not formed
AE 2 YES -
CD 3 YES -
AC 4 YES -
CE 4 NO A-E-C-A
AB 6 YES -
BC 6 NO A-B-C-A
BE 6 - -
DE 7 - -
AD 8 - -
BD 8 - -
Weight 2 is minimum on edge AE , draw it. Next minimum
weight3 on CD, draw it. Again start next minimum weight
4 on edge AC, draw it. Next minimum weight 4 on edge
CE ,that is rejected because A-E-C-A makes a cycle.
Again selected weight 6 on AB ,draw it . All the vertices
have completed and minimum spanning tree constructed.
Total length=2+3+6+4=15
Other Alternating minimum spanning tree of total length
15 whose edges are listed below.
(1)AE,CD,AC,BC (2) AE, CD,AC,BE (3)AE,CD,CE,AB
(4)AE,CD,CE,BC (5)AE,CD,CE,BE
Q . Find the minimum spanning tree of following graph.
(a)
(b)
Kruskal’s algorithim:
First draw the given graph with the weights of the edge.
Step1: list all the edges in decreasing order of costs.
Step2: select the maximum cost and which forms a cycle .
Delete this edge say and get the graph G’-G. If G’ is a tree
the problem is solved . If G’ is a cycle go to the step two.
Step3: again select an edge which has maximum weight in
G’ and which form a cycle in G’. Delete this edge also say
and get the graph G”-G’. If G” is a tree the problem is
solved. If G’’ is not atree repeat the step till you get
Minimum spanning tree.
Q.Find the Minimum spanning tree.
𝑣4
Total cost=1+2+2+4+1+6=16
Rooted tree: A particular vertex is selected as the root
and every egde is directed away from the root, “so a
directed graph with root is called root tree.
a
a e
x: is the root
d c
d,c: are the leaves
a,e: are internal vertex
a is the parent of d , e is the parent of c
Properties :
(1)In a tree there is one and only one path between every
pair of vertices.
(2)A tree with n vertices has (n-1)edges .