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

Venn diagram - set theory and calculus, Venn Diagram - Set theory and calcu...

Venn Diagram - Set theory and calculus A easy way of representing sets and relations among sets is by means of the Venn diagram. Venn diagram includes of a rectangle that pres

Algebra, 25 algebraic equations that equal 36

25 algebraic equations that equal 36

Pythagorean theorem, How do you find the perimeter of an irregular shape us...

How do you find the perimeter of an irregular shape using Pythagorean theorem?

Harmonic progression (h.p.), Three quantities a, b and c are said to ...

Three quantities a, b and c are said to be in harmonic progression if, In this case we observe that we have to consider three terms in o

Graphing , what effect is the constant in an equation have on an graph

what effect is the constant in an equation have on an graph

Circumference of a circle, How far will a bowling ball goes in one rotation...

How far will a bowling ball goes in one rotation if the ball has a diameter of 10 inches? (π = 3.14) 1. 78.5 in 2. 31.4 in 3. 62.8 in 4. 15.7 in 2. The circumfere

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