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

What is the marginal product of labor function, Your engineering department...

Your engineering department estimated the following production function. Q = 15L 2 - 0.5L 3 a. What is the marginal product of labor function, MP L ? b. What is the aver

Division of two like terms, Case 1: Suppose we have two terms 8ab and 4ab. ...

Case 1: Suppose we have two terms 8ab and 4ab. On dividing the first by the second we have 8ab/4ab = 2 or 4ab/8ab = (1/2) depending on whether we consider either 8ab or 4ab as the

Discovery, i have discovered a formula for finding the radius at any point ...

i have discovered a formula for finding the radius at any point of the graph have i done a good job

Determine the price paid for a land, A parcel of land, value $250,000 is so...

A parcel of land, value $250,000 is sold to an investor who signs a contract agreeing to pay a deposit of $25,000 followed by equal quarterly payments for as long as necessary, wit

Modeling - nonhomogeneous systems, Under this section we're going to go bac...

Under this section we're going to go back and revisit the concept of modeling only now we're going to look at this in light of the fact as we now understand how to solve systems of

Problems involving motion - word problems, Problems Involving Motion - Word...

Problems Involving Motion - Word Problems: How far can a car travelling at a rate of 52 miles per hour travel in 2½ hours? Solution: Using Equation 13: s = vavt

Evaluate the integral, Example:   If c ≠ 0 , evaluate the subsequent integr...

Example:   If c ≠ 0 , evaluate the subsequent integral. Solution Remember that you require converting improper integrals to limits as given, Here, do the integ

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