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

Regression coefficient, 4x+3y+7=0 and 3x+4y+8=0 find the regression coeffic...

4x+3y+7=0 and 3x+4y+8=0 find the regression coefficient between bxy and byx.

Find integer if sum of two consecutive odd integers is -112, The sum of two...

The sum of two consecutive odd integers is -112. What is the larger integer? Two consecutive odd integers are numbers in order such as 3 and 5 or -31 and -29, that are each 2 n

Determine principal strains and direction , A 100 by 150 mm rectangular pla...

A 100 by 150 mm rectangular plate is deformed as shown in the following figure. All dimensions shown in the figure are in millimeters.  Determine at point Q: (a) the strain compone

Find the maximum and minimum brightness values, Variable stars are ones who...

Variable stars are ones whose brightness varies periodically. One of the most visible is R Leonis; its brightness is modelled by the function where t is measured in days.

Calculate probability, The following table contains some information about...

The following table contains some information about the model used. Assume the probabilities given by the model are those of being a good writer. Variable

Help, how do I round a # and decimal

how do I round a # and decimal

Determine the matrix that performs a horizontal compression, (a) Determine ...

(a) Determine the matrix that first rotates a two-dimensional vector 180° anticlockwise, and then per- forms a horizontal compression of the resulting vector by a factor 1/2 (leavi

find out the dimensions which will minimize, We desire to construct a box ...

We desire to construct a box whose base length is three times the base width. The material utilized to build the top & bottom cost $10/ft 2 and the material utilized to build the

Radicals, We'll include this section with the definition of the radical.  I...

We'll include this section with the definition of the radical.  If n is a +ve integer that is greater than one and a is a real number then, Where n is termed as the index,

Rectilinear figure, what is a redtilinear figure? like what are for the req...

what is a redtilinear figure? like what are for the requirments for a shape to be called that? example a regular polygon has all sides and angles equal. i cant find that kind of dr

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