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

Linear equation, develop any two linear equation which are reducible into l...

develop any two linear equation which are reducible into linear form from our daily life by cross multiplication

Systems of equations, Since we are going to be working almost exclusively a...

Since we are going to be working almost exclusively along with systems of equations wherein the number of unknowns equals the number of equations we will confine our review to thes

Assisnment, How a student of mathematics of b.sc can make an assignment on...

How a student of mathematics of b.sc can make an assignment on topic of asymptotes?

the volume of a pyramid, Write a script to determine the volume of a pyram...

Write a script to determine the volume of a pyramid, which is 1/3 * base * height, where the base is length * width.  On time the user to enter values for the length, width, and th

Circls, in a given figure a,b,c and d are points on a circle such that ABC ...

in a given figure a,b,c and d are points on a circle such that ABC =40 and DAB= 60 find the measure of DBA

The bionomial theorem for rational index, use the bionomial theorem to expa...

use the bionomial theorem to expand x+2/(2-X)(WHOLE SQUARE 2)

Example of addition of fractions, Example of addition of Fractions: 10...

Example of addition of Fractions: 105/64 + 15/32 + 1/6 =____ would require the denominator to be equal to 64 x 32 x 6 = 12,288. This type of number is very hard to use.

Upper limit of normal , Frequently, tests that yield abnormal results are r...

Frequently, tests that yield abnormal results are repeated for confirmation.  What is the probability that for a usual person a test will be at least 1.5 times as high as the upper

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