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

Laplace transform, what is the Laplace transform of e^9(-t)^a)

what is the Laplace transform of e^9(-t)^a)

Geometry, what is sin, cos, and tan?

what is sin, cos, and tan?

Fundamental theorem of calculus, Fundamental Theorem of Calculus, Part II ...

Fundamental Theorem of Calculus, Part II Assume f ( x ) is a continuous function on [a,b] and also assume that F ( x ) is any anti- derivative for f ( x ) . Then,

Abstract algebra, How many homomorphism are there from z2 to z3. Zn is grou...

How many homomorphism are there from z2 to z3. Zn is group modulo n

Calculus, the limit of f(x) as x approaches 5 is equal to 7. write the defi...

the limit of f(x) as x approaches 5 is equal to 7. write the definition of limit as it applies to f at this point

Related rates of differentiation., Related Rates : In this section we wil...

Related Rates : In this section we will discussed for application of implicit differentiation.  For these related rates problems usually it's best to just see some problems an

Numbers, use the distributive law to write each multiplication in a differe...

use the distributive law to write each multiplication in a different way. then find the answer. 12x14 16x13 14x18 9x108 12x136 20x147

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

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

Perimeter and Area, A farmer has a rectangular field of length 100m and bre...

A farmer has a rectangular field of length 100m and breadth 70m. He leaves a path of 1m all along the boundary inside it. He decides to apply a manure to the remaining part of the

Explain the dependent events, Explain the Dependent Events? Events are ...

Explain the Dependent Events? Events are called dependent events when the outcome of one event influences the outcome of the second event. P(A and B) = P(A) P(B following A

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