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

Lcm, what is the LCM of 4, 6, 18

what is the LCM of 4, 6, 18

.gradient, Draw the graph of y=x^2-4x from x=-1 to x=5.use the scale of 2cm...

Draw the graph of y=x^2-4x from x=-1 to x=5.use the scale of 2cm on the x axis and 1cm on the y axis.Estimate the gradient at point:x=4, x=2 and x=0

Differential calculus and probability, Josephine is constructing an open bo...

Josephine is constructing an open box by cutting the squares off the corners of a sheet of paper sized 20cm by 16cm. She is considering options of 3cm, 4cm and 5cm squares in order

Damping force, The subsequent force that we want to consider is damping. Th...

The subsequent force that we want to consider is damping. This force may or may not be there for any specified problem. Dampers work to counteract any movement. There are some w

Deflation, Deflation Indexes may be utilized to deflate time series so...

Deflation Indexes may be utilized to deflate time series so that comparisons among periods may be made in real terms. This is a process of decreases a value measured in cur

Finding the equation of a line, Finding the Equation of a line, Given a Slo...

Finding the Equation of a line, Given a Slope and a Point ? Find the equation of a line with slope m = 2, which passes through the point (-1, -3). Solution: Use the po

Area between two curves, Area between Two Curves We'll start with the ...

Area between Two Curves We'll start with the formula for finding the area among y = f(x) and y = g(x) on the interval [a,b].  We will also suppose that f(x) ≥ g(x) on [a,b].

Heat loss in a cylindrical pipe, which laws of physics are used to discuss ...

which laws of physics are used to discuss heat loss in a pipe

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