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

Statistics Assignment, A. Design an investigation that details the followi...

A. Design an investigation that details the following six components:

What is transitive relations:, R is called as a transitive relation if (a, ...

R is called as a transitive relation if (a, b) € R, (b, c) € R → (a, c) € R In other terms if a belongs to b, b belongs to c, then a belongs to c.         Transitivity be uns

Climate and vegetation of southeast asia, 1.) How does the monsoon influenc...

1.) How does the monsoon influence the climate and vegetation of Southeast Asia? 2.) What is the main crop in Southeast Asia and the main systems by which it is produce? How and

Classification-developing pre-number concepts, Classification :  As you kn...

Classification :  As you know, classification (also called grouping) involves putting together things that have some characteristic in common. We can say that a child is able to c

Definite integral, Definite Integral : Given a function f ( x ) which is c...

Definite Integral : Given a function f ( x ) which is continuous on the interval [a,b] we divide the interval in n subintervals of equivalent width, Δx , and from each interval se

Example of convergent or divergent - comparison test, Determine if the subs...

Determine if the subsequent series is convergent or divergent. Solution As the cosine term in the denominator doesn't get too large we can suppose that the series term

What is the maximum number calories which consume from fats, Josephine is o...

Josephine is on an 1,800 calorie per day diet. She tries to remain her intake of fat to no more than 30% of her overall calories. Based on an 1,800 calorie a day diet, what is the

Number of permutations of ''n'' dissimilar things , Finding the numbe...

Finding the number of Permutations of 'n' dissimilar things taken 'r' at a time:  After looking at the definition of permutations, we look at how to evolve a

Math, what is division

what is division

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