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

Regression and correlation analysis on income and ex, regression and correl...

regression and correlation analysis on income and expenditure

Andrew is helping his mom remodel his room, The perimeter of Andrew''s rect...

The perimeter of Andrew''s rectangular room is 44 feet. What equation was used to find the perimeter?

Calculate the gains from trade, Table shows the productivity for the countr...

Table shows the productivity for the countries Pin and Pang. 1) If the working population of Pin and Pang are both 6 million, divided equally between the two industries in

An even function, Assume that   i)  Determine all the roots of f...

Assume that   i)  Determine all the roots of f(x) = 0. ii)  Determine the value of k that makes h continuous at x = 3. iii)  Using the value of k found in (ii), sh

The dimensions are 2x and 4x what is area of sara''s bedroom, Sara's bedroo...

Sara's bedroom is within the shape of a rectangle. The dimensions are 2x and 4x + 5. What is the area of Sara's bedroom? Because the area of a rectangle is A = length times wid

Proportions, How would you solve this question? 4/5 = 8/x+2

How would you solve this question? 4/5 = 8/x+2

Prove that bd/cd = bf/ce, In the given figure, ∠AEF=∠AFE and E is the mid-p...

In the given figure, ∠AEF=∠AFE and E is the mid-point of CA. Prove that BD/CD = BF/CE Ans:    Draw CG ¦DF In ΔBDF CG ¦ DF ∴ BD/CD = BF/GF     .............(1)

Find the number of zeros of the polynomial, Find the number of zeros of the...

Find the number of zeros of the polynomial from the graph given. (Ans:1)

Find the generating function, Find the generating function for the number o...

Find the generating function for the number of r-combinations of {3.a, 5.b, 2.c}          Ans:  Terms sequence is given as r-combinations of {3.a, 5.b, 2.c}. This can be writte

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