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

Linear approximation method for interpolation, Linear Approxi...

Linear Approximation Method This is a rough and ready method of interpolation and is best used when the series moves in predicted interval

Addition of like terms with same signs, Case 1: Suppose we are given...

Case 1: Suppose we are given expressions like 3abc and 7abc and asked to compute their sum. If this is the case we should not worry much. Because adding like exp

Solve 5x tan (8x ) =3x trig function, Solve 5x tan (8x ) =3x . Solution...

Solve 5x tan (8x ) =3x . Solution : Firstly, before we even begin solving we have to make one thing clear.  DO NOT CANCEL AN x FROM BOTH SIDES!!! Whereas this may appear like

Nonhomogeneous differential equations, Let's here start thinking regarding ...

Let's here start thinking regarding that how to solve nonhomogeneous differential equations.  A second order, linear non-homogeneous differential equation is as y′′ + p (t) y′ +

Who had the highest batting average, Mike, Dan, Ed, and Sy played together ...

Mike, Dan, Ed, and Sy played together on a baseball team. Mike's batting average was 0.349, Dan's was 0.2, Ed's was 0.35, and Sy's was 0.299. Who had the highest batting average?

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

Assumptions and application of t distribution, Assumptions and Application ...

Assumptions and Application of T Distribution Assumptions of t distribution 1. The sample observations are random 2. Samples are drawn from general distribution 3.

Adding equally sized groups-prerequisites for multiplication, Adding Equall...

Adding Equally Sized Groups:  Once children have had enough practice of making groups of equal size, you can ask them to add some of these equal groups. They can now begin to atte

Adding & subtracting i guess, Jack and his mother paid $11.50 for tickets t...

Jack and his mother paid $11.50 for tickets to the movies, and adults tickets cost $4.50 more than a child ticket what was the cost of each ticket?

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