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

Use the power function to find derivative, Given, y = f(x) = 2 x 3 - 3x 2 ...

Given, y = f(x) = 2 x 3 - 3x 2 + 4x +5 a)  Use the Power function to find derivative of the function. b)  Find the value of the derivative at x = 4.

Circles, how to find equations of circles when given equations of centres o...

how to find equations of circles when given equations of centres on which it lies?

QUANITATIVE METHODS, COMMENT ON QUANTITATIVE TECHNIQUES IS A SCIENTIFIC AND...

COMMENT ON QUANTITATIVE TECHNIQUES IS A SCIENTIFIC AND FOR ENHANCING CREATIVE AND JUDICIOUS CAPABILITIES OF A DECISION MAKER

Solve the linear programming problem using simple method, Solve the followi...

Solve the following Linear Programming Problem using Simple method. Maximize Z= 3x 1 + 2X 2 Subject to the constraints:                  X 1 + X 2 ≤ 4

Probability, The probability that a leap year will have 53 sunday is ? and ...

The probability that a leap year will have 53 sunday is ? and how please explain it ? (a)1/7    (b) 2/7    (c) 5/7    (d)6/7 Sol) A leap year has 366 days, therefore 52 weeks i.e

Mean and standard deviation, Q. Mean and Standard Deviation? Ans. ...

Q. Mean and Standard Deviation? Ans. The normal distribution is totally described if we know the average and standard deviation. - the population mean of the distribu

Power rule, Power rule: d(x n )/dx = nx n-1 There are really three ...

Power rule: d(x n )/dx = nx n-1 There are really three proofs which we can provide here and we are going to suffer all three here therefore you can notice all of them. T

Marketing orientation, what marketing orientation is kelloggs influenced by...

what marketing orientation is kelloggs influenced by?why do you think kelloggs use this approach?

Find out the probability, a)  A husband and wife appear in an interview for...

a)  A husband and wife appear in an interview for two vacancies in the same post.  The probability of husband's selection is 1/7 and that of wife's selection is 1/5.  What is th

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