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

Example of mixing problems, A 1500 gallon tank primarily holds 600 gallons ...

A 1500 gallon tank primarily holds 600 gallons of water along with 5 lbs of salt dissolved into it. Water enters the tank at a rate of 9 gal/hr and the water entering the tank has

Rocks and minerals, question..how do u understand thr rock cycle

question..how do u understand thr rock cycle

Illustrate child ability to perform a math task, Give an example to illustr...

Give an example to illustrate how language incompetence can interfere with a child's ability to perform a task. While setting up a classification activity, a teacher gave the ch

Function and relation, how to know if it is function and if is relation

how to know if it is function and if is relation

Constant aceleration formulae, a car comes to a stop from a speed of 30m/s ...

a car comes to a stop from a speed of 30m/s in a distance of 804m. The driver brakes so as to produce a decelration of 1/2m per sec sqaured to begin withand then brakes harder to p

Evaluate relate rate in shape of a cone a tank , In the shape of a cone a t...

In the shape of a cone a tank of water is leaking water at a constant rate of 2 ft 3 /hour .  The base radius of the tank is equal to 5 ft and the height of the tank is 14 ft.

Determine does this point lie on the line, Does this Point Lie on The Line?...

Does this Point Lie on The Line? How do you know if a point lies on a given line? For example, does the point (1, 2) lie on the line 3x + y = 7? If you graph the line and the

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