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

Example of multiplication, Example 1: Multiply 432 by 8. Solution: ...

Example 1: Multiply 432 by 8. Solution:        432 ×        8 --------------       3,456 In multiplying the multiplier in the units column to the multiplica

If all the tickets are the similar price what was the cost, The total ticke...

The total ticket sales for a soccer game were $1,260; 210 tickets were purchased. If all the tickets are the similar price, what was the cost of a ticket? Divide the total sale

What it means to count-learning to count, What do we understand by "being a...

What do we understand by "being able to count"? Think about the following situation before you answer. Example 1: Three year-old Mini could recite numbers from I to 20 in the co

Permuation and combination, how many words can be formed from letters of wo...

how many words can be formed from letters of word daughter such that word contain 2vowles and 3consonant

Distinct eigenvalues –system solving, DISTINCT EIGENVALUES -SYSTEM SOLVING ...

DISTINCT EIGENVALUES -SYSTEM SOLVING : E xample Solve the following IVP. Solution : Therefore, the first thing that we must to do that is, get the eigenvalues

Operations research, scope of operation research and its limitations

scope of operation research and its limitations

Differential equation, Suppose a fluid (say, water) occupies a domain D? R^...

Suppose a fluid (say, water) occupies a domain D? R^(3 ) and has velocity field V=V(x, t). A substance (say, a day) is suspended into the fluid and will be transported by the fluid

The prerequisites for multiplication, THE PREREQUISITES FOR MULTIPLICATION ...

THE PREREQUISITES FOR MULTIPLICATION : The word 'multiply', used in ordinary language, bears the meaning 'increase enormously For instance, bacteria multiply in favourable conditi

Brian 100-yard dash time was 2.68 what is the school record, Brian's 100-ya...

Brian's 100-yard dash time was 2.68 seconds more than one school record. Brian's time was 13.4 seconds. What is the school record? The school record is less than Brian's time.

Critical points, Critical Point Definition : We say that x = c is a critic...

Critical Point Definition : We say that x = c is a critical point of function f(x) if f (c) exists & if either of the given are true. f ′ (c ) = 0        OR             f ′ (c

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