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

Math, there is 22 owls . my mom gave me 6 more . how many owls do they have...

there is 22 owls . my mom gave me 6 more . how many owls do they have

Math, i really ned help wiv quartiles plz help

i really ned help wiv quartiles plz help

Math World Problem, The ratio of gasoline to oil needed to run a chain-saw ...

The ratio of gasoline to oil needed to run a chain-saw is 16:1. If you have 3.5 mL of oil, how many millilitres of gasoline must you add to get the proper mixture?

Determine the line parallel or perpendicular, Determine if the line that pa...

Determine if the line that passes through the points ( -2, -10) and (6, -1) is parallel, perpendicular or neither to the line specified  by 7 y - 9 x = 15 . Solution Togive

Theorem, Theorem, from Definition of Derivative  If f(x) is differenti...

Theorem, from Definition of Derivative  If f(x) is differentiable at x = a then f(x) is continuous at x =a. Proof : Since f(x) is differentiable at x = a we know, f'(a

Fermats theorem, Fermat's Theorem  If f(x) has a relative extrema at x...

Fermat's Theorem  If f(x) has a relative extrema at x = c and f′(c) exists then x = c is a critical point of f(x). Actually, this will be a critical point that f′(c) =0.

SAT question, In a certain class, one half of the male students and two thi...

In a certain class, one half of the male students and two thirds of the female students speak French. If there are three fourths as many girls as boys in the class. What fraction o

Linear function, find the temperature at which the celsius and farhenheit t...

find the temperature at which the celsius and farhenheit temperatures are numerically equl

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