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

Square numbers, determine the square of the following numbers ... a.8 b.13 ...

determine the square of the following numbers ... a.8 b.13 c.17 and d.80

Permuation and combination, how many words can be formed from letters of wo...

how many words can be formed from letters of word daughter such that word contain 2vowles and 3consonant

Determine boolean conjunctive query are cyclic or acyclic, Are the followin...

Are the following Boolean conjunctive queries cyclic or acyclic? (a) a(A,B) Λ b(C,B) Λ c(D,B) Λ d(B,E) Λ e(E,F) Λ f(E,G) Λ g(E,H). (b) a(A,B,C) Λ b(A,B,D) Λ c(C,D) Λ d(A,B,C,

Geometry, triangular with base AB = 48cm and height CH=16cm is inscribed a ...

triangular with base AB = 48cm and height CH=16cm is inscribed a rectangle MNPQ in which MN: MQ = 9:5 Find MN and MQ

Constants of integration, CONSTANTS OF INTEGRATION Under this section w...

CONSTANTS OF INTEGRATION Under this section we require to address a couple of sections about the constant of integration. During most calculus class we play pretty quick and lo

Absolute mean deviation-measures of central tendency, Illustration 1 I...

Illustration 1 In a described exam the scores for 10 students were given as: Student Mark (x) |x-x¯| A 60

Complex numbers, A number of the form x + iy, where x and y are real and na...

A number of the form x + iy, where x and y are real and natural numbers and is called as a complex number. It is normally given by z. i.e. z = x + iy, x is called as the real part

Simultaneous equations by substitution, Simultaneous equations by substitut...

Simultaneous equations by substitution: Solve the subsequent simultaneous equations by substitution. 3x + 4y = 6      5x + 3y = -1 Solution: Solve for x: 3x = 6

Trignometry, Sin3x ? Solution) THE FORMULA IS RIGHT ,SO sin3x=3sin...

Sin3x ? Solution) THE FORMULA IS RIGHT ,SO sin3x=3sinx-4sin 3 x

Mathematical formulae, Mathematical Formulae (a ...

Mathematical Formulae (a + b) 2 = a 2 + b 2 + 2ab (a - b) 2 = a 2 + b 2 - 2ab (a + b) 2 +

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