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

Discrete mathematics for computing, Everything stored on a computer can be ...

Everything stored on a computer can be represented as a string of bits. However, different types of data (for example, characters and numbers) may be represented by the same strin

Standardizing normal variables, Standardizing Normal Variables Suppose ...

Standardizing Normal Variables Suppose we have a normal population. We can represent it by a normal variable X. Further, we can convert any value of X into a corresponding valu

Intergration, Functional and variations.Block III, Consider the functiona...

Functional and variations.Block III, Consider the functional S[y]=?_1^2 v(x^2+y'')dx , y(1)=0,y(2)=B Show that if ?=S[y+eg]-S[y], then to second order in e, ?=1/2 e?_1^2¦?g^'

Functions , For the layman, a "function" indicates a relationsh...

For the layman, a "function" indicates a relationship among objects. A function provides a model to describe a system. Economists refer to deman

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