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

Scatter graphs, Scatter Graphs - A scatter graph is a graph that compr...

Scatter Graphs - A scatter graph is a graph that comprises of points which have been plotted but are not joined through line segments - The pattern of the points will defin

PROBABILITY, Find the probability of drawing a diamond card in each of the ...

Find the probability of drawing a diamond card in each of the consecutive draws from a well shuffled pack of cards,if the card drawn is not replaced after the first draw.

Divides a given line-segment externally in the ratio of 1:2, Divides a give...

Divides a given line-segment externally in the ratio of 1:2 Construction: i )Draw BX making an actueangle at B. ii) Starting from B, mark 2 equal points on BX as shown in the f

Derive a linear system - gauss jordan elimination, Suppose that, on a certa...

Suppose that, on a certain day, 495 passengers want to fly from Honolulu (HNL) to New York (JFK); 605 passengers want to fly from HNL to Los Angeles (LAX); and 1100 passengers want

Gravity, There is a list of the forces which will act on the object. Gr...

There is a list of the forces which will act on the object. Gravity, F g The force because of gravity will always act on the object of course. Such force is F g   = mg

Describe the system with 3 variables, Describe the System with 3 Variables ...

Describe the System with 3 Variables ? This is an example of solving a system of equations using the substitution method. Warning: You will not understand this example if you

One-to-one function, One-to-one function: A function is called one-to-one ...

One-to-one function: A function is called one-to-one if not any two values of x produce the same y.  Mathematically specking, this is the same as saying,  f ( x 1 ) ≠ f ( x 2

Numerical.analysis. , Please, I want to know and study "stability 0n predic...

Please, I want to know and study "stability 0n predictor -corrector method .My gmail is [email protected] heap and kind to me .Thanks for this.

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