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

Evaluate the area of circle, If the radius of a sphere is doubled, the surf...

If the radius of a sphere is doubled, the surface area is a. multiplied by 4. b. multiplied by 2. c. multiplied by 3. d. multiplied by 8. a. The formula for the surf

Plane and solid mensuration, the area of a triangle is 20 and its base is 1...

the area of a triangle is 20 and its base is 16. Find the base of a similar triangle whose area is 45. Given is a regular pentagon. Find the measure of angle LHIK.

Determine the number of combinations, 3 items x, y and z will have 6 differ...

3 items x, y and z will have 6 different permutations however only one combination. The given formular is generally used to determine the number of combinations in a described situ

Function to convert a complex number in algebraic form, Go back to the com...

Go back to the complex numbers code in Figures 50 and 51 of your notes. Add code fragments to handle the following: 1. A function for adding two complex numbers given in algeb

Compound interest, principal=2000 rate=5% time=2 years find compound intere...

principal=2000 rate=5% time=2 years find compound interest

The probability that five randomly selected 3-year old snake, The probabili...

The probability that a randomly selected 3-year old garter snake will live to be 4 years old is .54 (assume results are independent).  What is the probability that five randomly se

Fact - undetermined coefficients, Here, let's take a look at sums of the fu...

Here, let's take a look at sums of the fundamental components and/or products of the fundamental components. To do this we'll require the following fact. Fact- Undetermined Co

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