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

Lengrange''s mean value theorem, real life applications of lengrange''s mea...

real life applications of lengrange''s mean value theorem

Numeric patterns, Kelli calls her grandmother every month Kelli also calls ...

Kelli calls her grandmother every month Kelli also calls her cousin.If Kelli calls her cousin in January, how many calls will Kelli have made to her grandmother and her cousin by t

Which expression below is equal to 5, Which expression below is equal to 5?...

Which expression below is equal to 5? The correct order of operations must be used here. PEMDAS tells you in which you should do the operations in the subsequent order: Pare

Inverse function, how to solve the equation of an inverse function

how to solve the equation of an inverse function

Properties of dot product - proof, Properties of Dot Product - proof P...

Properties of Dot Product - proof Proof of: If v → • v → = 0 then v → = 0 → This is a pretty simple proof.  Let us start with v → = (v1 , v2 ,.... , vn) a

Analytical geometry, convert the equation 4x^2+4y^2-4x-12y+1=0 to standard ...

convert the equation 4x^2+4y^2-4x-12y+1=0 to standard form and determine the center and radius of the circle. sketch the graph.

Find the third vertex of equilateral triangle, If two vertices of an equila...

If two vertices of an equilateral triangle are (0, 0) and (3, 0), find the third vertex. [Ans: 3/2 , 3/√ 3/2  or 3/2, -3√ 3/2] Ans:    OA = OB = AB OA 2 = OB 2 = AB 2

Explain factor by grouping, Explain Factor by Grouping ? Factoring by g...

Explain Factor by Grouping ? Factoring by grouping is often a good way to factor polynomials of 4 terms or more. (Sometimes it isn't. It doesn't always work. But it's worth try

Iti, Gm signal is better than am signal becuase

Gm signal is better than am signal becuase

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