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

Julie had $500 how much money did julie spend, Julie had $500. She spent 20...

Julie had $500. She spent 20% of it on clothes and then 25% of the remaining money on CDs. How much money did Julie spend? Find out 20% of $500 by multiplying $500 by the decim

100 day countdown, subtract 20and 10,and then mutiply by 5

subtract 20and 10,and then mutiply by 5

In terms of x what is the area of her garden, Laura has a rectangular garde...

Laura has a rectangular garden whose width is x 3 and whose length is x4. In terms of x, what is the area of her garden? Since the area of a rectangle is A = length times widt

Sequence-or-series, in and ap 1,2,3,4,5,6,7,8,9 11,12,13,14,15,16,17,18,19...

in and ap 1,2,3,4,5,6,7,8,9 11,12,13,14,15,16,17,18,19 and like that nonzzero digit find tn Solution) First break the ''n'' number in terms of 10''s power. For e.g if n=3259 wri

Theorem, #question if two angles of a triangle are unequal in measure then ...

#question if two angles of a triangle are unequal in measure then the side opposite to greater angle is longer than the side opposite to the smaller angle

Explain different base numbers, Explain Different Base Numbers? In mult...

Explain Different Base Numbers? In multiplying or dividing two exponential expressions with different base numbers, write out the exponential expressions as products. Since

Continuous random variable, Continuous Random Variable In the probabili...

Continuous Random Variable In the probability distribution the sum of all the probabilities was 1. Consider the variable X denoting "Volume poured into a 100cc cup from coff

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