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

Ann, What was last years salary if after a 3% increase the salary is 35,020...

What was last years salary if after a 3% increase the salary is 35,020?

Geometric mean-geometric progression, Geometric mean - It is a measure ...

Geometric mean - It is a measure of central tendency normally utilized to measure industrial increases rates. - It is explained as the nth root of the product of 'n' observa

Detemine the amplitude of trigonometric function, 1. Consider the trigonome...

1. Consider the trigonometric function f(t) = (a) What is the amplitude of f(t)? (b) What is the period of f(t)? (c) What are the maximum and minimum values attained by

Simplification, if a+1/b=b+1/c=c+1/a then the value of abc is

if a+1/b=b+1/c=c+1/a then the value of abc is

System of linear equations, create a system of linear equations that has (2...

create a system of linear equations that has (2,3)as a solution.

Solving Trig Equations, How would you solve the equation: 1+ sin(theta)= 2 ...

How would you solve the equation: 1+ sin(theta)= 2 cos^2(theta)?

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