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

What is the probability that the integer chosen is divisible, An integer i...

An integer is chosen at random from the first two hundreds digit. What is the probability that the integer chosen is divisible by 6 or 8.                    (Ans : 1/4 ) Ans:

Geometry, how to do proving of rectilinear figures?..

how to do proving of rectilinear figures?..

Average function value, Average Function Value The average value of a ...

Average Function Value The average value of a function f(x) over the interval [a,b] is specified by, f avg = (1/b-a) a ∫ b f(x) dx Proof We know that the average

Example of developing an understanding, In class 1, the teacher had written...

In class 1, the teacher had written down the digits 0,1, ...., 9 on the board. Then she made all the children recite the corresponding number names. Finally, she made them write th

Expected value of perfect information, Expected Value of Perfect Informatio...

Expected Value of Perfect Information In the above problems we have used the expected value criterion to evaluate the decisions under the conditions of risk. But, as long as un

Solution of rectilinear figures, A straight line AB on the side of a hill i...

A straight line AB on the side of a hill is inclined at 15.0° to the horizontal. The axis of a tunnel 486ft. long is inclined 28.6° below the horizontal lies in a vertical plane wi

Determine the differential y = t 3 - 4t 2 + 7t, Determine the differentia...

Determine the differential for following.                                      y = t 3 - 4t 2 + 7t Solution Before working any of these we have to first discuss just

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