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

Fractions, a boy is six months old his sister was given birth to three mont...

a boy is six months old his sister was given birth to three month after him. if their cousin is 0.33years old, arrange their ages in ascending order

?, x/15=50/20

x/15=50/20

Angles, samuel left mauritius at 22:30 on saturday and travelled to london ...

samuel left mauritius at 22:30 on saturday and travelled to london (GMT) for 14h30min he had a stopover for 4 h in london and he continued to travel to toronto for another 6h20min

Illustrate child ability to perform a math task, Give an example to illustr...

Give an example to illustrate how language incompetence can interfere with a child's ability to perform a task. While setting up a classification activity, a teacher gave the ch

Bar charts, I''m supposed to be writing a critique for my maths project whe...

I''m supposed to be writing a critique for my maths project where i compare the prices for different holidays. i don''t know what to write for a critique though, any tips on what w

Explain graphing equations with a negative slope, Explain Graphing Equation...

Explain Graphing Equations with a Negative Slope? If the slope is a negative fraction, place the negative sign on either the numerator or the denominator. Example graph y = -2/

Universal set, Universal set The term refers to the set which contains...

Universal set The term refers to the set which contains all the elements such an analyst wishes to study.  The notation U or ξ is usually used to denote universal sets.

Numercial analysis and computer techniques, write FORTRAN programme to gene...

write FORTRAN programme to generate prime numbers between 1 and 100

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