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, Chelsea has been facing some financial problems which e...

Chelsea has been facing some financial problems which even caused her daily expenses for food, at the same time, she hasn''t receive the money from the bank loan yet. Therefore, sh

Simultaneous equations by substitution, Simultaneous equations by substitut...

Simultaneous equations by substitution: Solve the subsequent simultaneous equations by substitution. 3x + 4y = 6      5x + 3y = -1 Solution: Solve for x: 3x = 6

Data editing, how to remove wild points in a data set...

how to remove wild points in a data set...

Can religious wars be avoided in the future, To what extent do you think re...

To what extent do you think religious beliefs should justify war? How is this shown in "The Song of Roland"? Cite examples of how religious beliefs have led to war in the last two

The shape of a graph, The Shape of a Graph, Part II : In previous we saw h...

The Shape of a Graph, Part II : In previous we saw how we could use the first derivative of a function to obtain some information regarding the graph of a function.  In this secti

Statistics, How do I choose a distribution test for a sample size of 60? Pr...

How do I choose a distribution test for a sample size of 60? Probability of rolling a 4 on a six sided die.

#title., Julia must do a 70:30 split of all of her profits with the Departm...

Julia must do a 70:30 split of all of her profits with the Department of Athletics. Julia also has the ability to sell soft drinks. If she decide to sell soft drinks, she must agre

Simplex method, max z=3x1+2x2 s.t x1+2x2 3x1+2x2>=6 x1+4x2 ...

max z=3x1+2x2 s.t x1+2x2 3x1+2x2>=6 x1+4x2 x1,x2,x3>=0

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