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

Compute the probability of event, 1) Let the Sample Space S = {1, 2, 3, 4, ...

1) Let the Sample Space S = {1, 2, 3, 4, 5, 6, 7, 8}. Suppose each outcome is equally likely. Compute the probability of event E = "an even number is selected". P(E) = 2) A s

Solid mensuration, Find the are of the rectilinear.if it is the difference ...

Find the are of the rectilinear.if it is the difference between to isosceles trapezoid whose corrsponding sides are parallel.

Advanced functions, writ the equation that describes the motion of a point ...

writ the equation that describes the motion of a point on the wheel that has a center of 4m off the ground, has radius of 15 cm, makes a full rotation every 10 seconds and starts a

Properties for exponents, The next thing that we must acknowledge is that a...

The next thing that we must acknowledge is that all of the properties for exponents . This includes the more general rational exponent that we haven't looked at yet. Now the pr

Damping force, The subsequent force that we want to consider is damping. Th...

The subsequent force that we want to consider is damping. This force may or may not be there for any specified problem. Dampers work to counteract any movement. There are some w

What are factors, What are Factors? When you multiply several numbers t...

What are Factors? When you multiply several numbers together, (4 x 5 x 3), the numbers (4, 5, and 3) being multiplied are called factors. The result of the multiplying th

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