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

Probability, Mike sells on the average 15 newspapers per week (Monday – Fri...

Mike sells on the average 15 newspapers per week (Monday – Friday). Find the probability that 2.1 In a given week he will sell all the newspapers [7] 2.2 In a given day he will sel

Discrete uniform distribution, Discrete Uniform Distribution Acme Limit...

Discrete Uniform Distribution Acme Limited is a car manufacturer. The company can paint the car in 3 possible colors: White, Black and Blue. Until the population is sampled, th

Evaluate the area of the shaded region, Evaluate the area of the shaded reg...

Evaluate the area of the shaded region in terms of π. a. 8 - 4π b. 16 - 4π c. 16 - 2π d. 2π- 16 b. The area of the shaded region is same to the area of the squa

Quantitative Techniques, You are given that the total frequency is 900 and ...

You are given that the total frequency is 900 and the median 100.48. From the following frequency distribution, find the class frequencies that are missing. Intelligence No. of Int

Trivial solution of equation, Specified a system of equations, (1), we will...

Specified a system of equations, (1), we will have one of the three probabilities for the number of solutions. 1.   No solution. 2.   Accurately one solution. 3.   Infinit

Intrgers, how to evaluate the sums

how to evaluate the sums

Vertical tangent for parametric equations, Vertical Tangent for Parametric ...

Vertical Tangent for Parametric Equations Vertical tangents will take place where the derivative is not defined and thus we'll get vertical tangents at values of t for that we

Engg maths, How to get assignment to solve and earn money

How to get assignment to solve and earn money

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