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

PDE, Consider the wave equation utt - uxx = 0 with u(x, 0) = f(x) = 1 if-1 ...

Consider the wave equation utt - uxx = 0 with u(x, 0) = f(x) = 1 if-1 ut(x, 0) = ?(x) =1 if-1 Sketch snapshots of the solution u(x, t) at t = 0, 1, 2 with justification (Hint: Sket

Help, Two sessions of swimming lessons were held at a pool. In the first se...

Two sessions of swimming lessons were held at a pool. In the first session 40 students attended. Of these 40 students 60% were girls. How many girls attended the first session of s

Example of differential equations, y(x) = x -3/2 is a solution to 4x 2 y′...

y(x) = x -3/2 is a solution to 4x 2 y′′ + 12xy′ + 3y = 0 , y (4) = 1/8 , and y'(4) = -3/64 Solution :  As we noticed in previous illustration the function is a solution an

Sequence and series, Find the sum og series 1+(1+3)+(1+3+5)+.......+(1+3+.....

Find the sum og series 1+(1+3)+(1+3+5)+.......+(1+3+...+15+17)=

Construction, draw a equilateral triangle with length of side 6.5 cm. and l...

draw a equilateral triangle with length of side 6.5 cm. and let us draw a parallelogram equal in area to that triangle and having an angle 45 degree

NOWA method, solve the equation 540+115 using the NOWA method

solve the equation 540+115 using the NOWA method

Square of a number added to 25 equals 10 times the number, The square of a ...

The square of a number added to 25 equals 10 times the number. What is the number? Let x = the number.  The statement, "The square of a number added to 25 equals 10 times the n

Equation: 4x^4+9x^4=64 , If 4x^4+9x^4=64 then the maximum value of x^2+y^2 ...

If 4x^4+9x^4=64 then the maximum value of x^2+y^2 is solution) From the eq. finding the value of x^2 and putting it in x^2 + y^2.we get 2nd eq. differentiating that and putting

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