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

Calculate the volume of rectangular piece of cardboard, 1. A rectangular pi...

1. A rectangular piece of cardboard measuring 15 inches by 24 inches is to be made into a box with an open top by cutting equal size squares from each comer and folding up the side

How to solving one-step equations, How to Solving One-Step Equations? E...

How to Solving One-Step Equations? Equations, where one math operation is acting on the variable, can be solved in one step. The trick is to get the variable x by itself - isol

How far up the building will the ladder reach?, A rescue and ?re squad plac...

A rescue and ?re squad places a 15 ft ladder against a burning building. If the ladder is 9 ft from the base of the building, how far up the building will the ladder reach? a. 8

Percentage of values will fall in the normal group, If the normal range is ...

If the normal range is 65-10 mg/dl, then what percentage of values will fall in the normal group?

Apply depth-first-search to find out the spanning tree, Apply depth-first-s...

Apply depth-first-search to find out the spanning tree for the subsequent graph with vertex d as the starting vertex.        Ans: Let us begin with node'd'. Mark d as vi

The shortest distance among the line y-x=1 and curve x=y^2, Any point on pa...

Any point on parabola, (k 2 ,k) Perpendicular distance formula: D=(k-k 2 -1)/2 1/2 Differentiating and putting =0 1-2k=0 k=1/2 Therefore the point is (1/4, 1/2) D=3/(32 1/2

Test, a piece of ribbon measures 2,25 meters . it is cut in half . how long...

a piece of ribbon measures 2,25 meters . it is cut in half . how long is one half of the ribbon

Calculate the height of the tunnel and the perimeter, The adjoining figure...

The adjoining figure shows the cross-section of a railway tunnel. The radius of the tunnel is 3.5m (i.e., OA=3.5m) and ∠AOB=90 o . Calculate : i.       the height of the

Sum, what is an equation for circle?..

what is an equation for circle?..

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