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

Complex numbers, How t determine locus of a goven point

How t determine locus of a goven point

#Regular Expression, Find the Regular Grammar for the following Regular Exp...

Find the Regular Grammar for the following Regular Expression: a(a+b)*(ab*+ba*)b.

How will the decimal point move when 245.398 is multiplied, How will the de...

How will the decimal point move when 245.398 is multiplied by 100? It is moved two places to the right. While multiplying by multiples of 10, the decimal point is moved to the

Trigonometric ratios, to difine trigonometric ratios of an angle,is it nece...

to difine trigonometric ratios of an angle,is it necessary that the initial ray of the angle must be positive x-axis?

Math, The Timbuktu post office has only 3 cents and 7 cents stamps having r...

The Timbuktu post office has only 3 cents and 7 cents stamps having run out of all other denominations. What are the six amounts of postage that cannot be created? How do you know

Student, Patio measures 24 meters square. Patio stone are 30 cm each side. ...

Patio measures 24 meters square. Patio stone are 30 cm each side. How many stones are required to cover the patio?

Laws of logarithms, express each logariths in terms of log3 P and log3 Q. 1...

express each logariths in terms of log3 P and log3 Q. 1. log3 P^2 Q^3

Find out the total number people and the total number car, A national park ...

A national park remains track of how many people per car enter the park. Today, 57 cars had 4 people, 61 cars had 2 people, 9 cars had 1 person, and 5 cars had 5 people. What is th

Computing change for a given coin system, This problem involves the questio...

This problem involves the question of computing change for a given coin system. A coin system is defined to be a sequence of coin values v1 (a) Let c ≥ 2 be an integer constant

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