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

Example of complex roots, Solve the subsequent IVP. y'' - 4y' + 9y = 0, ...

Solve the subsequent IVP. y'' - 4y' + 9y = 0, y(0) = 0, y'(0) = -8 Solution The characteristic equation for such differential equation is. As:  r 2 - 4r + 9 = 0

Coefficient of correlation denoted, Coefficient of Correlation Denoted ...

Coefficient of Correlation Denoted There are two methods which measure the degree of correlation among two variables these are denoted by R and r. (a) Coefficient of correl

Fractions, what is 1/3 + 2/9 equal

what is 1/3 + 2/9 equal

Equilibrium solutions, In the earlier section we modeled a population depen...

In the earlier section we modeled a population depends on the assumption that the growth rate would be a constant. Though, in reality it doesn't make much sense. Obviously a popula

What is a system of equations?, What is a System of Equations? And its Solu...

What is a System of Equations? And its Solution? Here is an example of a system of equations (also called a simultaneous system of equations) x 2 + y = 3

Common graphs, Common Graphs : In this section we introduce common graph o...

Common Graphs : In this section we introduce common graph of many of the basic functions. They all are given below as a form of example Example   Graph y = - 2/5 x + 3 .

Percents, If 2/3 of a number is 24 then 1/4 of a number is...

If 2/3 of a number is 24 then 1/4 of a number is...

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