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

Logarithmic functions- general properties, Logarithmic functi...

Logarithmic functions have the following general properties If y = log a x, a > 0 and a ≠1, then The domain of the function

Whole numbers, Observe that natural numbers do not have a zero....

Observe that natural numbers do not have a zero. This shortcoming is made good when we consider the set of whole numbers. The set of whole numbe

Characteristics of exponential smoothing, Characteristics of Exponential Sm...

Characteristics of Exponential Smoothing 1. More weight is described to the most recent data. 2. All past data are incorporated not like in moving averages. 3. Les

Vector function - three dimensional spaces, Vector Function The good wa...

Vector Function The good way to get an idea of what a vector function is and what its graph act like is to look at an instance.  Thus, consider the following vector function.

Linear code with generator matrix , 1. Consider the code of size 4 (4 codew...

1. Consider the code of size 4 (4 codewords) and of length 10 with codewords listed below. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1

Extreme value theorem, Extreme Value Theorem : Assume that f ( x ) is cont...

Extreme Value Theorem : Assume that f ( x ) is continuous on the interval [a,b] then there are two numbers a ≤ c, d ≤ b so that f (c ) is an absolute maximum for the function and

Triangles, ABCD is a parallelogram which AB and CD are divides by P and Q. ...

ABCD is a parallelogram which AB and CD are divides by P and Q. Such that AP:PB=3:2 and CQ:QD=4:1. If PQ and AC are meet at R, show that AR=3/7AC.

RATIO, 3 years to 104 weeks,express answer in ratio

3 years to 104 weeks,express answer in ratio

Trig, without using a calculator how would you know is cos theta(20) is gre...

without using a calculator how would you know is cos theta(20) is greater than cos theta (35)

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