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

Miss, how do you find the average of a number

how do you find the average of a number

Maths for fun-mathematics- in our lives, Maths For Fun :  Often, when I ha...

Maths For Fun :  Often, when I have time on my hands, I try to solve interesting mathematical questions of the following kind. Sometimes my friends and I create the problems, and

Center of mass - applications of integrals, Center of Mass - Applications o...

Center of Mass - Applications of integrals In this part we are going to find out the center of mass or centroid of a thin plate along with uniform density ρ. The center of mass

Pre kg, my daughter in kg now how can i train her to develop skills in unde...

my daughter in kg now how can i train her to develop skills in undertanding the basics of all subjects how can i start teaching other than schol

Explain why f must be a di?erentiable function, Let f : R 3 → R be de?ned ...

Let f : R 3 → R be de?ned by:                                        f(x, y, z) = xy 2 + x 3 z 4 + y 5 z 6 a) Compute ~ ∇f(x, y, z) , and evaluate ~ ∇f(2, 1, 1) . b) Brie?y

Models of energy production, Find models of energy production and energy us...

Find models of energy production and energy usage from 2 different countries, each on a different continent, which predict future energy production and demands. How was data collec

Indeterminate forms, Indeterminate forms Limits we specified methods fo...

Indeterminate forms Limits we specified methods for dealing with the following limits. In the first limit if we plugged in x = 4 we would get 0/0 & in the second limit

Heat loss in cylindrical pipe, which physics law is used to describe heat l...

which physics law is used to describe heat loss in cylindrical pipe

Value delivery, What do you mean by value delivery

What do you mean by value delivery

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