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

What is fibonacci sequence, what is Fibonacci Sequence? The most famous...

what is Fibonacci Sequence? The most famous sequence in mathematical history is called the Fibonacci sequence, discovered by the 12th-century mathematician Leonardo Fibonacci o

????? ???????, ???? ????? ??????? ?? ????? ??? ?? ????? ??????? ??????

???? ????? ??????? ?? ????? ??? ?? ????? ??????? ??????

Statistic, The mean height of eight children is 136cm. if the height of sev...

The mean height of eight children is 136cm. if the height of seven children are 143,125,133,140,120,135 and 152,find the height of eighth student.

Math, 1+3+5+7+9+11+13+15+17+19

1+3+5+7+9+11+13+15+17+19

Trigonmetry, How do I find a bearring using trig?

How do I find a bearring using trig?

Find the cost price of the toy, A dealer sells a toy for Rs.24 and gains as...

A dealer sells a toy for Rs.24 and gains as much percent as the cost price of the toy. Find the cost price of the toy. Ans:    Let the C.P be x ∴Gain = x % ⇒ Gain = x

Find relative extrema f ( x ) = x2 on [-2, Recognizes the absolute extrema...

Recognizes the absolute extrema & relative extrema for the given function.  f ( x ) = x 2        on                  [-2, 2] Solution Following is the graph for this fun

Solving decimal equations, The distance around a square photograph is 12.8 ...

The distance around a square photograph is 12.8 centimeters. What is the langth of each side of the fotograph?

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