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

Find the area of the remaining part of cardboard, From a sheet of cardboard...

From a sheet of cardboard in the shape of a square of side 14 cm, a piece in the shape of letter B is cut off. The curved side of the letter consists of two equal semicircles & the

Math.., how many sixs are in 60

how many sixs are in 60

Area with parametric equations - polar coordinates, Area with Parametric Eq...

Area with Parametric Equations In this section we will find out a formula for ascertaining the area under a parametric curve specified by the parametric equations, x = f (t)

Algebra, Solve 2x^2 + 5x + 36

Solve 2x^2 + 5x + 36

Finding absolute extrema, Finding Absolute Extrema : Now it's time to see ...

Finding Absolute Extrema : Now it's time to see our first major application of derivatives.  Specified a continuous function, f(x), on an interval [a,b] we desire to find out the

Polynomials, In arithmetic, we deal with numbers. In contrast to this...

In arithmetic, we deal with numbers. In contrast to this, in algebra, we deal with symbols. These symbols are often represented by lower case alphabets. One of th

Characteristic, mention the characteristic of mathematic

mention the characteristic of mathematic

Comperised payrolll package, a computerized payroll package and its cost,fu...

a computerized payroll package and its cost,futures and the size of the business and how business mathematics is an inbuilt component of the package

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