Minimum spanning tree (MST)

Minimum spanning tree (MST)

Minimum spanning tree for a weighted graph  G is a spanning tree such that the sum of the weight is less than (or)equal to sum of weights of every other spanning tree of G i.e., in a minimum spanning tree , the sum or weight ‘B’ of the edges is as small as possible . There are two important algorithms to obtain minimum spanning tree.They are :

Prisms algorithm

Kruskals algorithm

Prisms Algorithm :

we will consider all the vertices first when we select an edge with minimum weight . The algorithm proceeds by selecting adjacent edges with minimum weight care  should be taken for  not forming circuit.


Let us consider the prism’s algorithm with the help of some Ex :

minimal spanning tree

Step 1:

step1
Total weight =0

Step 2:

step2


Total weight =10

Step 3:

step3


Total weight =33

Step 4:

step4








Total weight = 53

Step 5:

step5







Total weight = 64

Step 6:

step6








Total weight = 78

Step 7:

step7







Total weight = 90

Time Complexity : This  algorithm spends more time in finding the smallest edge , so time of the algorithm basically depends on how do we search the edges.
 therefore prisms algorithm run in o(n2) times.
  
Kruskal’s Algorithm :

Always the minimum cast edge has to be selected.

minimal spanning tree











Step 1:

step1








Total weight =0

Step 2:

Step2







Total weight =10

Step 3:


step 3








Total weight =21

Step 4:

step 4








Total weight = 33


Step 5:

step 5








Total weight= 47


Step 6:

step 6









Total weight -67


Step 7:

step 7









Total weight=90





Related

Binary Tree Traversals ?

Traversing is the process of passing through every node exactly once in a binary tree. Traversing is also  called as visiting. There are 3- ways of traversing techniques. 1. preorder 2....

What is Binary search tree or sorted tree ?Write Algorithms for Binary Search Tree

Binary search tree:    This is another kind of tree data structure which is the variation of binary tree . A binary  search tree satisfy the following properties. 1. one of the...

Write Algorithms for Tree Traversal Techniques

Algorithms for Tree Traversal Techniques: Algorithm for Preorder :This is recursive process according to this traversal technique 1st visits the root node then visit the left sub tree then it v...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item