Write prim's algorithm, Mathematics

Assignment Help:

Write Prim's Algorithm.  

Ans: Prim's algorithm to find out a minimum spanning tree from a weighted graph in step by step form is given below. 

Let G = (V, E) be graph and S = (VS, ES) be the spanning tree to be found from G.

Step 1: Choose a vertex v1 of V and initialize 

VS = {v1} and

ES

= {}

Step 2: Choose a nearest neighbor of vi from V that is adjacent to some vj∈VS and that edge (vi, vj) does not form a cycle with members edge of ES. Set

VS = VS ∪{vi} and

ES = ES ∪{(vi, vj)}  

Step 3: Again Repeat step2 until |Es| = |V| - 1.


Related Discussions:- Write prim's algorithm

Hieght and distances, A boy standing in the middle of a field, observes a f...

A boy standing in the middle of a field, observes a flying bird in the north at an angle of elevation fo 30 degree. and after 2 min, he observes the same bird in the south at an an

Find the polynomial zeros , If two zeros of the polynomial f(x) = x 4 - 6x...

If two zeros of the polynomial f(x) = x 4 - 6x 3 - 26x 2 + 138x - 35 are 2 ± √3.Find the other zeros.     (Ans:7, -5) Ans : Let the two zeros are 2 +√3 and 2 - √3 Sum of

Compare and contrast african immigrants, Compare and contrast African immig...

Compare and contrast African immigrants with our immigrant groups? How are they different? What are the implications of these differences for their adjustment to the larger society

Calculate the probability, Calculate the Probability A bag contains 80...

Calculate the Probability A bag contains 80 balls of such 20 are red, 25 are blue and 35 are white.  A ball is picked at random what is the probability that the ball picked is

Measures of central tendency-computation method, Computation method   ...

Computation method           Whereas L = Lower class boundary of the class having the mode             f 0 = Frequency of the class below the modal class

Sets, What is the subset of {a,b,c}

What is the subset of {a,b,c}

Ordinary differential equation, find the normalised differential of the fol...

find the normalised differential of the following {1,x,x^3}

.fractions, what is the difference between North America''s part of the tot...

what is the difference between North America''s part of the total population and Africa''s part

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd