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

Math, what is quantity ?

what is quantity ?

Equations and Inequalities, Write an algebraic expression for “Julie runs t...

Write an algebraic expression for “Julie runs three miles less than twice the number of miles,

Differential Equation, #i hve two qestion on Differential Equation i need s...

#i hve two qestion on Differential Equation i need solve it..

Do yall, do yall help kids in 6th grade

do yall help kids in 6th grade

Estimate the position of an object at any time, The position of an object a...

The position of an object at any time t (in hours) is specified by, s (t ) = 2t 3 - 21t 2 + 60t -10 Find out when the object is moving to the right and whiles the object

Factorization of expressions, Above we have seen that (2x 2 - x + 3)...

Above we have seen that (2x 2 - x + 3) and (3x 3 + x 2 - 2x - 5) are the factors of 6x 5 - x 4 + 4x 3 - 5x 2 - x - 15. In this case we are able to find one facto

Geometry, find the value of 0 that makes cos 21 degrees = sin 0 statement t...

find the value of 0 that makes cos 21 degrees = sin 0 statement true.

Find the maximum expected holdings, Problem: A person has 3 units of mo...

Problem: A person has 3 units of money available for investment in a business opportunity that matures in 1 year. The opportunity is risky in that the return is either double o

Permuation and combination, how many words can be formed from letters of wo...

how many words can be formed from letters of word daughter such that each word contain 2vowles and 3consonant

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