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

A single student is selected at random, The scores of students taking the A...

The scores of students taking the ACT college entrance examination are normally distributed with a mean µ = 20.1 and a standard deviation σ = 5.8. a)    A single student is sele

Proof of the properties of vector arithmetic, Proof of the Properties of ve...

Proof of the Properties of vector arithmetic Proof of a(v → + w → ) = av → + aw → We will begin with the two vectors, v → = (v 1 , v 2 ,..., v n )and w? = w

Callie grandmother pledged $0.50 for each mile callie walked, Callie's gran...

Callie's grandmother pledged $0.50 for each mile Callie walked in her walk-a-thon. Callie walked 9 miles. How much does her grandmother owe? Multiply the number of miles (9) th

Shares, a person having rs.10 shares of value rs.6000 in a company which pa...

a person having rs.10 shares of value rs.6000 in a company which pays a 7% dividend invested the money gained by selling those shares and bought rs.25 shares at rs.24 per share in

Fraction, sarah has 12 gel pen. she gave 3/4. how many she have

sarah has 12 gel pen. she gave 3/4. how many she have

Algebra 1, how do you write this polynomial in standerd form 5x3 + x5 - 8 +...

how do you write this polynomial in standerd form 5x3 + x5 - 8 + 4x ?

Mechanics, find the composition of the simple harmonic motion of the same p...

find the composition of the simple harmonic motion of the same period in the perpendicular directions

Answer, #questi0+50x1-60-60x0+10on..

#questi0+50x1-60-60x0+10on..

Statistics and probability, STATISTICS AND PROBABILITY : Statistics  ar...

STATISTICS AND PROBABILITY : Statistics  are the  only  tools  by  which  an  opening  can  be  cut  through  the formidable  thicket  of difficulties  that bars the  path  of

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