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

Find the discount factors and linear interpolation, Question: All rates...

Question: All rates should be calculated to 3 decimal places in % (e.g. 1.234%), the discount factors to 5 decimal places (e.g. 0.98765), and the bond prices to 3 decimal place

How much more does she required to sell to meet her goal, Hanna's sales tar...

Hanna's sales target for the week is $5,000. So far she has sold $3,574.38 worth of merchandise. How much more does she required to sell to meet her goal? You must ?nd out the

Mr, Probability of A is 85% Probability of B is 45% Probability A and B 56%...

Probability of A is 85% Probability of B is 45% Probability A and B 56% What is the probability of not either A or B?

Prove that x2 + y2 - 8x - 10y +39 = 0, If the points (5, 4) and (x, y) are ...

If the points (5, 4) and (x, y) are equidistant from the point (4, 5), prove that x 2 + y 2 - 8x - 10y +39 = 0. Ans :   AP = PB AP 2 = PB 2 (5 - 4) 2 + (4 - 5) 2 = (x

Class 10, The value of K for (k+1)x^2-2(k-1)x+1 = 0 has real and equal root...

The value of K for (k+1)x^2-2(k-1)x+1 = 0 has real and equal roots.

Project, report on shares and dividend using newspaper

report on shares and dividend using newspaper

Radius of rhim, how long is the radius of car tyre?

how long is the radius of car tyre?

Conditional probability - rules of probability, Conditional probability - R...

Conditional probability - Rules of Probability This is the probability associated with combinations of events but given that some prior result has already been achieved with o

What was his weight within pounds and ounces, Justin weighed 8 lb 12 oz whi...

Justin weighed 8 lb 12 oz while he was born. At his two-week check-up, he had gained 8 ounces. What was his weight within pounds and ounces? There are 16 ounces within a pound.

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