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 subtraction , Example of subtraction: Example: Subtrac...

Example of subtraction: Example: Subtract 78 from 136. Solution:     2 136 -78 ------  58 While subtracting the units column, 6 - 8, a 10 that is b

Naming fractions greater than 1, the 10 miles assigned to the chess club st...

the 10 miles assigned to the chess club start at the 10 mile point and go to the 20 mile point when the chess club members have cleaned 5/8 of their 10 mile section between which m

Trignometric Equations, Equation for the given intervaks in the intervaks, ...

Equation for the given intervaks in the intervaks, giving ypout answer correct to 0.1 1.sin x = 0.8 0 2. cos x =-0.3 -180 3.4cos theta- cos theta=2 0 4. 10tan theta+3=0 0

Basic differential equation, Two 1000 liter tanks are containing salt water...

Two 1000 liter tanks are containing salt water. Tank 1 has 800 liters of water initially having 20 grams of salt dissolved in this and tank 2 has 1000 liters of water and initially

Mathematics- in our lives , MATHEMATICS - IN OUR LIVES : What is the mo...

MATHEMATICS - IN OUR LIVES : What is the most obvious example of mathematics in your life? To many of us it is the maths that we studied in school. But is that all the mathemat

Collecting and interpreting data, Q. How to Collecting and interpreting dat...

Q. How to Collecting and interpreting data? Ans. Collecting and interpreting data is the most important job of a statistician. There are many types of studies and differe

Express the product of -9p3r and the quantity 2p - 3r, Express the product ...

Express the product of -9p3r and the quantity 2p - 3r in simplified form. The translated expression would be -9p3r(2p - 3r). Noticed that the key word product means multiply.

Triangles, CM and RN are resp. the medians of triangle ABC and Triangle PQR...

CM and RN are resp. the medians of triangle ABC and Triangle PQR.if triangle ABC similar to Triangle PQR TRIANGLE AMC SIMILAR TO PNR

What are natural numbers and whole numbers, What are Natural Numbers and Wh...

What are Natural Numbers and Whole Numbers? Natural numbers are the numbers that you "naturally" use for counting: 1, 2, 3, 4, ... The set of whole numbers is the set of

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