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

Slope, #question.Find the slope of the line that passes through (7, 3) and ...

#question.Find the slope of the line that passes through (7, 3) and (9, 6). Simplify your answer and write it as a proper fraction, improper fraction, or integer. .

Discount, outdoor grill- regular price:$360 discount:33 1/3%

outdoor grill- regular price:$360 discount:33 1/3%

Infinity, Are there more rational numbers than integers?#

Are there more rational numbers than integers?#

How many gumdrops, Will has a bag of gumdrops. If he eats 2 of his gumdrops...

Will has a bag of gumdrops. If he eats 2 of his gumdrops, he will have among 2 and 6 of them left. Which of the subsequent represents how many gumdrops, x, were originally in his b

Integration, ((1/x^1/2-(x-1)^1/2)+(1/(5-3(x-1)^2)^1/2)

((1/x^1/2-(x-1)^1/2)+(1/(5-3(x-1)^2)^1/2)

Estimate the probability, The following (artificial) data record the length...

The following (artificial) data record the length of stay (in days) spent on a psychiatric ward for 28 consecutive patients who have been sectioned under the mental health act, cla

Division of two like terms, Case 1: Suppose we have two terms 8ab and 4ab. ...

Case 1: Suppose we have two terms 8ab and 4ab. On dividing the first by the second we have 8ab/4ab = 2 or 4ab/8ab = (1/2) depending on whether we consider either 8ab or 4ab as the

Equation of line which perpendicular to the given line, Perpendicular to th...

Perpendicular to the line given by 10 y + 3x= -2 For this part we desire the line to be perpendicular to 10 y + 3x= -2 & so we know we can determine the new slope as follows,

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