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

Whole numbers, Observe that natural numbers do not have a zero....

Observe that natural numbers do not have a zero. This shortcoming is made good when we consider the set of whole numbers. The set of whole numbe

Helping children learn mathematics, Here we have focussed on how mathematic...

Here we have focussed on how mathematics learning can be made meaningful for primary school children. We have done this through examples of how children learn and how we can create

Mensuration, find the diameter of circle whose circumference is 26.51

find the diameter of circle whose circumference is 26.51

Elementary row operations, Anne, Betty and Carol went to their local produc...

Anne, Betty and Carol went to their local produce store to buy some fruit. Anne bought one pound of apples and two pounds of bananas and paid $2.11. Betty bought two pounds of appl

Explain the counting principle in maths, Explain the Counting Principle in ...

Explain the Counting Principle in maths? The fundamental counting principle is used when you want to calculate the total number of possible outcomes (or combinations) of an exp

Inequalities, seven more than a number is less than or equal to -18

seven more than a number is less than or equal to -18

Systems of linear equation, a man can row a bangka at a rate of 5 km/h in s...

a man can row a bangka at a rate of 5 km/h in still water. It takes 10 minutes longer to row upstream a distance of 2km than he takes to row downstream. What is the rate of the cur

Proof of root test - sequences and series, Proof of Root Test  Firstly...

Proof of Root Test  Firstly note that we can suppose without loss of generality that the series will initiate at n = 1 as we've done for all our series test proofs.  As well n

Aging, The average age of a woman and her daughter is 16 years. The ratio o...

The average age of a woman and her daughter is 16 years. The ratio of their ages is 7: 1. Then the woman''s age is

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