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 the surface area of a ball with a diameter of 6 inch, The formula f...

The formula for the surface area of a sphere is 4πr 2 . What is the surface area of a ball with a diameter of 6 inches? Round to the nearest inch. (π = 3.14) If the diameter  o

Estimate the value of x and y in liner equation, ( a+2b)x + (2a - b)y = 2...

( a+2b)x + (2a - b)y = 2, (a - 2b)x + (2a +b)y = 3 (Ans: 5b - 2a/10ab , a + 10b/10ab ) Ans: 2ax + 4ay = y , we get 4bx - 2by = -1 2ax+ 4ay = 5  4bx- 2by = - 1

Math, weather prediction on monsoon past data on project

weather prediction on monsoon past data on project

Find out function is increasing and decreasing, Find out where the followin...

Find out where the following function is increasing & decreasing. A (t ) = 27t 5 - 45t 4 -130t 3 + 150 Solution As with the first problem first we need to take the

Algebra, please tell me what is algebra and how i can understand it

please tell me what is algebra and how i can understand it

Absolute convergence - sequences and series, Absolute Convergence Whil...

Absolute Convergence While we first talked about series convergence we in brief mentioned a stronger type of convergence but did not do anything with it as we didn't have any

Boat Crossing, What is the slowest a boat can travel across a river if the ...

What is the slowest a boat can travel across a river if the river is flowing with a velocity field of X^2?

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