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

Describe differance between mean vs. mode, Describe differance between Mean...

Describe differance between Mean vs. Mode ? Every set of numbers or data has a mean and a mode value. The mean is the average value of all the numbers in the set. The mode is t

#title., am i going to get As

am i going to get As

Twice a number increased by 11 is equal to 32 less three, Twice a number in...

Twice a number increased by 11 is equal to 32 less than three times the number. Find out the number. Let x = the number. Now translate every part of the sentence. Twice a numb

Pat, what is a fraction?

what is a fraction?

Arithmetic progression, the radii of circular base of right circular cylind...

the radii of circular base of right circular cylinder and cone are in the ratio of 3:4 and their height are in the ratio of the 2:3 what is the ratio of their volume?

What is the measure of its width if its length is 3 inches, The perimeter o...

The perimeter of a rectangle is 21 inches. What is the measure of its width if its length is 3 inches greater than its width? Let x = the width of the rectangle. Let x + 3 = th

Find regular grammar for given regular expression, find regular grammar for...

find regular grammar for the following regular expression: a(a+b)*(ab* +ba*)b

How to converting decimals to percents, How to Converting Decimals to Perce...

How to Converting Decimals to Percents ? To convert a decimal to a percent: Move the decimal point two decimal places to the right. Place a percent sign after the resulting

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