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

External division of section formula, give me the derivation of external di...

give me the derivation of external division of sectional formula using vectors

construct an isosceles triangle, 1. Construct an isosceles triangle whose ...

1. Construct an isosceles triangle whose base is 7cm and altitude 4cm and then construct another similar triangle whose sides are 1/2 times the corresponding sides of the isosceles

Statistics, find the number of ways 17 employees can b chosen from 327

find the number of ways 17 employees can b chosen from 327

Testing the difference between two sample means-illustration, An observatio...

An observation was made concerning reading abilities of males and females. The observation leads to a conclusion that females are faster readers than males. The observation was bas

Fractions, how do you multiply fractions

how do you multiply fractions

Word Problem, One box can hold 5 1/2 lbs of nuts and 3 lb 6oz of bolts. Wha...

One box can hold 5 1/2 lbs of nuts and 3 lb 6oz of bolts. What is the total weight for one box?

What are inclusive events, Q. What are Inclusive Events? Ans. Even...

Q. What are Inclusive Events? Ans. Events that can occur at the same time are called inclusive events. For example, a student can belong to more than one club at one time

Solve the limit problem, Solve the Limit problem as stated  Limit x tends...

Solve the Limit problem as stated  Limit x tends to 0 [tanx/x]^1/x^2 is ? lim m tends to infinity [cos (x/m)] ^m is? I need the procedure of solving these sums..

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