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

How many people should she expect not to show, Laura is planning her weddin...

Laura is planning her wedding. She expects 230 people to attend the wedding, but she has been told that around 5% typically don't show. About how many people should she expect not

Permutation, A train goin from delhi to jaipur stops at 7 intermediate stat...

A train goin from delhi to jaipur stops at 7 intermediate stations. 5 persons enter the train during the journey with 5 difefrent tickets of same class . How mant different set of

State demorgans law and prove it using the truth table, State DeMorgan's la...

State DeMorgan's law. Prove it using the truth table.   Ans: DeMorgan's law defines that    (i)  (x ∨ y)' = x' ∧ y' (ii)  (x ∧ y)' = x' ∨ y'      Now let us dr

PR Plan for Bloomington Bombers softball team, I need to come up with a PR ...

I need to come up with a PR plan for a fictitious women''s softball team. How much would something like that cost?

Business math, David invests $17,000 into an account and at the end of 7 ye...

David invests $17,000 into an account and at the end of 7 years, his account has a balance of $ 26,417.77. What is the interest rate (assuming annual compounding)?

Math, i have problems with math and my teacher said that i am still progres...

i have problems with math and my teacher said that i am still progressing in math

Greatest common factor, x 4 - 25 There is no greatest common factor her...

x 4 - 25 There is no greatest common factor here.  Though, notice that it is the difference of two perfect squares. x 4 - 25 = ( x 2 ) 2   - (5) 2 Thus, we can employ

Toplogy, Let 0 ! V1 !    ! Vk ! 0 be a long exact sequence of vector spa...

Let 0 ! V1 !    ! Vk ! 0 be a long exact sequence of vector spaces with linear maps. Show that P (??1)i dim Vi = 0.

Average, A boy covered half of distance at 20km/hr and rest at 40kmlhr. cal...

A boy covered half of distance at 20km/hr and rest at 40kmlhr. calculate his average speed.

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