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

Financial Math, can you help me with financial math??

can you help me with financial math??

How far did the ?rst arrow goes, From a fixed point directly in front of th...

From a fixed point directly in front of the center of a bull's eye, Kim aims two arrows at the bull's eye. The first arrow nicks one point on the edge of the bull's eye; the second

Rolle''s theorem, The curve (y+1) 2 =x 2 passes by the points (1, 0) and ...

The curve (y+1) 2 =x 2 passes by the points (1, 0) and (- 1, 0). Does Rolle's Theorem clarify the conclusion that  dy dx  vanishes for some value of x in the interval -1≤x≤1?

Integrate even or odd function, Integrate following. ∫ -2   2 4x 4 - ...

Integrate following. ∫ -2   2 4x 4 - x 2   + 1dx Solution In this case the integrand is even & the interval is accurate so, ∫ -2   2 4x 4 - x 2   + 1dx = 2∫ o

How much can they deduct from childcare expenses, A family may deduct 24% o...

A family may deduct 24% of their childcare expenses from their income tax owed. If a family had $1,345 in childcare expenses, how much can they deduct? Find out 24% of $1,345 b

Fractions Word Problem, 1/8 of the passengers of a train were children.If t...

1/8 of the passengers of a train were children.If there were 40 children travelling in the train on a certain day,how many adults were there in that train that day?

Give an equations with the variable on both sides, Give an Equations with t...

Give an Equations with the variable on both sides ? Many equations that you encounter will have variables on both sides. Some of these equations will even contain grouping sy

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