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

Solve for x and y liner equation, Solve for x , y (x + y - 8)/2   ...

Solve for x , y (x + y - 8)/2   =( x + 2  y - 14)/3 = (3 x + y - 12 )/ 11   (Ans: x=2, y=6) Ans :     x+ y - 8/2  =   x + 2y - 14 /3  =    3x+ y- 12/11

Characteristics of time series, Characteristics of Time Series Time se...

Characteristics of Time Series Time series has the given characteristics. a) A long term trend (T) -tendency of the whole series to fall and rise. b) Seasonal variati

Find the co ordinates of p such that ap =3/7 ab and p lies, If A & B are (-...

If A & B are (-2,-2) and (2,-4) respectively, find the co ordinates of P such that AP =3/7 AB and P lies on the line segment AB.

Standard deviation, 2.When investigating times required for drive-through s...

2.When investigating times required for drive-through service, the following results (in seconds) were obtained. Find the range, variance, and standard deviation for each of the tw

Find out the taylor series for f (x) = ex about x = 0, Find out the Taylor ...

Find out the Taylor Series for f (x) = e x about x = 0. Solution In fact this is one of the easier Taylor Series that we'll be asked to calculate.  To find out the Taylor

staticis, a statisics professor plans classes so carefully that the length...

a statisics professor plans classes so carefully that the lengths of her classes are uniformly distributed between 46.0 and 56.0 minutes. find the probability that a given class pe

Inverse functions, We have seen that if y is a function of x, then fo...

We have seen that if y is a function of x, then for each given value of x, we can determine uniquely the value of y as per the functional relationship. For some f

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