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

Decimals, how will the decimal point move when 245.398 is multiplied by 10

how will the decimal point move when 245.398 is multiplied by 10

What is the new price of the coat, An $80.00 coat is marked down 20%. It do...

An $80.00 coat is marked down 20%. It does not sell, so the shop owner marks it down an additional 15%. What is the new price of the coat? Find out 20 percent of the original p

Methods of set representation, I have an assignment of set theory, please E...

I have an assignment of set theory, please Explain Methods of set representation.

Numercial analysis and computer techniques, write FORTRAN programme to gene...

write FORTRAN programme to generate prime numbers between 1 and 100

Geometry , Solving for X in isosceles triangles

Solving for X in isosceles triangles

Population problem - nonhomogeneous systems, The next kind of problem seems...

The next kind of problem seems as the population problem. Back in the first order modeling section we looked at several population problems. In such problems we noticed a single po

The prerequisites for multiplication, THE PREREQUISITES FOR MULTIPLICATION ...

THE PREREQUISITES FOR MULTIPLICATION : The word 'multiply', used in ordinary language, bears the meaning 'increase enormously For instance, bacteria multiply in favourable conditi

Supply/demand, For the pair of supply-and-demand equations, where x represe...

For the pair of supply-and-demand equations, where x represents the quantity demanded in units of 1000 and p is the unit price in dollars, find the equilibrium quantity and the equ

What is 2^5, What is 2 5 ? 2 5 = 2 ×2 ×2 ×2 ×2 = 32

What is 2 5 ? 2 5 = 2 ×2 ×2 ×2 ×2 = 32

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