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

Sequence and series, how can we prove that an absolute convergent series is...

how can we prove that an absolute convergent series is convergent but the converse is not true.

Solve the fractional equation, Solve the fractional equation: Example...

Solve the fractional equation: Example: Solve the fractional equation 1/(x-2) +1/(x+3) =0 Solution: The LCD is (x - 2)(x + 3); therefore, multiply both sides of t

Sales Tax and Value added Tax, Dinesh bought an article for Rs. 374, which ...

Dinesh bought an article for Rs. 374, which included a discount of 15% on the marked price and a sales tax of 10% on the reduced price. Find the marked price of the article.

How many feet huge is her dining room, Audrey measured the width of her din...

Audrey measured the width of her dining room in inches. It is 150 inches. How many feet huge is her dining room? There are 12 inches in a foot. Divide 150 by 12 to find out the

Vectors, If r,R denote position vectors of points on the straight lines in ...

If r,R denote position vectors of points on the straight lines in the direction of a and b respectively, and if n is a unit vector perpendicular to both these directions, show that

Continuity, give me some examples on continuity

give me some examples on continuity

Example of convergent or divergent - comparison test, Determine if the subs...

Determine if the subsequent series is convergent or divergent. Solution As the cosine term in the denominator doesn't get too large we can suppose that the series term

Squeeze theorem (sandwich theorem and the pinching theorem), Squeeze Theore...

Squeeze Theorem (Sandwich Theorem and the Pinching Theorem) Assume that for all x on [a, b] (except possibly at x = c ) we have,                                 f ( x )≤ h (

.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

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