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

Proportions, How would you solve this question? 4/5 = 8/x+2

How would you solve this question? 4/5 = 8/x+2

Find out indegree, Question: Consider a digraph D on 5 nodes, named x0...

Question: Consider a digraph D on 5 nodes, named x0, x1,.., x4, such that its adjacency matrix contains 1's in all the elements above the diagonal A[0,0], A[1,1], A[2,2],.., e

Differential Equations, Find the normalized differential equation which has...

Find the normalized differential equation which has { x, xe^x } as its fundamental set

Can tan theeta be integrated?, Normal 0 false false false ...

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

Shiites muhammad''s flight from mecca to medina, The first year of the Isla...

The first year of the Islamic calendar marks the following event: The birth of Muhammad The Qu'ran is assembled into a single sacred text The division of the Sunnis and the Shiites

Taylor series - sequences and series, Taylor Series - Sequences and Series ...

Taylor Series - Sequences and Series In the preceding section we started looking at writing down a power series presentation of a function.  The difficulty with the approach

What is the average of his four quiz grades, Andy earned the subsequent gra...

Andy earned the subsequent grades on his four math quizzes: 97, 78, 84, and 86. What is the average of his four quiz grades? To ?nd out the average, you must add the items (97

How to converting scientific notation to standard notation , How to Convert...

How to Converting Scientific Notation to Standard Notation ? To change a number in scientific notation to standard notation, move the decimal point the same number of places as

Geometry problems, if a circles diameter is 42 mm its radius is ___________...

if a circles diameter is 42 mm its radius is _________________ because ________________________.

Function, f(x)=x^2-5x+6, determine inverse of f(x)!

f(x)=x^2-5x+6, determine inverse of f(x)!

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