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

Determine the mean of given question, Q . Mrs. Cooper asked her math class ...

Q . Mrs. Cooper asked her math class to keep track of their own grade. Michael, one of the students, lost his assignments, but he remembered the grades of 6 out of 8 assignments:

Geometry of arcs, how to divide an arc in three equal parts

how to divide an arc in three equal parts

Venn Diagram, In a group of 85 people, 33 own a microwave, 28 own a DVD pla...

In a group of 85 people, 33 own a microwave, 28 own a DVD player and 38 own a computer. In addition, 6 people own both a microwave and a DVD player, 9 own both a DVD player and a c

Mechanical vibrations, This time we are going to take a look at an applicat...

This time we are going to take a look at an application of second order differential equations. It's now time take a look at mechanical vibrations. In exactly we are going to look

Payoff Matrix, A farmer grows apples on her 400-acre farm and must cope wit...

A farmer grows apples on her 400-acre farm and must cope with occasional infestations of worms. If she refrains from using pesticides, she can get a premium for "organically grown"

Which of the subsequent decimals is the greatest number, Which of the subse...

Which of the subsequent decimals is the greatest number? If you add zeros to the end of every of the numbers so that each number has 5 places after the decimal point, it is sim

Power regression, how can i solve a multi variable power regression equatio...

how can i solve a multi variable power regression equation..? EX: y=a*(x1^b)*(x2^c).... i need to solve with 4 variable....

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