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

.fractions, what is the difference between North America''s part of the tot...

what is the difference between North America''s part of the total population and Africa''s part

Hi, can i get job of teaching maths here

can i get job of teaching maths here

Matrix, matrix of [1 4 ] [a b]=4/9

matrix of [1 4 ] [a b]=4/9

Quantitative analysis, Suppose the economy is now ‘open’ and thus has an ex...

Suppose the economy is now ‘open’ and thus has an external demand (e.g. from the government, exports, etc.) of the dollar amounts for each respective industry. In the latest budget

How much does every person required to pay rob, Rob purchased picnic food f...

Rob purchased picnic food for $33.20 to share along with three of his friends. They plan to split the cost evenly among the four friends. How much does every person required to pay

Business mathematics, explain how business mathematics in an inbu;it compo...

explain how business mathematics in an inbu;it component of a payroll package

Find out the x-intercepts, Find out the x-intercepts & y-intercepts for eac...

Find out the x-intercepts & y-intercepts for each of the following equations.                            y =x 2 +x - 6 Solution As verification for each of these we wil

Utilizes the infinite definition of the limit to prove limit, Utilizes the ...

Utilizes the definition of the limit to prove the given limit. Solution Let M > 0 be any number and we'll have to choose a δ > 0 so that, 1/ x 2   > M

Quadriatic-equations, Q. a(b - c)x^2 + b(c - a)x + c(a - b) = 0 has equal r...

Q. a(b - c)x^2 + b(c - a)x + c(a - b) = 0 has equal roots then b = ? Ans: Condition that a quadratic equation ax² + bx + c = 0 has equal roots is: Its discriminant, b² - 4ac = 0 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