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

Triangles, if triangle abc is similar to def and ab/de=3/4 find the ratio a...

if triangle abc is similar to def and ab/de=3/4 find the ratio af their perimeter and area

Emi, calculation of emi %

calculation of emi %

Fractions, how do you multiply fractions

how do you multiply fractions

Describe about absolute values, Describe about Absolute Values ? When a...

Describe about Absolute Values ? When an integer is written with a vertical line on each side of the integer, it is called the absolute value of that integer. For example,

Gaussian elimination, Example1 :  Solve the subsequent system of equations....

Example1 :  Solve the subsequent system of equations. -2x 1 + x 2 - x 3 = 4 x 1 + 2x 2 + 3x 3   = 13 3x 1 + x 3 = -1 Solution The initial step is to write d

Geometry, Awhat is polygonesk question #Minimum 100 words accepted#

Awhat is polygonesk question #Minimum 100 words accepted#

Volume., what is the volume of new ipad pro box

what is the volume of new ipad pro box

Give the introduction to ratios and proportions, Give the introduction to R...

Give the introduction to Ratios and Proportions? A ratio represents a comparison between two values. A ratio of two numbers can be expressed in three ways: A ratio of "one t

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