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

Arc length for parametric equations, Arc Length for Parametric Equations ...

Arc Length for Parametric Equations L = ∫ β α √ ((dx/dt) 2 + (dy/dt) 2 ) dt Note: that we could have utilized the second formula for ds above is we had supposed inste

find the slope and the y intercept of the line - geometry, 1. Find the slo...

1. Find the slope and the y-intercept of the line whose equation is 5x + 6y = 7. 2. Find the equation of the line that is parallel to 2x + 5y = 7 and passes through the mid poin

Midpoint rule - approximating definite integrals, Midpoint Rule - Approxima...

Midpoint Rule - Approximating Definite Integrals This is the rule which should be somewhat well-known to you. We will divide the interval [a,b] into n subintervals of equal wid

Find the constant height at which the jet is flying, The angle of ...

The angle of elevation of a jet fighter from a point A on the ground is 600. After a flight of 15 seconds, the angle of elevation changes to 300. If the jet is flying at a speed  o

Applied mathematics, I have a journal article in applied mathematics and wa...

I have a journal article in applied mathematics and want to analyze the solutions step by step. Is there anyone specialize in this file?

Application of related rates to economics and business, the wholesale p of ...

the wholesale p of string beans in dollars per bushel and the daily supply x in thousands of bushel,are related by the equation px+6x+7p=5950. if the supply is decreasing at the r

Regression - measures of relationships, Regression - Measures of Relationsh...

Regression - Measures of Relationships - It is a concept that refers to the changes which happen in the dependent variable as a result of changes happens on the independent va

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