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

Types of infinity, TYPES OF INFINITY : Mostly the students have run across...

TYPES OF INFINITY : Mostly the students have run across infinity at several points in previous time to a calculus class. Though, when they have dealt along with this, this was jus

Decision-making under conditions of certainty, Decision-Making Under Condit...

Decision-Making Under Conditions of Certainty Conditions of certainty tend to be rare, especially when significant decisions are involved. Under conditions of certainty, decis

Two circles touching internally prove that ox:oy=oa:ob, Two circles touchin...

Two circles touching internally at O. OXY, OAB straight lines, the latter passing through the centres. Prove that OX : OY = OA : OB. Given : Two circles touching internally a

Triangles, ABCD is a parallelogram which AB and CD are divides by P and Q. ...

ABCD is a parallelogram which AB and CD are divides by P and Q. Such that AP:PB=3:2 and CQ:QD=4:1. If PQ and AC are meet at R, show that AR=3/7AC.

Trigonometry, trigonometric ratios of sum and difference of two angles

trigonometric ratios of sum and difference of two angles

Finding absolute extrema, Finding Absolute Extrema : Now it's time to see ...

Finding Absolute Extrema : Now it's time to see our first major application of derivatives.  Specified a continuous function, f(x), on an interval [a,b] we desire to find out the

Constantinople byzance adrienople nicosia, What was the name of Istanbul be...

What was the name of Istanbul before its capture by the Turks? Constantinople Byzance Adrienople Nicosia

Find where the breakdown occurred and his original speed, A cyclist, after ...

A cyclist, after riding a certain distance, stopped for half an hour to repair his bicycle, after which he completes the whole journey of 30km at half speed in 5 hours.  If the bre

Estimation of population proportions, Estimation of population proportions ...

Estimation of population proportions This form of estimation applies at the times while information cannot be described as a mean or as a measure but only as a percentage or fr

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