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

Negative function , Negative function : Several functions are not positive...

Negative function : Several functions are not positive however.  Consider the case of f (x ) =x 2 - 4 on [0,2].  If we utilizes n = 8 and the midpoints for the rectangle height w

The Theory of Set, Set M= {m''s/m is a number from 5 to 10}

Set M= {m''s/m is a number from 5 to 10}

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

Describe graphing equations with a positive slope, Describe Graphing Equati...

Describe Graphing Equations with a Positive Slope? There are 3 steps to graphing a linear equation: 1. Identify and plot the y-intercept. 2. Determine the slope. Use the slope

Tutoring , hi, i was wondering how do you provide tutoring for math specifi...

hi, i was wondering how do you provide tutoring for math specifically discrete mathematics for computer science ? I want to get some help in understanding in the meantime about alg

Write down the equation of the line, Write down the equation of the line wh...

Write down the equation of the line which passes through the points (2, -1, 3) and (1, 4, -3).  Write all three forms of the equation of the line. Solution To do the above

Precal, The law of cosines can only be applied to acute triangles. Is this ...

The law of cosines can only be applied to acute triangles. Is this true or false?

Euler equations, Euler Equations - Series Solutions to Differential Equ...

Euler Equations - Series Solutions to Differential Equations In this section we require to look for solutions to, ax 2 y′′ + bxy′ + cy = 0 around x0  = 0. These ki

Division, Why do we start dividion operation from left to right?

Why do we start dividion operation from left to right?

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