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 algrebra, how do we solve multiple optimal solution

how do we solve multiple optimal solution

Create a circular table with no restrictions, 1. Four different written dri...

1. Four different written driving tests are administered by a city. One of these tests is selected at random for each applicant for a drivers license. If a group of 2 women and 4 m

Algebra 1, how do you factor a trinomial into a binomial ?

how do you factor a trinomial into a binomial ?

Find the area of triangle, Find the area of TRIANGLE ? To find the area...

Find the area of TRIANGLE ? To find the area of a triangle, multiply the base (b) by the height (h), and divide the resulting number in half. In other words, area is. It is

Determine the nand gate, Find out the two inputs when the NAND gate output ...

Find out the two inputs when the NAND gate output will be low. Ans. The output of NAND gate will be low if the two inputs are 11. The Truth Table of NAND gate is shown

If 1/x+2, if 1/x+2, 1/x+3, 1/x+5 are in AP find x Ans 1/x+2,1/x+3, 1/x+5...

if 1/x+2, 1/x+3, 1/x+5 are in AP find x Ans 1/x+2,1/x+3, 1/x+5 are in AP find x. 1/x+3 - 1/x+2 = 1/x+5-1/x+3 =>  1/x 2 +5x+6  = 2/ x 2 +8x +15 =>  On solving we get x

Melissa is four times if jim is y years old, Melissa is four times as old a...

Melissa is four times as old as Jim. Pat is 5 years older than Melissa. If Jim is y years old, how old is Pat? Start along with Jim's age, y, because he appears to be the young

Find the maximum expected holdings, Problem: A person has 3 units of mo...

Problem: A person has 3 units of money available for investment in a business opportunity that matures in 1 year. The opportunity is risky in that the return is either double o

Method to solve binomials of second degree, In this part we look at a...

In this part we look at another method to obtain the factors of an expression. In the above you have seen that x 2 - 4x + 4 = (x - 2) 2 or (x - 2)(x - 2). If yo

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