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

Think smarter, compare: 643,251; 633,512; and 633,893. the answer is 633,51...

compare: 643,251; 633,512; and 633,893. the answer is 633,512. what is the question?

#title, how do you do hard math!!!

how do you do hard math!!!

How many permutations can you make of the word statistics, Q. How many perm...

Q. How many permutations can you make of the word STATISTICS? Solution:  There are 10 letters in the word STATISTICS, i.e. n=10. Three of them are S's, so n 1 =3, three are T'

Example of linear equations, Example of Linear Equations: Solve the eq...

Example of Linear Equations: Solve the equation 2x + 9 = 3(x + 4). Solution: Step 1. Using Axiom 2, subtract 3x and 9 from both sides of the equation. 2x + 9 = 3(

Separable differential equations, We are here going to begin looking at non...

We are here going to begin looking at nonlinear first order differential equations. The first type of nonlinear first order differential equations which we will see is separable di

Find the coordinates of the other two vertices, The two opposite vertices o...

The two opposite vertices of a square are (-1, 2) and (3, 2). Find the coordinates of the other two vertices.

Determine the quotient and remainder , Let a = 5200 and b = 1320. (a) If...

Let a = 5200 and b = 1320. (a) If a is the dividend and b is the divisor, determine the quotient q and remainder r. (b) Use the Euclidean Algorithm to find gcd(a; b). (c)

Functions, the function g is defined as g:x 7-4x find the number k such tha...

the function g is defined as g:x 7-4x find the number k such that kf(-8)=f- 3/2

Ratios....., if the ratio of boys to girls ism 3 to 5, then what percent of...

if the ratio of boys to girls ism 3 to 5, then what percent of the students are boys

Explain adding rational expressions different denominators, Explain Adding ...

Explain Adding Rational Expressions with Different Denominators When you add or subtract fractions or rational expressions that have different denominators, you must first find

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