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

Subspace of r containing n, Give an example of each of the following given ...

Give an example of each of the following given below . You do not require to give any justi cation. (a) A nonempty, bounded subset of Q with no in mum in Q. (b) A subspace of

Math, A small square is located inside a bigger square. The length of the s...

A small square is located inside a bigger square. The length of the small square is 3 in. The length of the large square is 7m. What is the area of the big square if you take out t

What is the evaluation of angle, In a periscope, a pair of mirrors is mount...

In a periscope, a pair of mirrors is mounted parallel to each other as given. The path of light becomes a transversal. If ∠2 evaluate 50°, what is the evaluation of ∠3? a. 50°

Laws of set algebra, Laws of Set Algebra From the given Venn diagram w...

Laws of Set Algebra From the given Venn diagram where T is the universal set and A its subset that we can deduce a number of laws as: i. A υ Ø = A ii. A υ T = T

Numeration, which of these is between 5,945,089 and 5,956,108

which of these is between 5,945,089 and 5,956,108

Probability exercise, 1. A psychologist developed a test designed to help p...

1. A psychologist developed a test designed to help predict whether production-line workers in a large industry will perform satisfactorily. A test was administered to all new empl

Parametric curve - parametric equations & polar coordinates, Parametric Cur...

Parametric Curve - Parametric Equations & Polar Coordinates Here now, let us take a look at just how we could probably get two tangents lines at a point.  This was surely not

Fractions, a boy is six months old his sister was given birth to three mont...

a boy is six months old his sister was given birth to three month after him. if their cousin is 0.33years old, arrange their ages in ascending order

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