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

Loan amortisation problem, On 30 June 2012 Bill purchase a home by taking o...

On 30 June 2012 Bill purchase a home by taking out a 30 year mortgage of $600,000 at 6% interest per annum, compounded months. Repayments are made at the end of each month. (a) Cal

Times fractons, In a garden, 1/8 of the flowers are tulips. 1/4 of the tuli...

In a garden, 1/8 of the flowers are tulips. 1/4 of the tulips are red. What fraction of the flowers in the garden are red tulips?

The expected monetary value method, The expected monetary value method ...

The expected monetary value method The expected pay off as profit associated with a described combination of act and event is acquired by multiplying the pay off for that act a

Domain and range of a relation, Consider R be a relation from A to B, that ...

Consider R be a relation from A to B, that is, take R A Χ B. Then Domain R = {a: a € A, (a, b) € R for any b € B} i.e. domain of R is the set of all the first components of

Decimals, how will the decimal point move when 245.398 is multiplied by 10

how will the decimal point move when 245.398 is multiplied by 10

Probability, A man enter a lucky draw that requires him to pick five differ...

A man enter a lucky draw that requires him to pick five different integers from 1 through 30 inclusive .he chooses his five number in such a way that the sum of their log base 10 i

How far up the building will the ladder reach?, A rescue and ?re squad plac...

A rescue and ?re squad places a 15 ft ladder against a burning building. If the ladder is 9 ft from the base of the building, how far up the building will the ladder reach? a. 8

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