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

Prove that the length of the altitude on the hypotenuse, If A be the area o...

If A be the area of a right triangle and b one of the sides containing the right angle, prove that the length of the altitude on the hypotenuse is 2  Ab /√ b 4 +4A 2 . An

Transpose of a matrix, I didn't understand the concept of Transpose of a Ma...

I didn't understand the concept of Transpose of a Matrix, need assistance.

What would this expression simplify to, If 3x2 is multiplied by the quantit...

If 3x2 is multiplied by the quantity 2x3y raised to the fourth power, what would this expression simplify to? The statement in the question would translate to 3x 2 (2x 3 y) 4 .

Calculate the profits per acre strategy, A farmer grows apples on her 600 a...

A farmer grows apples on her 600 acre farm and must cope with occasional infestations of worms. If she refrains from using pesticides, she can get a premium for "organically grown"

Linear programming, #question.As office manager of her firm, Marcellyne has...

#question.As office manager of her firm, Marcellyne has been directed to buy new filing cabinets. She knows that cabinet A costs $10, requires 6 square feet of floor space, and hol

Find probability simulation, A reliability system consists of 15 independen...

A reliability system consists of 15 independent components. The probability that a component works is 0.9 for each. The system works if at least 11 of the components work. Fi

Estimate what is the thickness of the paper, Kenny used a micrometer to mea...

Kenny used a micrometer to measure the thickness of a piece of construction paper. The paper measured halfway among 0.24 millimeters and 0.25 millimeters. What is the thickness of

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