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

Solution to a differential equation, A solution to a differential equation ...

A solution to a differential equation at an interval α Illustration 1:   Show that y(x) = x -3/2 is a solution to 4x 2 y′′ + 12xy′ + 3 y = 0 for x > 0. Solution : We'll

Math, could you help me get bater at math

could you help me get bater at math

Sales Tax and Value added Tax, Dinesh bought an article for Rs. 374, which ...

Dinesh bought an article for Rs. 374, which included a discount of 15% on the marked price and a sales tax of 10% on the reduced price. Find the marked price of the article.

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.

Hypothesis testing procedure, Hypothesis Testing Procedure Whenever a b...

Hypothesis Testing Procedure Whenever a business complaint comes up here is a recommended procedure for conducting a statistical test. The reason of such a test is to establish

Variance, Variance Consider the example of investment opportunities. Th...

Variance Consider the example of investment opportunities. The expected gains were Rs.114 and Rs.81 respectively. The fact is that an investor also looks at the dispersion befo

Help me, How should Shoppers’ Stop develop its demand forecasts?

How should Shoppers’ Stop develop its demand forecasts?

Solutions to systems, Now that we've found some of the fundamentals out of ...

Now that we've found some of the fundamentals out of the way for systems of differential equations it's time to start thinking about how to solve a system of differential equations

How many days are there in a year, There are m months in a year, w weeks wi...

There are m months in a year, w weeks within a month and d days in a week. How many days are there in a year? In this problem, multiply d and w to obtain the total days in one

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