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

Calculate the average return, A department store faces a decision for a sea...

A department store faces a decision for a seasonal product for which demand can be high, medium or low. The purchaser can order 1, 2 or 3 lots of this product before the season beg

Work in volume problems, Work : It is the last application of integr...

Work : It is the last application of integral which we'll be looking at under this course. In this section we'll be looking at the amount of work which is done through a forc

Complex numbers, find the modulus Z=(2-i)(5+i12)/(1+i2)^3

find the modulus Z=(2-i)(5+i12)/(1+i2)^3

Probability that a leap year will have 53 sunday?explain, A leap year has 3...

A leap year has 366 days, therefore 52 weeks i.e. 52 Sunday and 2 days. The remaining 2 days may be any of the following : (i) Sunday and Monday (ii) Monday and Tuesday (iii)

Communicating the meaning of addition, COMMUNICATING THE MEANING OF ADDITIO...

COMMUNICATING THE MEANING OF ADDITION :  One of the characters in a novel written by the Malayalam writer Vaikom Muhammed Basheer was asked by his teacher, "How much is one and on

What is the maximum amount of hours cindy worked together, Carl worked thre...

Carl worked three more than twice as many hours as Cindy did. What is the maximum amount of hours Cindy worked if together they worked 48 hours at most? Let x = the amount of h

Find out the slope of equations, Example:  find out the slope of equations ...

Example:  find out the slope of equations and sketch the graph of the line.                         2 y - 6x = -2 Solution To get the slope we'll first put this in slope

Express the statement as a disjunction in dnf, State the following statemen...

State the following statement as a disjunction (in DNF) as well using quantifiers:      There does not exit a woman who has taken a flight on each airline in the world.

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