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

Theorem of reduction of order, In this theorem we identify that for a speci...

In this theorem we identify that for a specified differential equation a set of fundamental solutions will exist. Consider the differential equation  y′′ + p (t ) y′ + q (t

Decomposing polygons to find area, find the area of this figure in square m...

find the area of this figure in square millimeter measure each segment to the nearest millmeter

Equations of lines - three dimensional spaces, Equations of Lines In t...

Equations of Lines In this part we need to take a view at the equation of a line in R 3 .  As we saw in the earlier section the equation y = mx+b does not explain a line in R

Trigonometry, sin^2alpha *sec^2beta +tan^2 beta *cos^2alpha=sin^2alpha+tan^...

sin^2alpha *sec^2beta +tan^2 beta *cos^2alpha=sin^2alpha+tan^2 beta

What is the greatest value of the number, Five more than the quotient of a ...

Five more than the quotient of a number and 2 is at least that number. What is the greatest value of the number? Let x = the number. Notice that quotient is a key word for div

Pre Calculus, I have no idea how to graph exponential forms.

I have no idea how to graph exponential forms.

Algebra ii, How do you graph a hyperbola?

How do you graph a hyperbola?

What percent of her money did she spend on lunch, Wendy brought $16 to the ...

Wendy brought $16 to the mall. She spent $6 on lunch. What percent of her money did she spend on lunch? Divide $6 by $16 to ?nd out the percent; $6 ÷ $16 = 0.375; 0.375 is equi

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