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

Negative and positives, in 1970 a record 1.5 of rain fell in one minute at ...

in 1970 a record 1.5 of rain fell in one minute at Basse Terre, guadaloupe in the caribbnean.at this rate, how much rain fell in 3 seconds or 0.05 of a minutes?

Factor , #Mai iss 3 years younger than twice the age of her brother . If b ...

#Mai iss 3 years younger than twice the age of her brother . If b represents the age of Mai''s brother .which expression below represents Mai''s age 2-3b 3-2b 2b-3 3b-2 2-3b 3-2b q

Differential equation, Find the normalized differential equation which has ...

Find the normalized differential equation which has {x, xex} as its fundamental set

Find the ways to choose a president and a secretary, Q. There are 10 studen...

Q. There are 10 students on the school debating team. How many different ways can the team choose a president and a secretary? Ans. There are 10 choices for the president

Marketing, What''s the price for a Marketing plan assignment ( postgraduate...

What''s the price for a Marketing plan assignment ( postgraduate)5000 words?

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