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

Demerits and merit-the median, The median Merits i.  This shows t...

The median Merits i.  This shows the centre of a described set of data ii.  Knowledge of the determination of the median may be extended to find out the quartiles i

Properties of relations in a set, Reflexive Relations: R is a reflexive...

Reflexive Relations: R is a reflexive relation if (a, a) € R,  a € A. It could be noticed if there is at least one member a € A like (a, a) € R, then R is not reflexive. Sy

Applied mathematics, I have a journal article in applied mathematics and wa...

I have a journal article in applied mathematics and want to analyze the solutions step by step. Is there anyone specialize in this file?

Fundamental theorem of integral facts formulasproperties, Fundamental Theor...

Fundamental Theorem of Calculus, Part I If f(x) is continuous on [a,b] so, g(x) = a ∫ x f(t) dt is continuous on [a,b] and this is differentiable on (a, b) and as,

Pair of straight line, The equation ax2 + 2hxy + by2 =0 represents a pair o...

The equation ax2 + 2hxy + by2 =0 represents a pair of straight lines passing through the origin and its angle is tan q = ±2root under h2-ab/(a+b) and even the eqn ax2+2hxy+by2+2gx+

Coefficient of determination, It refers to the ratio of the explained varia...

It refers to the ratio of the explained variation to the total variation and is utilized to measure the strength of the linear relationship. The stronger the linear relationship th

Find the slope of a line given two points on it, Finding the Slope of a Lin...

Finding the Slope of a Line, Given Two Points on it ? Find the slope of the line passing through the pairs of points (-5, -2) and (2, 4). One way to find the slope is

The achievements from math, i love math..but i am afraid to study it... i m...

i love math..but i am afraid to study it... i mean i ma afraid that it may leave me in clay...what can you suggest me?

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