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

An aeroplane is flying , An aeroplane is flying at a specific height of 5 k...

An aeroplane is flying at a specific height of 5 km, and at a velocity of 450 km/hr. A camera on the ground is pointed towards the plane, at an angle θ from the horizontal. As the

Poisson mathematical properties, Poisson Mathematical Properties 1. Th...

Poisson Mathematical Properties 1. The expected or mean value = np = λ Whereas; n = Sample Size p = Probability of success 2. The variance = np = ? 3. Standard dev

Describe adding and subtracting square roots, Describe Adding and Subtracti...

Describe Adding and Subtracting Square Roots? To add or subtract square roots, the radicands must be the same. If the radicands are the same, add/subtract the coefficients (the

CIECLE, HOW TO DRAW A TANGENT SEGMENTS TO A CIRCLE WHEN CENTRE IS NOT KNOWN...

HOW TO DRAW A TANGENT SEGMENTS TO A CIRCLE WHEN CENTRE IS NOT KNOWN?

Application of linear function, four times an unknown number is equal to tw...

four times an unknown number is equal to twice the sum of five and that unknown number

Eigenvalues and eigenvectors, If you find nothing out of this rapid review ...

If you find nothing out of this rapid review of linear algebra you should get this section.  Without this section you will not be capable to do any of the differential equations wo

Which of the subsequent terms does not describe the number 9, Which of the ...

Which of the subsequent terms does NOT describe the number 9? Nine is NOT prime since it has 3 factors; 1, 3, and 9. Prime numbers have only 2 factors.

Find third order partial derivatives, Question: Find all third order pa...

Question: Find all third order partial derivatives for the function   F(x,y)= log xy+ e (x+y) -x/y.

#tnumarancyitle.., what is classification and how can you teach it?

what is classification and how can you teach it?

Factors, write down all the factors of 36

write down all the factors of 36

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