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

Partial differential equations, I need expert who can solve 10 set of PDE w...

I need expert who can solve 10 set of PDE with constant of integration.

Derivatives of inverse trig function, Derivatives of Inverse Trig Functions...

Derivatives of Inverse Trig Functions : Now, we will look at the derivatives of the inverse trig functions. To derive the derivatives of inverse trig functions we'll required t

Hydrostatic pressure and force - applications of integrals, Hydrostatic Pre...

Hydrostatic Pressure and Force - Applications of integrals In this part we are going to submerge a vertical plate in water and we wish to know the force that is exerted on t

Pendulum, how many pendulum swings will it take to walk across the classroo...

how many pendulum swings will it take to walk across the classroom

Statistics, explain the characteristics of statistics

explain the characteristics of statistics

What is the widest piece of sheetrock, A door height is 6 feet and 6 inches...

A door height is 6 feet and 6 inches and 36 inches wide. What is the widest piece of sheetrock that will ?t through the door? Round to the nearest inch. a. 114 in b. 86 in

Measures of dispersion- measures of central tendency, Measures of Dispersio...

Measures of Dispersion - The measures of dispersion are extremely useful in statistical work since they indicate whether the rest of the data are scattered away from the mean

Greens function, construct the green''s function that satisfies dG''''-(2x+...

construct the green''s function that satisfies dG''''-(2x+1)G''+(x+1)G=delta(x-s), G(0,s)=G(1,s)=0

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