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

External division of section formula, give me the derivation of external di...

give me the derivation of external division of sectional formula using vectors

Complex number, a ,b,c are complex numbers such that a/1-b=b/1-c=c-1-a=k.fi...

a ,b,c are complex numbers such that a/1-b=b/1-c=c-1-a=k.find the value of k

Find the area of section a, The picture frame given below has outer dimensi...

The picture frame given below has outer dimensions of 8 in by 10 in and inner dimensions of 6 in by 8 in. Find the area of section A of the frame. a. 18 in 2 b. 14 in 2

Explain similar figures in similarity, Explain Similar Figures in similarit...

Explain Similar Figures in similarity ? Similar figures are figures that have the same shape but not necessarily the same size, so the image of a figure is similar to the orig

Factoring polynomials, Factoring polynomials is probably the most important...

Factoring polynomials is probably the most important topic. We already learn factor of polynomial .If you can't factor the polynomial then you won't be able to even start the probl

What is the formula to calculate area of rectangle, Charlie needs to know t...

Charlie needs to know the area of his property, that measures 120 ft through 150 ft. Which formula will he use? The area of a rectangle is length × width.

Rejection and acceptance regions, Rejection and Acceptance regions All ...

Rejection and Acceptance regions All possible values which a test statistic may either suppose consistency along with the null hypothesis as acceptance region or lead to the re

Geometry, write a proof on proving triangles are congruent.

write a proof on proving triangles are congruent.

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