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

The sum of two integers is 36 what is the smaller number, The sum of two in...

The sum of two integers is 36, and the difference is 6. What is the smaller of the two numbers? Let x = the ?rst integer and let y = the second integer. The equation for the su

C programming, Write a program to find the area under the curve y = f(x) be...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Determine the marginal probability distributions, (1)   The following table...

(1)   The following table gives the joint probability distribution p (X, Y) of random variables X and Y. Determine the following: (a) Do the entries of the table satisfy

Calculus, Calculus Calculus is a branch of mathematics which describes...

Calculus Calculus is a branch of mathematics which describes how one variable changes in relationship to another variable. It enables us to determine the rate of change of one

Utilizes the infinite definition of the limit to prove limit, Utilizes the ...

Utilizes the definition of the limit to prove the given limit. Solution Let M > 0 be any number and we'll have to choose a δ > 0 so that, 1/ x 2   > M

Easy math margin percentage increase, If A = 100 and B = 44 then A1 =...

If A = 100 and B = 44 then A1 = 120 and B2 = 52.80 A is MAP and B is Tier 6. I need help to find a simple equation that I just cannot find. I just need the percentage

Geometyr, Lines EF and GH are graphed on this coordinate plane. Which point...

Lines EF and GH are graphed on this coordinate plane. Which point is the intersection of lines EF and GH?

Strategy for series - sequences and series, Strategy for Series Now t...

Strategy for Series Now that we have got all of our tests out of the way it's time to think regarding to the organizing all of them into a general set of strategy to help us

Math on a spot, compare: 643,251: 633,512: 633,893. The answer is 633,512.

compare: 643,251: 633,512: 633,893. The answer is 633,512.

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