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

Word problems, The sum of two numbers is 19, their difference is 5. find th...

The sum of two numbers is 19, their difference is 5. find the numbers

Calculate the width of the river, A surveyor is hired to calculate the widt...

A surveyor is hired to calculate the width of a river. Using the example provided, Calculate the width of the river. a. 48 ft b. 8 ft c. 35 ft d. 75 ft

G .E matrix, using the g.e matrix, how can you turn an unattractive product...

using the g.e matrix, how can you turn an unattractive product to be attractive

Find the largest possible positive integer, Find the largest possible posit...

Find the largest possible positive integer that will divide 398, 436, and 542 leaving remainder 7, 11, 15 respectively. (Ans: 17) Ans: The required number is the HCF of the n

Determine whether the following numbers are odd or even, Determine whether ...

Determine whether the following numbers are odd or even: Examples: Determine whether the following numbers are odd or even:  364, 1068, & 257. Solution: 1.

Kurtosis-measure of central tendency, Kurtosis - It is a concept, whic...

Kurtosis - It is a concept, which refers to the degree of peakedness of a described frequency distribution. The degree is generally measured along with reference to general di

Example of graphical technique of linear equations, Explain the Graphical T...

Explain the Graphical Technique of Linear Equations by using this figure.

Find out the center of mass, Find out the center of mass for the region bou...

Find out the center of mass for the region bounded by y = 2sin (2x), y =0 on  the interval  [0 , Π/2] Solution Here is a sketch (diagram) of the region along with the cent

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