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

If oa = ob = 14cm, If OA = OB = 14cm, ∠AOB=90 o , find the area of shaded r...

If OA = OB = 14cm, ∠AOB=90 o , find the area of shaded region.  (Ans:21cm 2 ) Ans:    Area of the shaded region = Area of ? AOB - Area of Semi Circle = 1/2  x 14 x

Circles, If the distances from origin of the centres of 3 circles x 2 +y 2 ...

If the distances from origin of the centres of 3 circles x 2 +y 2 +2alphaix= a 2 (i=1,2,3) are in G.P. , then length of the tangents drawn to them frm any point on the circles x2+

Multiplication rule: dependent events, Multiplication Rule: Dependent Event...

Multiplication Rule: Dependent Events The joint probability of two events A and B which are dependent is equal to the probability of A multiplied by the probability of B given

Integers, i do not understand the rules for adding and subtracting integers...

i do not understand the rules for adding and subtracting integers, nor do i understand how to multiply and divide

Implicit differentiation, Implicit Differentiation : To this instance w...

Implicit Differentiation : To this instance we've done quite a few derivatives, however they have all been derivatives of function of the form y = f ( x ) .  Unluckily not all

Computation of covariance - grouped data, Grouped Data          ...

Grouped Data          For grouped data of a paired population            where,                      f is the

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