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

What is perfect squares, What is Perfect Squares ? Any number that can ...

What is Perfect Squares ? Any number that can be written as an integer to the power of two is called a perfect square. For example, 4 can be written as 2 2 4 is a "perfect sq

Prove that sec2+cosec2 can never be less than 2, Prove that sec 2 θ+cosec 2...

Prove that sec 2 θ+cosec 2 θ can never be less than 2. Ans:    S.T Sec 2 θ + Cosec 2 θ can never be less than 2. If possible let it be less than 2. 1 + Tan 2 θ + 1 + Cot

Derive the probability distribution of the completion times, Derive the pro...

Derive the probability distribution of the completion times: a. The following probability distributions relate to the completion times, in weeks, T A and T B of two independ

Integration of sin ³a.cos ³a , writing sin 3 a.cos 3 a = sin 3 a.cos 2 a.co...

writing sin 3 a.cos 3 a = sin 3 a.cos 2 a.cosa = sin 3 a.(1-sin 2 a).cosa put sin a as then cos a da = dt integral(t 3 (1-t 2 ).dt = integral of t 3 - t 5 dt = t 4 /4-t 6 /6

Algorithm for division helping a child grasp, E1) Why don't you think of so...

E1) Why don't you think of some activities for the same purpose now? E2) Suggest, in detail, another activity for helping a child grasp the algorithm for division. We come to

Plot your data on a scatter plot, Devise data that link a certain relations...

Devise data that link a certain relationship OF YOUR CHOOSING between two variables. Write a rationale stating why you chose this particular data and what you are planning to STAT

What are various strategies adopted for learning maths, Give some children ...

Give some children around you a task in mathematics. The task should be in an area in which they' have not been given a large dose of algorithms and strategies. Do all of them foll

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