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

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.

Territories never was a venitian possesion, Which of those territories neve...

Which of those territories never was a Venitian possesion? Cyprus Morea Crete Sicily

Calculus, find or evaluate the integral integrate((e^2x + e^x + 1)/(e^x))dx...

find or evaluate the integral integrate((e^2x + e^x + 1)/(e^x))dx

Childrens errors are a natural and inevitable part, Childrens errors are a ...

Childrens errors are a natural and inevitable part of their process of learning. In the process of grasping new concepts, children apply their existing understanding, which may

Area, #What is an easy way to find the area of any figure

#What is an easy way to find the area of any figure

Proper fractions, find all the kinds of fraction and give an 10 examples.

find all the kinds of fraction and give an 10 examples.

Ordinary and partial differential equations, A differential equation is ter...

A differential equation is termed as an ordinary differential equation, abbreviated through odes, if this has ordinary derivatives in it. Similarly, a differential equation is term

Prove the boolean expression, Prove the subsequent Boolean expression: ...

Prove the subsequent Boolean expression: (x∨y) ∧ (x∨~y) ∧ (~x∨z) = x∧z Ans: In the following expression, LHS is equal to:   (x∨y)∧(x∨ ~y)∧(~x ∨ z) = [x∧(x∨ ~y)] ∨ [y∧(x∨

What is plotting points, What is Plotting Points ? How would you go abo...

What is Plotting Points ? How would you go about drawing the graph of y = x2 ? One way to do it is by plotting points. (Your graphing calculator uses this method.) This 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