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

Duality., advanteges of duality

advanteges of duality

What is box-and-whisker plot, Q. What is Box-and-Whisker Plot? Ans. ...

Q. What is Box-and-Whisker Plot? Ans. Line graphs or stem-and-leaf plots become difficult to manage when there is a large amount of data. Box-and-whisker plots help summa

Vectors and sclara, find the angel between the vectors 4i-2j+k and 2i-4j on...

find the angel between the vectors 4i-2j+k and 2i-4j online answer

Dilemmas of america''s minority groups, Explain this statement " As we begi...

Explain this statement " As we begin the 21st century, the dilemmas of America's minority groups remain perhaps the primary unresolved domestic issue facing the nation." How might

Fractions, what is equizilent to 2/5

what is equizilent to 2/5

How many days are there in a year, There are m months in a year, w weeks wi...

There are m months in a year, w weeks within a month and d days in a week. How many days are there in a year? In this problem, multiply d and w to obtain the total days in one

Number and operations, 1a.if the williams spend $385 a month on food what i...

1a.if the williams spend $385 a month on food what is their monthly income

Decimals, which one of the following examples represents a repeating decima...

which one of the following examples represents a repeating decimal? 0.123123,1.111114,0.777777,4.252525?

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