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

Dividing, I don''t know how to do the next step like if I had 73 divided by...

I don''t know how to do the next step like if I had 73 divided by 9 wouldn''t 7 go into nine 1 time then you have to do something else but that is the part I don''t understand

Find the length of the second diagonal, Find the length of the second diago...

Find the length of the second diagonal of a rhombus, whose side is 5cm and one of the diagonals is 6cm.

What is perfect squares, What is Perfect Squares ? Any number that can ...

What is Perfect Squares ? Any number that can be written as an integer to the power of two is called a perfect square. For example, 4 can be written as 2 2 4 is a "perfect sq

Linear equations, Linear Equations - Resolving and identifying linear fir...

Linear Equations - Resolving and identifying linear first order differential equations. Separable Equations - Resolving and identifying separable first order differential

Math, to which subset of the real number does the number 22 belong?

to which subset of the real number does the number 22 belong?

Compute the probability of weather, Analysis of questionnaire completed by ...

Analysis of questionnaire completed by holiday makers showed that 0.75 classified their holiday as excellent at Malindi. The probability of hot weather in the resort is 0.6.  If th

Properties of cross product - vector, Properties of Cross product If u,...

Properties of Cross product If u, v and w are vectors and c is a number then u → * v → = -v → * w →                                                       (cu → ) * v → =

Algebra, prove That J[i] is an euclidean ring

prove That J[i] is an euclidean ring

Chain rule, Chain Rule :   If f(x) and g(x) are both differentiable func...

Chain Rule :   If f(x) and g(x) are both differentiable functions and we describe F(x) = (f. g)(x) so the derivative of F(x) is F′(x) = f ′(g(x)) g′(x).  Proof We will s

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