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

Converting., I need help converting my project fractions into 1

I need help converting my project fractions into 1

Children learn maths by experiencing things, Children Learn By Experiencing...

Children Learn By Experiencing Things : One view about learning says that children construct knowledge by acting upon things. They pick up things, throw them, break them, join the

What is plotting points, What is Plotting Points ? How would you go abo...

What is Plotting Points ? How would you go about drawing the graph of y = x2 ? One way to do it is by plotting points. (Your graphing calculator uses this method.) This is

The low temperature in Achorage, The low temperature in Anchorage, Alaska t...

The low temperature in Anchorage, Alaska today was negative four degrees. The low temperature in Los Angeles, California was sixty-three degreees. What is the difference in the two

Give a definition of perimeter and area, Give a Definition of Perimeter and...

Give a Definition of Perimeter and Area? Perimeter is the distance around a flat (2-dimensional) shape. Area is the amount of space taken up by a flat (2-dimensional) shape. is

Twelve coworkers go out how many slices will each person get, Twelve cowork...

Twelve coworkers go out for lunch together and sequence three pizzas. Each pizza is cut within eight slices. If each person gets the similar number of slices, how many slices will

Math 100, introduction to decimals

introduction to decimals

Solve the form ax2 - bx - c factoring polynomials, Solve the form ax 2 - b...

Solve the form ax 2 - bx - c factoring polynomials ? This tutorial will help you factor quadratics that look something like this: 2x 2 -3x - 14 (Leading coefficient is

Economics, A mortgage lender seeks to maximize the expected value of its po...

A mortgage lender seeks to maximize the expected value of its portfolio. The portfolio, of course, is the sum of all of the mortgages in it, so no generality is lost by examining t

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