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

Integration, how to learn integration?easier

how to learn integration?easier

What is the maximum volume of rectangular box, 1. A rectangular piece of ca...

1. A rectangular piece of cardboard measuring 26 inches by 42 inches is to be made into a box with an open top by cutting equal size squares from each comer and folding up the side

Fraction, give some examples of fractions that are already reduce

give some examples of fractions that are already reduce

How to convert decimals to fractions, Q. How to Convert decimals to fractio...

Q. How to Convert decimals to fractions? Ans. Note: This tutorial covers only terminating decimals.

each player selects one of her two remaining chips , Consider the followin...

Consider the following parlor game to be played between two players. Each player begins with three chips: one red, one white, and one blue. Each chip can be used only once. To beg

RECTILINEAR FIGURES, AB,BC,CD ARE THREE CONSECUTIE SIDES OF REGULAR POLYGON...

AB,BC,CD ARE THREE CONSECUTIE SIDES OF REGULAR POLYGON.IF ANGLE BAC IS 18 DEGREE, FIND EXTERIOR ANGLES AND NUMBER OF SIDES ?

Solving equations by completing the square method, I need help for Solving ...

I need help for Solving Equations by Completing the Square Method, can anybody help me out for this?

Complex Numbers, How do you compute the phase/angle of a complex number? i....

How do you compute the phase/angle of a complex number? i.e 1+2i

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