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

Determine the area of the regular octagon, Determine the area of the regula...

Determine the area of the regular octagon with the following measurements. a. 224 square units b. 112 square units c. 84 square units d. 169 square units b. See

Problem solving, Let E; F be 2 points in the plane, EF has length 1, and le...

Let E; F be 2 points in the plane, EF has length 1, and let N be a continuous curve from E to F. A chord of N is a straight line joining 2 points on N. Prove if 0 and N has no cho

Find the annual percentage yield, 1.   Find the APY for the bank described ...

1.   Find the APY for the bank described below- A bank offers an APR of 4% compounded monthly. 2.  Use the compound interest formula to compute the balance in the following a

Integral calculus, how to change order and variable in multiple integral

how to change order and variable in multiple integral

Example on discrete mathematics, Suppose that at some future time every tel...

Suppose that at some future time every telephone in the world is assigned a number that contains a country code, 1 to 3 digits long, that is, of the form X, XX , XXX or followed

Which of the subsequent decimals is the greatest number, Which of the subse...

Which of the subsequent decimals is the greatest number? If you add zeros to the end of every of the numbers so that each number has 5 places after the decimal point, it is sim

Quadratic equation, can anyone explain me the concept of quadratic equation...

can anyone explain me the concept of quadratic equation?

Perimeter of trinagle, what is the perimeter of a triangele with the sides ...

what is the perimeter of a triangele with the sides of 32 in /22 in/20 in/

Functions, find the domain of the function f(x) = (| sin inverse sin x | - ...

find the domain of the function f(x) = (| sin inverse sin x | - cos inverse cos x) ^ 1/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