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 programming , use the simplex method to solve the following lp probl...

use the simplex method to solve the following lp problem. max z = 107x1 + x2 + 2x3 subject to 14x1 + x2 - 6x3 + 3x4 = 7 16x1 + x2 - 6x3 3x1 - x2 - x3 x1,x2,x3,x4 > = 0

Probability, Probability -Probability is an extremely popular concept ...

Probability -Probability is an extremely popular concept in business management. Since it covers the risks such may be included in certain business situations. This is a fact

Consecutive positive odd integers 74 what is integer value, The sum of the ...

The sum of the squares of two consecutive positive odd integers is 74. What is the value of the smaller integer? Let x = the lesser odd integer and let x + 2 = the greater odd

Generic rectangles and greatest common factors, miaty and yesenia have a gr...

miaty and yesenia have a group of base ten blocks.Misty has six more than yesnia. Yesenia''s blocks repersent 17 together they have 22 blocks,and the total of blocks repersent 85.

Independent & Dependent functions, I am learning this at school today and I...

I am learning this at school today and I started getting confused which one is which, can you help me?

Pair of linear equations in two variables, PAIR OF LINEAR EQUATIONS IN TWO ...

PAIR OF LINEAR EQUATIONS IN TWO VARIABLES: Like  the  crest  of a  peacock so  is  mathematics  at the  head of all knowledge. Example At a certain time in a deer park, t

All subjects, I need help. Is there anyone there to help me?

I need help. Is there anyone there to help me?

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