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

Solving equations and/or word problems for the unknowns, With their fence i...

With their fence in place, Zack and Clint set to work landscaping yards. Since Clint did the majority of the actual landscaping and planting, he worked on the average more hours t

Give the example of exponents, Give the example of Exponents? When a nu...

Give the example of Exponents? When a number is multiplied several times, it is easier to write it as an exponent. For example, four multiplied to itself three times, is writte

Intercepts, The last topic that we want to discuss in this section is that ...

The last topic that we want to discuss in this section is that of intercepts.  Notice that the graph in the above instance crosses the x-axis in two places & the y-axis in one plac

Solve 9 sin ( 2 x )= -5 cos(2x ) on[-10, Solve 9 sin ( 2 x )= -5 cos(2x ) o...

Solve 9 sin ( 2 x )= -5 cos(2x ) on[-10,0]. Solution At first glance this problem appears to be at odds with the sentence preceding the example. However, it really isn't.

Find the time it takes to slide down, The time in seconds that it takes for...

The time in seconds that it takes for a sled to slide down a hillside inclined at and angle θ is where d is the length of the slope in metres. Find the time it takes to sli

Price cutter sold 85 beach towels what were the total sales, Price Cutter s...

Price Cutter sold 85 beach towels for $6.95 each. What were the total sales? You must multiply the number of towels sold through the price of each towel; 85 × $6.95 = $590.75.

Problem Solving, the low temperature in anchorage alaska today was negative...

the low temperature in anchorage alaska today was negative four degrees what is the difference in the two low temperatures

Faltings theorem, What is Faltings Theorem? Explain Faltings Theorem

What is Faltings Theorem? Explain Faltings Theorem

Help me help me!, A 65 ohm resistor is connected to a power supply , a curr...

A 65 ohm resistor is connected to a power supply , a current of 2.4 amperes is drawn. what is the output voltage?

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