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

Use the power function to find derivative, Given, y = f(x) = 2 x 3 - 3x 2 ...

Given, y = f(x) = 2 x 3 - 3x 2 + 4x +5 a)  Use the Power function to find derivative of the function. b)  Find the value of the derivative at x = 4.

Find out the greatest common factor, Find out the Greatest Common Factor? ...

Find out the Greatest Common Factor? The largest number that is a common factor of two numbers (that is, both numbers share the same factor) is called the greatest common facto

Other ways to aid learning maths, OTHER WAYS TO AID LEARNING :  Here we sh...

OTHER WAYS TO AID LEARNING :  Here we shall pay particular attention to the need for repetition, learning from other children, and utilising errors for learning.

Models of energy production, Find models of energy production and energy us...

Find models of energy production and energy usage from 2 different countries, each on a different continent, which predict future energy production and demands. How was data collec

What is the vertex form for a quadratic equation, What is the Vertex Form f...

What is the Vertex Form for a Quadratic Equation ? The vertex form for a quadratic function is as follows: f(x) = a(x - h) 2 + k The graph of this function Is a parabola whos

Polar coordinates, THE CURVE C HAS POLAR EQUATION R=[X^1/2][E^X^2/PI]. WHER...

THE CURVE C HAS POLAR EQUATION R=[X^1/2][E^X^2/PI]. WHERE X IS GREATER THAN OR EQUAL TO 0 BUT LESS THAN OR EQUAL TO PI. THE AREA OF THE FINITE REGION BOUNDED BY C AND THE LINE X EQ

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

Physics of medical imaging, A radiograph is made of an object with a width ...

A radiograph is made of an object with a width of 3 mm using an x-ray tube with a 2 mm focal spot at a source-to-film distance of 100 cm. The object being imaged is 15 cm from the

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