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

Systems of differential equations, For this point we've only looked as solv...

For this point we've only looked as solving particular differential equations. Though, many "real life" situations are governed through a system of differential equations. See the

Algebra, please tell me what is algebra and how i can understand it

please tell me what is algebra and how i can understand it

Ellipse, How we find locus of the middle points of chord of an ellipse whic...

How we find locus of the middle points of chord of an ellipse which are drawn through the positive end of the minor axes

Explain the dependent events, Explain the Dependent Events? Events are ...

Explain the Dependent Events? Events are called dependent events when the outcome of one event influences the outcome of the second event. P(A and B) = P(A) P(B following A

In terms of x what is the total number of miles they rode, Noel rode 3x mil...

Noel rode 3x miles on his bike and Jamie rode 5x miles on hers. In terms of x, what is the total number of miles they rode? The terms 3x and 5x are such as terms since they hav

Fractions, what Is the common denominator for 1/2 and 1/4

what Is the common denominator for 1/2 and 1/4

How to solve lim 1-cos(x)/1-cos(4x) as x tends to zero, Use L''hopital''s r...

Use L''hopital''s rule  since lim X-->0  1-cos(x)/1-cos(4x)  is in the indeterminate form 0/0 when we apply the limt so by l''hoptital''s rule differentiate the numerator and den

Calculate the average, During 2008 the average number of beds required per ...

During 2008 the average number of beds required per day at St Hallam's hospital was 1800.  During the first 50 days of 2008 the average daily requirement for beds was 1830, with a

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