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

How to dealing with exponents on negative bases, How to Dealing With Expone...

How to Dealing With Exponents on Negative Bases ? Exponents work just the same way on negative bases as they do on positive ones: (-2)0 = 1 Any number (except 0) raised to the

Graph and algebraic methods , To answer each question, use the function t(r...

To answer each question, use the function t(r) = d , where t is the time in hours, d is the distance in miles, and r is the rate in miles per hour. a. Sydney drives 10 mi at a c

Theorem, Theorem, from Definition of Derivative  If f(x) is differenti...

Theorem, from Definition of Derivative  If f(x) is differentiable at x = a then f(x) is continuous at x =a. Proof : Since f(x) is differentiable at x = a we know, f'(a

Projectile, what is the greatest projection range down an inclined plane? h...

what is the greatest projection range down an inclined plane? how we will calculate that?

Parametric equations and polar coordinates, Parametric Equations and Polar ...

Parametric Equations and Polar Coordinates In this part we come across at parametric equations and polar coordinates. When the two subjects don't come out to have that much in

Listing method, how will you explain the listing method?

how will you explain the listing method?

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