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

General math, Kwai made 5 pints of iced tea. How many cups of tea did he ma...

Kwai made 5 pints of iced tea. How many cups of tea did he make?

Problems related to applying operations in learning maths, PROBLEMS RELATED...

PROBLEMS RELATED TO APPLYING OPERATIONS :  Some of us were testing Class 4 children with addition and subtraction problems. We gave them sums that were written horizontally and th

What was joe's approximate raw act score, Using the same mean and standard ...

Using the same mean and standard deviation from problem 10 (mean m = 20.1 and a standard deviation s = 5.8). Joe was informed that he scored at the 68 th percentile on the ACT, wh

Multiplication of binomials, To understand the multiplication of binomials,...

To understand the multiplication of binomials, we should know what is meant by Distributive Law of Multiplication. Suppose that we are to multiply (a + b) and m. We

The index of industrial production, The index of industrial production ...

The index of industrial production This is a quantity index compiled by the government. This measures changes in the volume of production in main industries. The index is a ex

Evaluating a function, Evaluating a Function You evaluate a function by...

Evaluating a Function You evaluate a function by "plugging in a number". For example, to evaluate the function f(x) = 3x 2 + x -5 at x = 10, you plug in a 10 everywhere you

Shares and dividend, A man in rested rupee 800 is buying rupee5 shares and ...

A man in rested rupee 800 is buying rupee5 shares and then they are selling at premium of rupee 1.15.he sells all the share.find profit?

Pricing styrategies, #questiThe net profit in an appliance department for t...

#questiThe net profit in an appliance department for the spring /sumeer was $20,000 which represented 2% of net sales. Operating expenses total $480,000 find dollar amount of gross

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