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

Determine whether the following numbers are odd or even, Determine whether ...

Determine whether the following numbers are odd or even: Examples: Determine whether the following numbers are odd or even:  364, 1068, & 257. Solution: 1.

Math.., how many sixs are in 60

how many sixs are in 60

Find out the surface area of the solid - parametric curve, Find out the sur...

Find out the surface area of the solid acquired by rotating the following parametric curve about the x-axis. x = cos 3 θ y = sin 3 θ  0 ≤ θ ≤ ?/2 Solution We wil

Draw the state diagram - transition function, 1. Let M be the PDA with stat...

1. Let M be the PDA with states Q = {q0, q1, and q2}, final states F = {q1, q2} and transition function δ(q0, a, λ) = {[q0, A]} δ(q0, λ , λ) = {[q1, λ]} δ(q0, b, A) = {[q2

Determine the permutation, There are 6 contestants for the post of chairman...

There are 6 contestants for the post of chairman secretary and treasurer. These positions can be filled by any of the 6. Find the possible no. of ways whether the 3 positions may b

Scatter graphs, Scatter Graphs - A scatter graph is a graph that compr...

Scatter Graphs - A scatter graph is a graph that comprises of points which have been plotted but are not joined through line segments - The pattern of the points will defin

Give the example of exponents, Give the example of Exponents? When a nu...

Give the example of Exponents? When a number is multiplied several times, it is easier to write it as an exponent. For example, four multiplied to itself three times, is writte

Find a power series representation for the function, Find a power series re...

Find a power series representation for the subsequent function and find out its interval of convergence. g (x) = 1/1+x 3 Solution What we require to do here is to rela

Explain adding negative fraction, Explain Adding Negative Fraction? To...

Explain Adding Negative Fraction? To add negative fractions: 1. Find a common denominator. 2. Change the fractions to their equivalents, so that they have common denominators

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