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

Doubles Plus 1 and Doubles Minus 1, Write the doubles fact you used to solv...

Write the doubles fact you used to solve the problem. 7 + 8 = 15

Sum, As1212uestion #Minimum 100 words accepted#

As1212uestion #Minimum 100 words accepted#

What is the probability shane rolls a 5, Shane rolls a die numbered 1 by 6....

Shane rolls a die numbered 1 by 6. What is the probability Shane rolls a 5? From 2:15 P.M. to 4:15 P.M. is 2 hours. After that, from 4:15 P.M. to 4:45 P.M. is another half hour

Factoring quadratic polynomials, Primary, note that quadratic is another te...

Primary, note that quadratic is another term for second degree polynomial. Thus we know that the largest exponent into a quadratic polynomial will be a2. In these problems we will

Statistics, How do I choose a distribution test for a sample size of 60? Pr...

How do I choose a distribution test for a sample size of 60? Probability of rolling a 4 on a six sided die.

How to divide two fractions, Q. How to divide two fractions?If you want to ...

Q. How to divide two fractions?If you want to divide two fractions, You invert the second fraction (that means, turn it upside-down) and multiply (change the division to a

Determine the head loss, A 3 km pipe starts from point A end at point B ...

A 3 km pipe starts from point A end at point B Population = 3000 people Q = 300 L/day/person Roughness = cast ion pipe Length of the pipe = 3km Case 1 From A to B

Dr.., I need some material on Bachet equation

I need some material on Bachet equation

Write algorithm for the multiplication of a 3-digit number, E1) Why do we s...

E1) Why do we shift the place by one, of the result in the second row of the calculation, when we multiply, say, 35 by 237 E2) Write down the algorithm for the multiplication 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